Skip to content

Instantly share code, notes, and snippets.

View jaredmichaelwilliams's full-sized avatar

Jared Williams jaredmichaelwilliams

View GitHub Profile
@jaredmichaelwilliams
jaredmichaelwilliams / 0.Setup
Last active August 28, 2018 01:28
Setting up a Yubikey for use with SSH
Preparation
Purchase YubiKey NEO
Install X Code and Command Line Tools, if installing anything from source.
X Code can be installed from the App Store.
Command Line Tools are installed from X Code: X Code -> Preferences -> Downloads -> Components -> Command Line Tools.
Install YubiKey reader library libyubikey (aka yubico-c)
Using homebrew:
brew install libyubikey
brew install ykpers
@jaredmichaelwilliams
jaredmichaelwilliams / README
Created May 22, 2018 18:20
Javscript to invite all slack users to a channel.
1. Open slack in a browser
2. Go to the channel you want to invite everyone to
3. Using Command/Control and the '-' key, make the page small
4. Open the Javascript console
5. Copy into the console the contents of inviteusers.js
6. Hit enter and watch it invite the users.
7. You might have to run it a few times if you have a lot of users and it doesnt add everyone at first
8. Took 4 times to invite 3,000 people to a channel on my slack
#!/bin/bash
echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; echo -e "$c\t\t- $d\n" ; done | sort -n ; echo -e "Total: \t\t$(find $(pwd) | wc -l)\n"
@jaredmichaelwilliams
jaredmichaelwilliams / Quickly Add 5GB Swap File
Last active March 24, 2018 09:03
Quick Add 5GB Swap File, and add to fstab
dd if=/dev/zero of=/mnt/swap bs=1024 count=5242880;
mkswap /mnt/swap;
chown root:root /mnt/swap ;
chmod 0600 /mnt/swap ;
swapon /mnt/swap;
echo "/mnt/swap swap swap defaults 0 0" >> /etc/fstab;
@jaredmichaelwilliams
jaredmichaelwilliams / tinder_like.js
Last active August 6, 2016 17:02
Use Tinder's api to like everyone in the area, over and over and over again.
STEPS
1. go to this link https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token
2. AS SOON as the link loads, copy it, otherwise if you wait even one second too long, it will change because of facebooks security.
3. copy the token off the link, should be a pretty long string.
a. like this 'CAAGm0PX4ZCpsBABSh7cXCD8FC7jqhagPRBdwGZC8fLMmZCeY1dgjZBXCORBQoUN7koqGjQl3oDRZCaoZBc6FmwMBbs03p0SIL6dRW9ZCgzYGZC1qfd50vtqvzzxK3D9jMn1nkizgjMPStZAjxjxxOUNzwUYjg74Jv5QKiTEeIKsfMDvt6uOZAKsXGAGkzoBVal2ZBGhHNPZCHitJTVUNfFsZCZCQxmZBoZANH4IvYGppr0JkHCGBHgZDZD',
4. copy that into the o_token variable
5. Go to your Facebook profile, and copy the name you made or profile id, and copy that into the fb_id variable.
6. make a new folder somewhere
7. c

Keybase proof

I hereby claim:

  • I am jaredmichaelwilliams on github.
  • I am jaredwilliams (https://keybase.io/jaredwilliams) on keybase.
  • I have a public key ASAa4mj-mcnTOHi_vDoEmou9A9tiXeeNbrd7ax8EteqvGAo

To claim this, I am signing this object:

@jaredmichaelwilliams
jaredmichaelwilliams / crypto-wrong-answers.md
Created November 18, 2015 16:12 — forked from paragonie-scott/crypto-wrong-answers.md
An Open Letter to Developers Everywhere (About Cryptography)
@jaredmichaelwilliams
jaredmichaelwilliams / elapsed-one-liner.sh
Last active October 21, 2015 02:38
Time elapsed in minutes and seconds since date on OS X - use with `watch` for updating clock
date1=$(date -j -f "%b %d %T %Z %Y" "Oct 20 21:00:00 EDT 2015" "+%s") date2=$(date +%s) diff=$(($date2-$date1)) ; echo "$(($diff / 60)) minutes and $(($diff % 60)) seconds elapsed."
@jaredmichaelwilliams
jaredmichaelwilliams / Extract URLs from Text
Last active September 24, 2015 17:04
Extract URLs from text.
command with text output | grep -Eo "(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?"
@jaredmichaelwilliams
jaredmichaelwilliams / Notes
Last active September 17, 2015 19:17
10 Random Words off Random Wikipedia Articles - Use for Passwords
Dependencies
brew install gnu-sed