commit df6804cbab51fce9d9d2555986a8379b0ef30641
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 15 Feb 2017 03:28:08 +0100
initial import
Diffstat:
7 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/Awk.wiki b/Awk.wiki
@@ -0,0 +1,12 @@
+= awk knowledgebase =
+
+== sum numbers from a pipe ==
+	{{{
+	cat history.json | jq '.[] | select( .id | contains("dyne")) | .amount'
+	1200
+	1500
+	1500
+	1300
+		| awk '{s+=$1} END {print s}'
+	5500
+	}}}
diff --git a/Cmus.wiki b/Cmus.wiki
@@ -0,0 +1,9 @@
+= cmus knowledgebase =
+
+== filter out mp3s if there are FLACs of the same ==
+	{{{
+	:fset mp3=filename="*.mp3" # defined by default
+	:fset flac=filename="*.flac"
+	:fset flac-or-mp3=flac|mp3
+	:filter
+	}}}
diff --git a/JSON.wiki b/JSON.wiki
@@ -0,0 +1,15 @@
+= json knowledgebase =
+
+== parsing with jq (linux cli) ==
+
+	{{{
+	cat companies.json | jq '.[].id'
+
+	cat history.json| jq '.[] | length' |wc -l
+
+	cat companies.json | jq '.[] | select( .id | contains("dyne")) | .vat'
+	}}}
+
+use "jq -e" to return exitcodes. see jq(1)
+
+use "jq -r" to return raw data without ""
diff --git a/Shell.wiki b/Shell.wiki
@@ -0,0 +1,28 @@
+= Shell Programming Knowledgebase =
+
+== ZSH ==
+
+=== Get the count of items in an array ===
+	{{{shell
+	$#array
+	}}}
+
+== POSIX ==
+* http://www.etalabs.net/sh_tricks.html
+
+=== Globbing directories ===
+	{{{shell
+	printf %s\\n */
+	}}}
+
+== Random Oneliners ==
+
+=== Find world-writable files (excluding symlinks) ===
+	{{{shell
+	find /var/www -perm -o+w -a -not -type l -ls
+	}}}
+
+=== awk - print everything except $1 ===
+	{{{shell
+	awk '{for (i=2; i<=NF; i++) print $i}' filename
+	}}}
diff --git a/Vim.wiki b/Vim.wiki
@@ -0,0 +1,12 @@
+= Vim Knowledgebase =
+
+== Useful Links ==
+* https://sanctum.geek.nz/arabesque/series/unix-as-ide/
+
+== Workflow ==
+
+=== Spelling ===
+	{{{viml
+	set spell
+	set spelllang
+	}}}
diff --git a/Xorg.wiki b/Xorg.wiki
@@ -0,0 +1,9 @@
+= Xorg Knowledgebase =
+
+== X without root ==
+	{{{shell
+	chown -v :input /usr/bin/Xorg
+	chmod -v g+s /usr/bin/Xorg
+	usermod -a -G video user
+	startx -- vt1 -nolisten tcp
+	}}}
diff --git a/index.wiki b/index.wiki
@@ -0,0 +1,13 @@
+= Knowledgebase =
+
+== Linux ==
+* [[Vim]]
+* [[Xorg]]
+* [[Cmus]]
+
+== Programming ==
+* [[Shell]]
+* [[Awk]]
+
+== Data ==
+* [[JSON]]