Skip to content

Instantly share code, notes, and snippets.

View michaelcoyote's full-sized avatar
👀
building and learning

Michael michaelcoyote

👀
building and learning
View GitHub Profile
@michaelcoyote
michaelcoyote / basicvimkeys.md
Last active August 29, 2015 14:06
Basic Vim Keys

Basic VIM Keys

Notes

  • a number in front of most movement and edit keys acts as a multiplier to that key
    • e.g. 30j moves the cursor down 30 lines and 3i tora types toratoratora
  • editing can be stacked with movement characters
    • e.g. dw will delete a word
@michaelcoyote
michaelcoyote / linkdump
Last active August 29, 2015 14:06
Link Dump
PSSH - http://archive09.linux.com/feature/151340?theme=print
bash tests - http://tldp.org/LDP/abs/html/comparison-ops.html http://tldp.org/LDP/abs/html/fto.html
ssh agent - http://www.unixwiz.net/techtips/ssh-agent-forwarding.html
Mac KB shortcuts - http://support.apple.com/kb/ht1343
bosh docs - http://docs.cloudfoundry.org/bosh/
@michaelcoyote
michaelcoyote / manifest2vm.md
Last active August 29, 2015 14:06
BOSH Manifest to running VM

CF Manifest to running VM

Path

  1. Manifest contains information about a job to start in either the

  2. configuration templates/"spec" (from cf-release/jobs/<jobname>/) + stemcell + packages (from cf-release/packages)

  3. magic from the BOSH Director (prepare) takes the stemcell and starts it and lays over package info and configs in /var/vcap

@michaelcoyote
michaelcoyote / mintupgradenotes.md
Last active August 29, 2015 14:06
Mint in place upgrade notes
@michaelcoyote
michaelcoyote / tilde_tricks.md
Last active August 29, 2015 14:07
Stupid tilde.club tricks

Generate a list of users with a uid greater than 500

awk -F: '$3 > 500 {print $1}' /etc/passwd

Look for users with a space after the username grep " :x" /etc/passwd

It is possible to set the TZ variable on a per user or even per script basis.

@michaelcoyote
michaelcoyote / ck_userupdate.sh
Last active August 29, 2015 14:07
check for user running a program before updating and skip them if they are
#!/bin/bash
#
# Proof of concept
# check for user running a program before updating and skip them if they are
#
PROGRAM="irssi"
# Check ps for users running a process name & compare against list of non-admin users
#
@michaelcoyote
michaelcoyote / keybase.md
Created November 3, 2014 06:39
keybase.io for michaelcoyote

Keybase proof

I hereby claim:

  • I am michaelcoyote on github.
  • I am michaelcoyote (https://keybase.io/michaelcoyote) on keybase.
  • I have a public key whose fingerprint is DA1E 4F70 F783 3621 61A6 8549 67B5 CBC6 37EA A9D1

To claim this, I am signing this object:

@michaelcoyote
michaelcoyote / grepip.sh
Last active August 29, 2015 14:13
grep for ip address
# This is a function so, source me in.
# really basic grep function to find IP/netmask octets.
function ipgrep()
{
# find any pattern from "0.0.0.0" to "259.259.259.259"
# TODO fix this so it checks for legal octets (255.255.255.255) (Note: may be some time)
grep -o -E '\b(((2[0-5]|1[0-9])|[0-9])?([0-9]){1,2}\.){3}((2[0-5]|1[0-9])|[0-9])?([0-9])\b'
}
@michaelcoyote
michaelcoyote / java_sponsor_disable.reg
Created January 28, 2015 03:16
Disable the ask/yahoo/whatever toolbar install prompt
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
"SPONSORS"="DISABLE"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft]
"SPONSORS"="DISABLE"
@michaelcoyote
michaelcoyote / networker_daemonlog.conf
Last active August 29, 2015 14:17
Basic dumb simple networker daemon log grok filter for logstash
# Basic dumb simple networker daemon log grok filter for the NetWorker daemon.log
filter {
grok {
patterns_dir => "./patterns"
#
# NetWorker logfiles have some unusual fields that include undocumented engineering codes and what not
# time is in 12h format (ugh) so custom patterns need to be used.
# engcode1_Date&time in ampm format_engcode2_engcode3_engcode4_Parent Process ID_Process ID_engcode5_Process Host_Process Name_Everything else
match => [ "message", "%{NUMBER:engcode1} %{DATESTAMP_12H:timestamp} %{NUMBER:engcode2} %{NUMBER:engcode3} %{NUMBER:engcode4} %{NUMBER:ppid} %{NUMBER:pid} %{NUMBER:engcode5} %{WORD:processhost} %{WORD:processname} %{GREEDYDATA:daemon_message}" ]
}