I hereby claim:
- I am futureimperfect on github.
- I am futureimperfect (https://keybase.io/futureimperfect) on keybase.
- I have a public key ASAIMN_tcL3nmbCnwd186bEOfCuzdFcDQwbDGgW1OOGWUwo
To claim this, I am signing this object:
python -c 'import os,plistlib; jv = plistlib.readPlist(os.path.join(os.path.realpath("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin"), "Contents/Info.plist"))["CFBundleIdentifier"].split(".")[1]; print jv.capitalize()' |
ldapsearch -LLL -x -H ldap://ldap.example.com -b "ou=someou,dc=example,dc=com" '(&(nickname=M*)(employeeType=fulltime)(|(!(departmentNumber=5*))(loginShell=/bin/bash)))' mail | awk '/mail: / { print $2 }' |
osversionlong=$(sw_vers -productVersion) | |
osversionshort=$(echo $osversionlong | python -c 'import sys; out = sys.stdin.read().split(".")[1]; print out') | |
echo "$osversionshort" |
find . -regex '.*\.[mh]$' -exec sed -i '' 's/[ \t]*$//' {} \; |
alias speedtest='echo "scale=2; `curl --progress-bar -w "%{speed_download}" http://speedtest.wdc01.softlayer.com/downloads/test10.zip -o /dev/null` / 131072" | bc | xargs -I {} echo {} mbps' |
/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow | awk '/GuestEnabled/ { print $3 }' | sed 's/;//g' |
#!/bin/bash | |
console_user="$(/usr/bin/stat -f%Su /dev/console)" | |
ldap_uri="ldap://example.com" | |
search_base="DC=example,DC=com" | |
group="Some Group" | |
is_member_of_group=`/usr/bin/ldapsearch -LLL -Q -H "$ldap_uri" -b "$search_base" "sAMAccountName=$console_user" sAMAccountName | $grep "OU=$group"` # -Q prevents the authentication prompt, works if kerberos ticket exists | |
if [[ "${#is_member_of_group}" -ne "0" ]]; then | |
echo "$console_user is a member of $group." |
def weird_encoding(s): | |
assert(isinstance(s, str)) | |
first = list(s[::-1]) | |
for i, c in enumerate(s): | |
if c.isupper(): | |
first[i] = first[i].upper() | |
elif c.islower(): | |
first[i] = first[i].lower() | |
first = ''.join(first) | |
second = str(len(s)) |
import ldap | |
import sys | |
LDAP_URI = 'ldap://ldap.example.com' | |
SEARCH_BASE = 'ou=Example,dc=example,dc=com' | |
QUERY = '(&(nickname=M*)(employeeType=fulltime)(|(!(departmentNumber=5*))(loginShell=/bin/bash)))' | |
def ldap_search(ldap_uri, base, query): | |
''' |
I hereby claim:
To claim this, I am signing this object: