Skip to content

Instantly share code, notes, and snippets.

View jcanfield's full-sized avatar
💭
If I do not respond quickly, try me on Twitter at @creativeboulder.

Joshua Canfield jcanfield

💭
If I do not respond quickly, try me on Twitter at @creativeboulder.
View GitHub Profile
@jcanfield
jcanfield / new-macos-setup.sh
Created November 25, 2017 02:35 — forked from intfrr/new-macos-setup.sh
Things to setup/install on a new macOS
#!/bin/bash
# change default shell to zsh (asks for password)
chsh -s /bin/zsh
# install xcode command line tools
xcode-select --install
# download my custom .zshrc
curl https://gist.githubusercontent.com/simonhaenisch/382eab0cfa3435dad7e177a49fe198fc/raw/.zshrc > ~/.zshrc
@jcanfield
jcanfield / .bash_profile
Created November 25, 2017 02:33 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
color_0 = ffff ffff ffff
color_1 = 4949 4848 3e3e
color_2 = 6666 d9d9 efef
color_3 = 6b6b c7c7 2b2b
color_4 = fdfd 9797 1f1f
color_5 = f9f9 2626 7272
color_6 = 94bc 5925 ffff
color_7 = 7575 7171 5e5e
color_8 = e6e6 dbdb 7474
color_9 = a6a6 e2e2 2e2e
@jcanfield
jcanfield / googl.sh
Created June 11, 2017 07:33 — forked from trentm/googl.sh
Bash function to use the goo.gl URL shortener on stdin. See <https://developers.google.com/url-shortener/v1/getting_started> TODO: pbcopy it too if that command is available
# echo URL | googl
function googl {
local url=$(cat <&0)
(
set -e pipefail;
echo "{}" \
| json -e "this.longUrl='$url'" \
| curl -sf https://www.googleapis.com/urlshortener/v1/url \
-H 'Content-Type: application/json' -d@- \
| json id
@jcanfield
jcanfield / goo.gl.sh
Created June 11, 2017 07:28 — forked from wafflesnatcha/goo.gl.sh
Bash: goo.gl # Shorten a URL using the Google URL Shortener service (http://goo.gl).
#!/usr/bin/env bash
# Usage: goo.gl [URL]
#
# Shorten a URL using the Google URL Shortener service (http://goo.gl).
goo.gl() {
[[ ! $1 ]] && { echo -e "Usage: goo.gl [URL]\n\nShorten a URL using the Google URL Shortener service (http://goo.gl)."; return; }
curl -qsSL -m10 --connect-timeout 10 \
'https://www.googleapis.com/urlshortener/v1/url' \
-H 'Content-Type: application/json' \
-d '{"longUrl":"'${1//\"/\\\"}'"}' |
@jcanfield
jcanfield / dns_servers.md
Created June 4, 2017 05:15 — forked from roge/dns.md
Public DNS Servers

This is a list of trusted DNS servers put together by Rogue in order of priority.

Last Updated: 6/13/2014

Public DNS Servers (US, IPv4)

8.8.8.8         # Google Primary
8.8.4.4         # Google Secondary
4.2.2.1         # Level3 Main Primary
4.2.2.2         # Level3 Main Secondary
@jcanfield
jcanfield / public_dns_list
Created June 4, 2017 05:13 — forked from oldsharp/public_dns_list
public dns servers list
# google public dns
8.8.8.8
8.8.4.4
# opendns
208.67.222.222
208.67.220.220
# v2ex dns
199.91.73.222
@jcanfield
jcanfield / crawl_site
Created January 9, 2017 21:39 — forked from reidransom/crawl_site
Download an entire website with wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/

Unix Command Line Notes

  • Command settings
    • .bashrc
      • Aliases - place the following on a new line in the .bashrc file
        • alias [alias-name]='[alias command(s)]
        • Ex:alias ls='ls -lh'
    • .profile or .bash_profile
  • Add folders to you path