Skip to content

Instantly share code, notes, and snippets.

👀
building and learning

Michael michaelcoyote

👀
building and learning
  • The Bay Area, NorCal, Earth
Block or report user

Report or block michaelcoyote

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bash_readline.md

Bash key combinations and shortcuts

The bash shell uses a library called GNU Readline that provides easy and quick CLI key combination access to bash history, screen movement and line editing commands. I've collected some of these here along with some builtin bash shortcuts for history and other functions.

Note: The command bind -p will list all the keybindings and the readline functions they call.

@woodsaj
woodsaj / walk_tree.py
Last active Apr 2, 2019
Walk graphite metrics tree from specified prefix
View walk_tree.py
#!/usr/bin/python
import requests
import json
import argparse
from Queue import Queue
from threading import Thread, Lock
import sys
import unicodedata
@othiym23
othiym23 / wtf.md
Last active Sep 10, 2017
An experiment. Subject to change.
@mroth
mroth / git-music.sh
Last active Jan 25, 2017
Adds the currently playing iTunes track to your prepared git commit message.
View git-music.sh
#!/bin/bash
# Adds the currently playing iTunes track to your prepared commit message.
#
# To install, save in repo as chmod +x to .git/hooks/prepare-commit-msg
SONG=`osascript -e 'tell application "iTunes" to if player state is playing then "♬ : " & artist of current track & " / " & name of current track'`
if [[ $SONG ]]; then
echo -e "$(cat $1)\n\n$SONG" > $1
fi
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active Jul 25, 2019
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.
View Ansible-Vault how-to.md

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@joshbirk
joshbirk / force-oauth.py
Last active Jul 21, 2019
Another simple Python example with a real OAuth flow. This uses responses and the simple-salesforce lib
View force-oauth.py
#!/usr/bin/python
import cgi
import requests
import json
from simple_salesforce import Salesforce
#login here:
#https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py
@fyears
fyears / soinput.py
Created Nov 28, 2012
python stdin example
View soinput.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
usage:
cat about.txt | python soinput.py
'''
import sys
@fogus
fogus / 0 - UNIX Fifth Edition
Created Jul 20, 2011
UNIX V5, OpenBSD, Plan 9, FreeBSD, and GNU coreutils implementations of echo.c
View 0 - UNIX Fifth Edition
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
You can’t perform that action at this time.