commit ae593b18c190e376c96f1404ae792a76e580c87d
parent c090ede63bb7af6c7e2a76c8d91b2781aed3270d
Author: parazyd <parazyd@dyne.org>
Date: Mon, 5 Feb 2018 18:21:19 +0100
More random commands.
Diffstat:
5 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/Git.wiki b/Git.wiki
@@ -40,3 +40,9 @@
== backup untracked files ==
git ls-files --others -i --exclude-standard | xargs zip untracked.zip
+
+== delete a tag from the remote ==
+
+ git tag -d 12345
+ git push origin :refs/tags/12345
+
diff --git a/Useful commands.wiki b/Useful commands.wiki
@@ -0,0 +1,14 @@
+= useful random commands =
+
+== boot a kernel with qemu-system-arm ==
+ {{{
+ qemu-system-arm -enable-kvm -M virt -cpu host -m 512M -kernel zImage -nographic
+ }}}
+
+
+== ssh port forwarding ==
+
+ {{{
+ torsocks ssh -L10443:10.20.40.150:443 root@ru23abastzmgpecs.onion
+ }}}
+
diff --git a/index.wiki b/index.wiki
@@ -11,9 +11,12 @@ Managed with [vimwiki](https://github.com/vimwiki/vimwiki)
== Programming ==
* [[Shell]]
* [[Awk]]
+* [[sed]]
+* [[oneliners]]
== Data ==
* [[JSON]]
== Misc ==
* [[Git]]
+* [[Useful commands]]
diff --git a/oneliners.wiki b/oneliners.wiki
@@ -0,0 +1,15 @@
+= random oneliners =
+
+== parse access.log for countries ==
+
+ {{{
+ awk '{print $1}' access.log \
+ | uniq \
+ | while read line; do \
+ geoiplookup $line \
+ done \
+ | grep Country \
+ | sort \
+ | awk -F: '{print $2}' \
+ | cut -b 2-
+ }}}
diff --git a/sed.wiki b/sed.wiki
@@ -0,0 +1,13 @@
+= sed knowledgebase =
+
+== paragraphs ==
+
+ {{{
+ sed '2,/^$/d'
+ }}}
+
+== trailing whitespace ==
+
+ {{{
+ sed 's/[ \t]*$//'
+ }}}