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
//If you instead want to permanently ignore currently untracked files you can, from the root of your project, launch: | |
$ git status --porcelain | grep '^??' | cut -c4- >> .gitignore |
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
mongoexport -d {db name} -c {collection name} -q '{"_id":1}' --out ./records.json | |
mongoimport -u {user name} -p {password} --authenticationDatabase {db name} --db {db name} --collection {collection name} --file ./records.json --jsonArray |
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
find . -name '*.sql' | awk '{ print "source",$0 }' | mysql -v -u{user} -p{pass} -f {DB Name} --batch |
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
rsync --rsh='ssh' -av --progress --partial {user}@{domain or IP}:/home/dump.tar.gz ./ |
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
tar -xvzf ./dump.tar.gz |
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
#install | |
sudo apt-get install nginx | |
#remove default | |
sudo nano /etc/nginx/sites-available/default | |
sudo rm /etc/nginx/sites-enabled/default | |
#create new file | |
sudo nano /etc/nginx/sites-available/{appName} | |
server { | |
listen 80; |
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
#scp -i <keypair> myfile.txt ubuntu@ec2-x-x-x.com/home/ubuntu/myfile.txt |
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 your EC2 .pem file to ssh kys | |
ssh-add ~/aws/mypemfile.pem | |
//create bare repo on AWS EC2 webserver and deploy on demand | |
mkdir ~/git/the_project | |
cd ~/git/the_project | |
git init --bare | |
//create local repo and track remote one | |
cd ~/git/the_project |
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
#export branch to zip file | |
git archive --format zip --output /full/path/to/zipfile.zip master | |
#fix GIT issues | |
#Discarding all local commits on this branch | |
https://sethrobertson.github.io/GitFixUm/fixup.html#discard_all_unpushed |
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
<VirtualHost *:80> | |
DocumentRoot "/Library/WebServer/Documents/appname" | |
ServerName appname.local | |
ServerAlias www.appname.local | |
ErrorLog "/private/var/log/apache2/appname.local.error" | |
CustomLog "/private/var/log/apache2/appname.local.custom" common | |
<Directory /Library/WebServer/Documents/appname/> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted |
OlderNewer