Merge branch 'master' of https://github.com/ozdemircili/cheat into ozdemircili-master

* 'master' of https://github.com/ozdemircili/cheat:
  Added history cheatsheet
  Added history cheatsheet
  History
  Added histroy cheatsheet
  Took out listing of Readme and License file on cheatsheets
  Added mysql cheatsheet
  Added lsof cheatsheet
  Added 2 new cheatsheets
This commit is contained in:
Chris Lane
2013-08-26 19:12:54 -04:00
4 changed files with 14 additions and 1 deletions

2
cheatsheets/history Normal file
View File

@ -0,0 +1,2 @@
# To see most used top 10 commands:
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

3
cheatsheets/lsof Normal file
View File

@ -0,0 +1,3 @@
# To find listening ports
lsof -Pnl +M -i4

5
cheatsheets/mysql Normal file
View File

@ -0,0 +1,5 @@
# To create a database in utf8 charset
CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
# To add a user and give rights on the given database
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;