Skip to content

Instantly share code, notes, and snippets.

View ChristopherA's full-sized avatar

Christopher Allen ChristopherA

View GitHub Profile
@ChristopherA
ChristopherA / README.md
Created February 13, 2017 19:00 — forked from lopezjurip/README.md
OSX Homebrew: docker-machine setup

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@ChristopherA
ChristopherA / extractemail.sh
Last active March 8, 2017 16:41
Extract Email Shell Script
#!/bin/bash
#Works as both "./extractemail.sh filename" and "cat filename | ./myscript.sh"
# Set variable input_file to either $1 or /dev/stdin, in case $1 is empty
# Note that this assumes that you are expecting the file name to operate on on $1
# # This version doesn't test if the input is a valid filename
# input_file="${1:-/dev/stdin}"
# If the script argument is provided and it is a file, then variable input_fille is
# assigned to the file name. If there is no valid argument then reads from stdin
@ChristopherA
ChristopherA / common-md-rst.md
Last active March 22, 2017 20:31 — forked from silverrain/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@ChristopherA
ChristopherA / Debian-apt-get-contrib-non-free.md
Last active May 7, 2024 22:21
How to enable contrib and non-free repos in Debian

As root you need to edit /etc/apt/sources.lst

Then add contrib and non-free at the end of each line that begins with deb and deb-src just like the example:

deb http://http.us.debian.org/debian jessie main contrib non-free

deb http://security.debian.org jessie/updates main contrib non-free
Verifying my Blockstack ID is secured with the address 1Fwaw6u32TCkmGdaxfKA1FH2th8V3Hc8r4 https://explorer.blockstack.org/address/1Fwaw6u32TCkmGdaxfKA1FH2th8V3Hc8r4
@ChristopherA
ChristopherA / homebrewfixes.md
Last active November 9, 2017 23:26
Various Homebrew related fixes…

Various Homebrew related fixes…

homebrew "missing xcrun"

How to fix homebrew error invalid active developer path after upgrade to OS X El Capitan

Run the following commands to fix the above error:

@ChristopherA
ChristopherA / atomicmv.md
Created November 10, 2017 01:57
Atomic mv

You should never assume that a mv command is atomic. Use the link dance:

ln -f extant new_link && rm -f extant

The hard link operations are atomic.

(The three step is when you want to save the old one:

ln -f extant new_name && ln -f new_file extant && rm new_file

@ChristopherA
ChristopherA / mac-model.md
Created November 12, 2017 06:20
Mac Model, CPU & Serial from Command Line
$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz

$ sysctl -n hw.model
MacBookPro14,2

$ ioreg -l | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s\n", line[4]); }'
C02VG13CHV2M
@ChristopherA
ChristopherA / debian9install.md
Last active December 12, 2017 07:06
Debian 9 Initial Install

Add additional sources

$ sudo nano /etc/apt/sources.list

Add contrib and nonfree

$ sudo apt-get update