This file contains hidden or 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
# update on ubuntu | |
cd ~/.rbenv/ | |
git pull | |
cd plugins/ruby-build | |
git pull | |
rbenv install -l | |
rbenv install 2.0.0-p195 | |
rbenv global 2.0.0-p195 | |
ruby -v | |
gem update --system |
This file contains hidden or 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
tar -zcvf archive.tar.gz dir | |
# -z: Compress archive using gzip program | |
# -c: Create archive | |
# -v: Verbose i.e display progress while creating archive | |
# -f: Archive File name | |
# Extract | |
tar -zxvf archive.tar.gz -C dir |
This file contains hidden or 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
$ git checkout -b feature dev | |
# ... | |
$ git checkout dev | |
$ git merge --no-ff feature | |
$ git branch -d feature | |
$ git push origin dev |
This file contains hidden or 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
diskutil list | |
diskutil unmountDisk /dev/disk1 | |
dd if=/Users/vlad/Downloads/imagefile.iso of=/dev/disk1 bs=1m |
This file contains hidden or 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
ps aux | grep puma |
This file contains hidden or 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
# dump all databases | |
mysqldump --user=root --password=pass --all-databases > localhost.sql | |
# dump specific databases | |
mysqldump --user=root --password=pass --databases DB_NAME1 DB_NAME2 DB_NAME3 > backup.sql | |
# restore from file | |
mysql --verbose --user=root --password=pass DB_NAME < /PATH/TO/DUMPFILE.SQL | |
# copy database |
This file contains hidden or 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
`mkdir .ssh` | |
cat ~/.ssh/id_rsa.pub | ssh [email protected] 'cat >> ~/.ssh/authorized_keys' | |
# optional | |
sudo chmod 700 .ssh | |
sudo chmod 640 .ssh/authorized_keys |
This file contains hidden or 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
server{ | |
server_name www.domain.com; | |
return 301 $scheme://domain.com$request_uri; | |
} | |
server{ | |
server_name domain.com; | |
[...] | |
} |
This file contains hidden or 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
<!-- 1. "Show Package Contents" --> | |
<!-- 2. Open Info.plist --> | |
<!-- 3. append to "dict" section: --> | |
<key>LSUIElement</key> | |
<string>1</string> | |
<!-- Worked for iTerm. --> | |
<!-- Or change Info.plist to have: --> | |
<key>LSUIElement</key> | |
<true/> |
This file contains hidden or 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
➜ wordpress sudo chown -R _www ./ | |
➜ wordpress sudo chmod -R g+w ./ |