Skip to content

Instantly share code, notes, and snippets.

View benjyiw's full-sized avatar
🍱

ben benjyiw

🍱
  • 10:36 (UTC -06:00)
View GitHub Profile
@benjyiw
benjyiw / pull-all-repos.sh
Last active April 28, 2022 16:13
pulls or clones all repositories in a list of orgs and/or users
#!/bin/bash
# pulls or clones all repositories in a list of orgs and/or users
set -euo pipefail
# required input
GITHUB_USER=""
GITHUB_PAT=""
REPOS_PATH="${HOME}/git"
@benjyiw
benjyiw / convert-mac
Created May 30, 2018 06:33
Convert mac address to Cisco format (xxxx.xxxx.xxxx) and back (xx:xx:xx:xx:xx:xx)
#!/bin/bash
mac="$@"
if [[ ${mac} == ??:??:??:??:??:?? ]]; then
sed 's/\://;s/\:/./;s/\://;s/\:/./;s/\://' <<< ${mac}
elif [[ ${mac} == ????.????.???? ]]; then
sed 's/\.//g;s/\(..\)/\1:/g;s/:$//' <<< ${mac}
else
echo 'That does not appear to be a mac address, try harder'
exit 1
@benjyiw
benjyiw / surl.py
Created May 19, 2018 02:57
python url shortener with goo.gl
#!/usr/bin/env python
# Get a Google API from here:
# https://console.developers.google.com/projectselector/apis/credentials?pli=1
import argparse
import json
import requests
GOOGLE_URL_SHORTEN_API = ''

Keybase proof

I hereby claim:

  • I am benjyiw on github.
  • I am justben (https://keybase.io/justben) on keybase.
  • I have a public key ASDlODoUxVgeXBPvmXchrdBG-X_5dgHRmnhFxgvPCt_bdAo

To claim this, I am signing this object: