It's simple command for transfer a large number of small files over ssh.
You need to first go to directory, if you want to copy content of directory.
cd /var/www
tar cpf - ./ | ssh <user>@<dest_ip> "tar xpf - -C /var/www"Preview speed copy with pv:
| <?php // Please do not copy this line | |
| add_action('admin_init', 'wt_remove_all_post_insert_actions'); | |
| function wt_remove_all_post_insert_actions() { | |
| $actions = array( | |
| 'save_post_product', // WooCommerce product insert | |
| 'wp_insert_post', | |
| 'save_post', |
| name: Serverless Delete example | |
| on: | |
| delete: | |
| branches: | |
| - actions-** | |
| # Specify what jobs to run | |
| jobs: | |
| deploy: |
| <?php | |
| //(js -> php) code. letter by letter | |
| global $n, $i, $id; | |
| $n = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/="; | |
| $id = 12345; //YOUR USER ID | |
| $i = [ | |
| 'v' => function($e) { | |
| return strrev($e); |
| Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this | |
| earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be | |
| retired. | |
| ## THE BELOW METHOD IS THE NEWER FCM METHOD: | |
| Register your app in the FCM Console: https://console.firebase.google.com (add project) | |
| 1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings. | |
| 2. Click on the GEAR settings icon, and then on "Project Settings" | |
| 3. In the main screen, click on "Cloud Messaging" |
| <?php | |
| function my_customize_rest_cors() { | |
| remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); | |
| add_filter( 'rest_pre_serve_request', function( $value ) { | |
| header( 'Access-Control-Allow-Origin: *' ); | |
| header( 'Access-Control-Allow-Methods: GET' ); | |
| header( 'Access-Control-Allow-Credentials: true' ); | |
| header( 'Access-Control-Expose-Headers: Link', false ); |
| ROUND((RAND() * (max-min))+min) |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #Compress and copy via SSH using SCP and TAR | |
| tar -czf - /some/file | ssh joebloggs@otherserver.com tar -xzf - -C /destination | |
| #Switch -c for tar creates an archive and -f which tells tar to send the new archive to stdout. | |
| #The second tar command uses the -C switch which changes directory on the target host. It takes the input from stdin. The -x switch extracts the archive. | |
| #The second way of doing the transfer over a network is with the -z option, which compresses the stream, decreasing time it will take to transfer over the network. | |
| #Some people may ask why tar is used, this is great for large file trees, as it is just streaming the data from one host to another and not having to do intense operations with file trees. | |
| #If using the -v (verbose) switch, be sure only to include it on the second tar command, otherwise you will see double output. | |
| #Using tar and piping can also be a great way to transfer files locally to be sure that file permissions are kept correctly |
| mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz' |