Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
nghuuphuoc / 1) Install
Last active Mar 19, 2021
Install Redis on Centos 6
View 1) Install
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@nghuuphuoc
nghuuphuoc / gist:7398312
Last active Mar 17, 2021
Install npm, nodejs on Centos 6
View gist:7398312
# Enable Fedora Extra Packages for Enterprise Linux (EPEL) repos
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Install npm from the epel repos
$ sudo yum install npm --enablerepo=epel
@nghuuphuoc
nghuuphuoc / gist:8282411
Last active Feb 19, 2021
Install wkhtmltopdf on Centos 6 x64
View gist:8282411
$ wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
// In case you got the issue
// wkhtmltopdf: error while loading shared libraries:
// libfontconfig.so.1: cannot open shared object file: No such file or directory
//
// run the command below:
$ yum install urw-fonts libXext libXrender fontconfig libfontconfig.so.1
@nghuuphuoc
nghuuphuoc / Add swap
Last active Dec 7, 2020
Fix MySQL issue "Fatal error: cannot allocate memory for the buffer pool" on Digital Ocean server
View Add swap
// Check swap
$ sudo swapon -s
Filename Type Size Used Priority --> empty
// Create and enable swap file
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 262140 KiB
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb
View OS X Window Levels (10.10)
2015-01-16 10:09:00.037 WindowLevels[72050:11476115] 0 (kCGBaseWindowLevelKey) : -2147483648
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 1 (kCGMinimumWindowLevelKey) : -2147483643
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 2 (kCGDesktopWindowLevelKey) : -2147483623
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 3 (kCGBackstopMenuLevelKey) : -20
2015-01-16 10:09:00.039 WindowLevels[72050:11476115] 4 (kCGNormalWindowLevelKey) : 0
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 5 (kCGFloatingWindowLevelKey) : 3
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 6 (kCGTornOffMenuWindowLevelKey) : 3
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 7 (kCGDockWindowLevelKey) : 20
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 8 (kCGMainMenuWindowLevelKey) : 24
2015-01-16 10:09:00.040 WindowLevels[72050:11476115] 9 (kCGStatusWindowLevelKey) : 25
@nghuuphuoc
nghuuphuoc / gist:7801133
Last active Jan 14, 2019
Install ImageMagick on Centos 6
View gist:7801133
// Install ImageMagick
$ yum install ImageMagick ImageMagick-devel
// Install php imagick extension
$ yum --enablerepo=remi,remi-test install php-pecl-imagick
@nghuuphuoc
nghuuphuoc / 1) Add repos
Last active Jul 30, 2018
Install PHP 5 on Centos 6
View 1) Add repos
// Install remi repos
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@nghuuphuoc
nghuuphuoc / 1) Install
Last active Dec 26, 2017
Install Vanish on Centos 6
View 1) Install
// Add repos
$ rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm
$ yum install varnish
$ chkconfig --level 345 varnish on
// Start Vanish
$ /etc/init.d/varnish start
@nghuuphuoc
nghuuphuoc / codegolf.md
Created Oct 15, 2017 — forked from xem/codegolf.md
JS code golfing
View codegolf.md

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@nghuuphuoc
nghuuphuoc / gist:8331575
Created Jan 9, 2014
chmod files to 644 and all folders to 755
View gist:8331575
$ find . -type d -print0 | xargs -0 chmod 0775
$ find . -type f -print0 | xargs -0 chmod 0664