whattimeisitonthesun.com

... and other useful things

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  

Currency calculation in Excel

Currency calculation in Excel Preparations; Price in base currency in Column P Base currency in Column Q Currencies in named cells in separate sheet Equation; =IF(Q1=”SEK”;P1*SEK;IF(Q1=”USD”;P1*USD;IF(Q1=”EUR”;P1*EUR;IF(Q1=”GBP”;P1*GBP;”Check the currency!”))))

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

Reset password for Windows 7 for free, with no additional software

Reset password for Windows 7 for free, with no additional software Insert either a Windows 7 installation DVD, or a Windows 7 System Repair disc into your optical drive and then restart your computer. After your computer boots from the… Continue Reading →

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 →

« Older posts

Wordpress theme design by Anders NorenUp ↑