Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎

nicerobot nicerobot

🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎
View GitHub Profile
@nicerobot
nicerobot / pitime.sh
Created November 15, 2011 21:33
time how long it takes to print Pi to 5000 places
time echo "scale=5000; 4*a(1)" | bc -l -q
@nicerobot
nicerobot / gist:1484716
Created December 16, 2011 06:01
Abbreviating PROMPT_COMMAND with ${HOME} to ~ replacement pure bash
#!/bin/bash
export PROMPT_COMMAND='PS1X=$(p="${PWD#${HOME}}"; [ "${PWD}" != "${p}" ] && printf "~";IFS=/; for q in ${p:1}; do printf /${q:0:1}; done; printf "${q:1}")'
export PS1='\j \u@\h:${PS1X} $ '
# http://unix.stackexchange.com/a/26860/6128
@nicerobot
nicerobot / meta-text
Last active September 28, 2015 23:28
Meta-text for rich plain-text.
! priority.
^ calendar | relatives.
# tags.
@ contact.
[ mood.
= location.
~ duration estimate.
* repeating.
/ link.
@nicerobot
nicerobot / uninstall-mono.sh
Created December 24, 2011 01:47
This script removes Mono from an OS X System.
#!/bin/sh -x
[ "${SUDO_USER}" -a `id -u` -eq 0 ] || {
\sudo ${0}
\rm -f ${0}
exit $?
}
\rm -r /Library/Frameworks/Mono.framework
\rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
@nicerobot
nicerobot / vac.m
Created January 2, 2012 14:21
Variadic function and NSComparator example
/*
curl -kOs https://raw.github.com/gist/1550857/vac.m && cc -framework Cocoa -o vac vac.m && ./vac
For http://stackoverflow.com/questions/8693810/objective-c-possible-shorter-if-notation
Variadic function and NSComparator example.
*/
#import <Cocoa/Cocoa.h>
#import <stdarg.h>
#import <stdio.h>
// This is just a simple object equality comparator.
@nicerobot
nicerobot / .gitconfig._install.md
Created January 11, 2012 00:14
Things i add to my .gitconfig

run:

curl -sLk https://gist.github.com/raw/1592103/.gitconfig._run | sh -s --

It doesn't add anything if a section already exists.

@nicerobot
nicerobot / dock-spacer.sh
Created January 11, 2012 00:08
Add a space to the Mac OS X Dock. It can be used multiple times for multiple spacers.
#!/bin/sh
# curl -ks https://gist.github.com/raw/1592071/dock-spacer.sh | sh
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
@nicerobot
nicerobot / pkgutil-expand.sh
Created January 16, 2012 18:58
Expand .pkg installers without installing
#!/bin/sh
# curl -ks https://raw.github.com/gist/1622342/pkgutil-expand.sh | sh -s *.pkg
for i in $(ls ${*:-*.pkg}); do pkgutil --expand ${i} $(basename ${i} .pkg); done

gin runs scripts locally, directly from a gist.

@nicerobot
nicerobot / getwlspwd.sh
Created January 20, 2012 17:14
Recover WLS Password
java weblogic.WLST <<WLS
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService
es=weblogic.security.internal.SerializedSystemIni.getEncryptionService(".")
ces=weblogic.security.internal.encryption.ClearOrEncryptedService(es)
ces.decrypt("{AES}9P7z/8D7ccvDWhBmqa0NEhR1b65BlFuBeVQ3WpwJHTI=")
ces.decrypt("{AES}Tlxc7yoE4BGQS2k5XBsMX/Kx4XgEBAcPqzXH7PP5zSI=")
WLS