whattimeisitonthesun.com

... and other useful things

Category

how-to

Rsync examples

Rsync examples Rsync (Remote Sync) is a commonly used command for copying and synchronizing files and directories remotely (as well as locally) in Linux/Unix systems. With the help of rsync command you can copy and synchronize your data remotely and… Continue Reading →

WordPress rewrite for Nginx

WordPress rewrite for Nginx Add the following line to Nginx site defintion: try_files $uri $uri/ /index.php?$args; Example:         root /www/htdocs/site.tld;         index index.php index.html;         try_files $uri $uri/ /index.php?$args;         location ~ \.php$ {                 include /etc/nginx/fastcgi_params;                 fastcgi_pass 127.0.0.1:9000;… Continue Reading →

Copy MySQL users from one server to another

Copy MySQL users from one server to another Copy MySQL users including db-rights: oldserver$ mysqldump mysql > mysql.sql newserver$ mysql mysql < mysql.sql newserver$ mysql ‘flush privileges;’ Remember to add -u $USER and -p$PASSWORD as required  

MySQL: Set field value based on timestamp

MySQL: Set field value based on timestamp UPDATE TABLE SET FIELD=”NEWVALUE” WHERE DATEFIELD < ‘2014-12-23 23:45:01‘;

Move WordPress site to new domain or new location

Move WordPress site to new domain or new location If you change the URL or link location of your WordPress site (e.g from www.olddomain.com to www.newdomain.com) or to another directory location (such as from www.domain.com to www.domain.com/blog), there are some… Continue Reading →

Restart PHP-FPM

Restart PHP-FPM Using SysV Init scripts directly: /etc/init.d/php-fpm restart   # typical /etc/init.d/php5-fpm restart   # debian-style Using service wrapper script service php-fpm restart    # typical service php5-fpm restart   # debian-style Using systemd (newer servers): systemctl restart php-fpm.service   # typical systemctl… Continue Reading →

Restore MySQL db from backup .gz

Restore MySQL db from backup .gz zcat DATABASE.sql.gz |mysql -uUSER -pPASSWORD DATABASE

rsync examples

Rsync examples $ rsync options source destination Source and destination could be either local or remote. In case of remote, specify the login name, remote server name and location. rsync archive mode rsync option -a indicates archive mode. -a option does… Continue Reading →

Add new hard drive to Debian Linux

Add new hard drive to Debian Linux Find out what the device name is for this disk fdisk -l This will give you output similar to this: Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units… Continue Reading →

Set MySQL root password from init-file

Set MySQL root password from init-file Stop the MySQL server by sending a normal kill to the mysqld process Create a text file containing the following statements (replace “TheNewPassword” with the password that you want to use): UPDATE mysql.user SET… Continue Reading →

Wordpress theme design by Anders NorenUp ↑