From c6ba4c79df7a7301216955363b51239c74ae0115 Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 16:44:19 +0200 Subject: [PATCH 1/8] Added 2 new cheatsheets --- cheatsheets/lsof | 0 cheatsheets/mysql | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cheatsheets/lsof create mode 100644 cheatsheets/mysql diff --git a/cheatsheets/lsof b/cheatsheets/lsof new file mode 100644 index 0000000..e69de29 diff --git a/cheatsheets/mysql b/cheatsheets/mysql new file mode 100644 index 0000000..e69de29 From 24e1c2748f607892bc5863fce052dea22c035f52 Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 16:51:57 +0200 Subject: [PATCH 2/8] Added lsof cheatsheet --- cheatsheets/lsof | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cheatsheets/lsof b/cheatsheets/lsof index e69de29..a7f45fa 100644 --- a/cheatsheets/lsof +++ b/cheatsheets/lsof @@ -0,0 +1,3 @@ +# To find listening ports +lsof -Pnl +M -i4 + From 0c027b792dc9f81ca87fc0864b1637235ef6f480 Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 16:52:09 +0200 Subject: [PATCH 3/8] Added mysql cheatsheet --- cheatsheets/mysql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cheatsheets/mysql b/cheatsheets/mysql index e69de29..2fe112f 100644 --- a/cheatsheets/mysql +++ b/cheatsheets/mysql @@ -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; \ No newline at end of file From e97d73a0e1e274726b2e467131d29abdb2ff7d26 Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 18:05:34 +0200 Subject: [PATCH 4/8] Took out listing of Readme and License file on cheatsheets --- cheat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cheat b/cheat index 6a054e3..0af41db 100755 --- a/cheat +++ b/cheat @@ -41,7 +41,9 @@ def cheat_files(cheat_directories): for cheat_dir in reversed(cheat_directories): cheats.update(dict([(cheat, cheat_dir) for cheat in os.listdir(cheat_dir) - if not cheat.startswith('.') + if not cheat.endswith('md') + and not cheat.startswith('.') + and not cheat.startswith('LICENSE') and not cheat.startswith('__')])) return cheats @@ -82,6 +84,7 @@ def main(): # if it does not, say so else: print 'No cheatsheet found for %s.' % keyphrase + def pretty_print(filename): From cdc512c8970436cd63cb96166b7f06a8d246d15f Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 18:24:14 +0200 Subject: [PATCH 5/8] Added histroy cheatsheet --- cheatsheets/history | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cheatsheets/history diff --git a/cheatsheets/history b/cheatsheets/history new file mode 100644 index 0000000..e69de29 From 62e4b73d2bca52bee6b38c49dc5e1cf3976466cb Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 18:26:52 +0200 Subject: [PATCH 6/8] History --- cheatsheets/history | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cheatsheets/history diff --git a/cheatsheets/history b/cheatsheets/history deleted file mode 100644 index e69de29..0000000 From 821290b41d9f378a9dd42e8a50b4dc192537ba1a Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 18:27:54 +0200 Subject: [PATCH 7/8] Added history cheatsheet --- cheatsheets/history | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cheatsheets/history diff --git a/cheatsheets/history b/cheatsheets/history new file mode 100644 index 0000000..e69de29 From 78fdc09f8c393cdaf4d171ef8a34fd857bb1ddc0 Mon Sep 17 00:00:00 2001 From: Ozdemircili Date: Mon, 26 Aug 2013 18:29:30 +0200 Subject: [PATCH 8/8] Added history cheatsheet --- cheatsheets/history | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cheatsheets/history b/cheatsheets/history index e69de29..90cf809 100644 --- a/cheatsheets/history +++ b/cheatsheets/history @@ -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 \ No newline at end of file