Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
| hs.hotkey.bind({}, "§", function() hs.eventtap.keyStroke({}, "`") end ) | |
| hs.hotkey.bind({ "cmd" }, "§", function() hs.eventtap.keyStroke({ "cmd" }, "`") end ) | |
| hs.hotkey.bind({ "shift" }, "§", function() hs.eventtap.keyStroke({ "shift" }, "`") end ) | |
| hs.hotkey.bind({ "cmd", "shift" }, "§", function() hs.eventtap.keyStroke({ "cmd", "shift" }, "`") end ) |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: nginx-conf | |
| data: | |
| nginx.conf: | | |
| user nginx; | |
| worker_processes 3; | |
| error_log /var/log/nginx/error.log; | |
| events { |
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
| #!/bin/bash | |
| APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens" | |
| SONG=$(osascript -e 'tell application "Spotify" to name of current track as string') | |
| URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"') | |
| while true | |
| do | |
| curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null | |
| sleep 60 | |
| done |
| package main | |
| import ( | |
| "fmt" | |
| "syscall" | |
| ) | |
| type DiskStatus struct { | |
| All uint64 `json:"all"` | |
| Used uint64 `json:"used"` |
| ## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/ | |
| --- | |
| - hosts: alpine_install | |
| user: root | |
| tasks: | |
| # - name: create a complete empty file | |
| # command: /usr/bin/touch /test/test.conf | |
| - name: create a new file with lineinfile |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000