This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of | |
// app.use(express.bodyParser()) | |
// use: | |
app.use(express.json()) | |
.use(express.urlencoded()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/ | |
$ groupadd apl_devs | |
$ useradd -g apl_devs -d /var/www/sass -s /sbin/nologin apl_dev_sass | |
$ passwd apl_dev_sass | |
Changing password for user apl_dev_sass. | |
New password: | |
Retype new password: | |
passwd: all authentication tokens updated successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rpm -Uvh http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.4.7-1.el6.ngx.x86_64.rpm | |
$ chkconfig --add nginx | |
$ chkconfig --levels 235 nginx on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://url --user=<user> --password=<password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Split file | |
$ split -b<size>m <bigFileName> <smallerFileName> | |
// Join files | |
$ cat <smallerFileName>* > <bigFileName> | |
For example: | |
$ split -b20m big.zip smaller.zip | |
$ cat smaller.zip* > big.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OS X Mountain Lion or Lion | |
$ sudo killall -HUP mDNSResponder | |
// Mac OS X v10.6 | |
$ sudo dscacheutil -flushcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html | |
$ wget http://dev.mysql.com/get/mysql-community-release-el6-4.noarch.rpm | |
$ sudo yum localinstall mysql-community-release-el6-4.noarch.rpm | |
// Check MySQL Yum repos has been added | |
$ sudo yum repolist enabled | grep "mysql-community" | |
Failed to set locale, defaulting to C | |
mysql-community MySQL Community Server 19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add mongo repos | |
$ nano /etc/yum.repos.d/10gen.repo | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 | |
enabled=1 | |
// Install Mongo | |
$ yum install mongo-10gen mongo-10gen-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://docs.mongodb.org/manual/tutorial/back-up-and-restore-with-mongodb-tools/ | |
// Backup | |
$ mongodump -u {username} -p {password} --db {db} --out {output} | |
// Restore | |
$ env LC_ALL=en_US.UTF-8 mongorestore --port {port number} --dbpath {db path} {path to the backup} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -r file.zip /path/to/src/dir |