Grant Acess to user for any host (MySQL)

GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'topsecret';

bash PS1

PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[31m\][\h]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"[ \"\\\$1 \" ]\" }"` \[\033[1;33m\]\w\a\[\033[0m\]\n\$ '

Install Ruby Gem

wget  http://production.cf.rubygems.org/rubygems/rubygems-1.8.21.tgz
tar xzvf rubygems-1.8.21.tgz
cd rubygems-1.8.21/
ruby setup.rb
gem update --system

Install mysql2 gem for Ruby

apt-get install libmysql-ruby libmysqlclient-dev
gem install mysql2

Fix zlib error on gem install

apt-get install zlib1g zlib1g-dev
cd /path/to/ruby/ext/zlib
ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib

Execute sql query on terminal

mysql -u [USER] -e 'SQL';

prune to remove old remote tracking branches

remove branch from server

git push origin :YOUR_BRANCH

remove local branch

git branch -D :YOUR_BRANCH

remove old branch from server

git remote prune origin

mysqldump only schema

mysqldump -u [USER] -p [-h HOST] -d > /path/to/dump.sql

Execute sql files from terminal

on terminal

mysql -u [user] -p [-h host] [database] < /path/to/file.sql

on client

source /path/to/file.sql

or

\. /path/to/file.sql

Show/hide hidden files on Mac OS using terminal

show files

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

hide files

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
Page 6 of 10« First...45678...Last »