Skip to content

Commit

Permalink
Merge branch 'master' of github.com:goggin13/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
goggin13 committed Mar 8, 2012
2 parents da85216 + d1f3402 commit 0bfb001
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
16 changes: 15 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Some helpful commands that I want to write down because I'm always looking them
* `git checkout <branch_you_want_to_merge_from> <file_paths...>`
* Update list of branches
* `git fetch`
* pull a specific commit from another branch
* `git cherry-pick <commit-hash>`
* checkout and track a remote branch
* `git checkout -b local-name origin/remote-name`
* Reset a file to a specific commit
Expand All @@ -60,7 +62,9 @@ Some helpful commands that I want to write down because I'm always looking them
* `for f in *; do mv $f $(echo $f | sed 's/male/female/g'); done`
* `for f in *; do mv $f $(echo $f | sed 's/female_\(.*\)_/&_female_/g'); done`
* tail a log for a specific result, showing 5 lines before and after it
* `tail -f log/production.log | grep -n5 "likes"`
* `tail -f log/production.log | grep -5 "likes"`
* `grep -A 5 "likes"` # just the 5 lines after the match
* `grep -B 5 "likes"` # just the 5 lines before the match

## MySQL
* run a script against a DB
Expand All @@ -69,6 +73,8 @@ Some helpful commands that I want to write down because I'm always looking them
* `mysqladmin -u root -pPASSWORD shutdown`
* dump a table to file
* `mysqldump -c -u root -pPASSWORD database table > ~/Desktop/dump.sql`
* write a query result to a file
* `mysql -e "select * from myTable" -u myuser -pxxxxxxxxx mydatabase > mydumpfile.txt`
* dump database ignoring some tables
* `mysqldump -c -u root -pPASS --database bnter_latest --ignore-table=bnter_latest.filedata --ignore-table=bnter_latest.files > ~/Desktop/bnter.sql`
* put logs to table (will reset on server restart)
Expand All @@ -77,6 +83,14 @@ Some helpful commands that I want to write down because I'm always looking them
* mysqldump -u root -p --opt --default-character-set=latin1 --skip-set-charset DBNAME > DBNAME.sql
* mysql -u root -p --default-character-set=utf8 DBNAME < DBNAME.sql
* see [SO post](http://stackoverflow.com/questions/346092/utf8-mysql-problems-on-rails-encoding-issues-with-utf8-general-ci)
* create a user and grant them privileges
* `CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';`
* `GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost';`
* Get size of all databases in MB
`SELECT table_schema "Data Base Name",`
` sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"`
`FROM information_schema.TABLES`
`GROUP BY table_schema;`

## OSX
* flush DNS cache
Expand Down
34 changes: 4 additions & 30 deletions bash/env_macbook
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@

export PATH=$PATH:~/bin
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.1/bin
export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.6/bin
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/Current/bin
export PATH=$PATH:/Users/mattgoggin/Library/godi/bin
export PATH=$PATH:/Users/mattgoggin/Library/godi/sbin
export PATH=$PATH:/Users/mattgoggin/.local/bin
export PATH=$PATH:/Users/mattgoggin/gtk/source/gtk+-2.24.0/gtk
export PATH=$PATH:/users/mattgoggin/Library/play-1.2.3
export PATH=$PATH:/opt/local/bin:/opt/local/sbin

export SCALA_HOME=/opt/local/share/scala-2.9
export PATH=$PATH:$SCALA_HOME/bin

export CLOJURESCRIPT_HOME=/Users/mattgoggin/Desktop/CS/clojurescript
export PATH=$PATH:$CLOJURESCRIPT_HOME/bin

export C_INCLUDE_PATH=/opt/local/var/macports/software/libev/3.9_0/opt/local/include
export LIBRARY_PATH=/opt/local/var/macports/software/libev/3.9_0/opt/local/lib
export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/
export PATH=$PATH:~/bin

export EVENT_NOKQUEUE=1
export CS=/Users/mattgoggin/Desktop/CS
export BNTER=$CS/rails_projects/bnter_rails
export DOTFILES=~/bin/dotfiles
export BNTER=~/projects/rails/banters
export STATLER=~/projects/rails/statler
export BLOG=~/Desktop/CS/home
export DOTFILES=~/bin/dotfiles

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/


# This loads RVM into a shell session.
[[ -s "/Users/mattgoggin/.rvm/scripts/rvm" ]] && source "/Users/mattgoggin/.rvm/scripts/rvm"

0 comments on commit 0bfb001

Please sign in to comment.