Skip to content

Instantly share code, notes, and snippets.

@eporroa
Last active December 24, 2015 06:59
Show Gist options
  • Save eporroa/6760795 to your computer and use it in GitHub Desktop.
Save eporroa/6760795 to your computer and use it in GitHub Desktop.
Web Development Utils tricks, commands or code snippets
##### ----- MySQL: ----- #####
#http://www.ducea.com/2006/10/28/compressing-mysqldump-output/
#dump a DB adding a time as filename and compress with gzip
mysqldump --compact -C --add-drop-table -u [user] -p --host=<host> <databasename> > backup_`date +%y%m%d`.sql | gzip -9 > backup_`date +%y%m%d`.sql
#import a database for MAMP
~ /Applications/MAMP/Library/bin/mysql -u [username] -p [database] < [path to file]
##### ----- /MySQL ----- #####
##### ----- GIT: ----- #####
https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678
#create a git repo from a non-empty folder
cd <localdir>
git init
git add .
git commit -m 'message'
git remote add origin <url.git>
#3 ways to push into the repo
git push -u origin --all
git push -u origin --tags
git push -u origin master
#archive and bzip it
git archive master | bzip2 >source-tree.tar.bz2
##### ----- /GIT ----- #####
##### ----- CURL ----- #####
curl -T file.tar.bz2 ftp://ftp.dominio.com --user user:clave
##### ----- /CURL ----- #####
tar -zxvf archive.tgz
tar -cvzf --exclude=__MACOSX --exclude=.DS_Store -f [FILE.tar.gz] [SOURCE_FOLDER]
cp -R -v source/. ./dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment