This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage="Usage: . ./save.sh < filename | all | -n string | -b string>" | |
if [ -z "$1" ]; then | |
echo $usage | |
return | |
fi | |
savedDir='/path/to/your/git-repo' | |
randos="$savedDir/randos" | |
notes="$savedDir/notes.txt" | |
bookmarks="$savedDir/bookmarks.txt" | |
workingDir=$(pwd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remember there are file size limits in V8 | |
for (const file of files) { | |
reader = new FileReader(); | |
totalBytes += file.size; | |
totalFiles++; | |
reader.onload = event => { | |
filesRead++; | |
const binary = event.target.result; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Add a "squash" alias that calls this file and then you can squash your commits by running "squash master" (or whichever branch you want to rebase against) | |
base_branch=$1 | |
if [[ -n "$base_branch" ]]; then | |
current_branch=`git branch --show-current`; | |
echo "Squashing $current_branch"; | |
commits=`git log $base_branch..$current_branch --oneline | wc -l | xargs`; | |
echo "$commits commits"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from boto3.dynamodb.conditions import Key, Attr | |
import json | |
import os | |
# Environment variables | |
region_name = "us-east-1" | |
collection_table_name = "Collection-gbunibuh3vhgpnbianmozt7oam-colmap" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from boto3.dynamodb.conditions import Key, Attr | |
import json | |
import os | |
# Environment variables | |
region_name = "us-east-1" | |
collection_table_name = "Collection-tc5r2gm3yjddnfs4dl4vblcari-colmap" | |
collectionmap_table_name = "Collectionmap-tc5r2gm3yjddnfs4dl4vblcari-colmap" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
import os | |
# Environment variables | |
region_name = "us-east-1" | |
test_table = "Collection-cg5wa4as3fgkdpyrghj5g2z2jq-leestest" | |
source_table_name = test_table | |
target_table_name = test_table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://geoblacklight.dld.lib.vt.edu:8983/solr/development/update?stream.body=%3Cdelete%3E%3Cquery%3E%2A%3A%2A%3C%2Fquery%3E%3C%2Fdelete%3E&commit=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-setuptools | |
sudo easy_install pip | |
sudo pip install youtube-dl | |
youtube-dl -F <id> | |
youtube-dl --restrict-filenames -f <format> <id> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/ldap' | |
email = ARGV[0] | |
ldap = Net::LDAP.new(host: 'directory.vt.edu') | |
ldap.bind | |
treebase = 'ou=People,dc=vt,dc=edu' | |
ldap_attributes = {display_name: :displayname, department: :department} | |
filter = Net::LDAP::Filter.eq('mail', email) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Upgrading ansible installation" | |
brew upgrade ansible | |
echo "" | |
echo "" | |
echo "Copying ldap_search.rb from gist.github.com" | |
curl -L https://gist.githubusercontent.com/whunter/02bc567781b7e3d4c9928b330e8b26b5/raw/43d8ae290b165dd2d98754b51c5c0faac0ab4543/ldap_query.rb > ./ldap_query.rb |
NewerOlder