Skip to content

Instantly share code, notes, and snippets.

View moosh3's full-sized avatar
๐Ÿ
doing devop things

Alec Cunningham moosh3

๐Ÿ
doing devop things
View GitHub Profile
@moosh3
moosh3 / python_idioms.py
Last active September 29, 2015 04:21
Pythonic idioms, and conventions for reference
# Python Code Style
# Code like a Pythonista; Idioms
# http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
my_dict = {
"Name": "Alec",
"Age": 19,
"killa": True
}
@moosh3
moosh3 / .tmuxinator.conf
Created May 18, 2016 18:58
Example tmuxinator config
# ~/.tmuxinator/[project_name].yml
project_name: [project_name]
project_root: ~/Sites/[project_name]
pre: sudo /usr/local/mysql/support-files/mysql.server start
tabs:
- editor:
layout: 2545,364x87,0,0{242x87,0,0,121x87,243,0[121x43,243,0,121x43,243,44]}
panes:
- workon [project_name] && vim .
@moosh3
moosh3 / vim_commands.txt
Last active August 11, 2016 14:53
List of Vim commands for moving around
j "move downwards one cursor position i "insert at the cursor position
k "move upwards one cursor position I "insert at the beginning of the line
h "move left one cursor position a "append at cursor
l "move right one curson position A "append at end of line
e "move to end of word yy "copy a line
w "move to beginning of word yw "copy a word
W "move forward a WORD p "paste after cursor
3w "move forward three words P "paste before cursor
b "move backword one word dd "cut a line
3b "move backword three words dw "cut current word
@moosh3
moosh3 / exceptions.py
Created December 9, 2016 21:54
Good example of using try/except
def message_count(request):
''' Provides count of unread messages from the message center for given person '''
person = None
try:
if request.user.is_authenticated():
person = request.user.person
except AttributeError:
pass
if person:
@moosh3
moosh3 / vim-sanity.sh
Created December 24, 2016 23:45
Micro .vimrc file for retrieval from remote machines
#/usr/bin/env sh
# Vim sanity
# ----------
#
# This is meant to bootstrap a sane vim environment on a new machine for
# editing Python files and other configuration files. It is intended to be a
# minimalistic version of my full vimrc.
#
# This file will end up living at http://aleccunningham.xyz/vim.sh.
@moosh3
moosh3 / defaults
Created May 19, 2017 01:00
sensible defaults for OS X through terminal commands
# show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# show path bar
defaults write com.apple.finder ShowPathbar -bool true
# show status bar
defaults write com.apple.finder ShowStatusBar -bool true

Keybase proof

I hereby claim:

  • I am aleccunningham on github.
  • I am aleccunningham (https://keybase.io/aleccunningham) on keybase.
  • I have a public key ASDVWnn89eWkzgjSDIJ69Sa6ZFI-Fe_XxKO5CnpLzCr6Ngo

To claim this, I am signing this object:

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* This is <linux/capability.h>
*
* Andrew G. Morgan <[email protected]>
* Alexander Kjeldaas <[email protected]>
* with help from Aleph1, Roland Buresund and Andrew Main.
*
* See here for the libcap library ("POSIX draft" compliance):
*
@moosh3
moosh3 / cidr
Created October 25, 2018 17:30
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
@moosh3
moosh3 / values.yaml
Created November 22, 2018 00:20
datadog
# Default values for datadog.
image:
# This chart is compatible with different images, please choose one
repository: datadog/agent # Agent6
# repository: datadog/dogstatsd # Standalone DogStatsD6
tag: 6.6.0 # Use 6.6.0-jmx to enable jmx fetch collection
pullPolicy: IfNotPresent
## It is possible to specify docker registry credentials
## See https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
# pullSecrets: