I spend a lot of time using the command line, and I find these features particularly useful. This might be old news to some, but they are still immensely helpful. (Also, these are extremely hard to google for, so hopefully this will save you time in more ways than one!) I tried to include as many examples as I could to make these easy to understand.Continue Reading
This little script is a convenient way to add paths to your
$PATH variable without worrying about duplication. I generally break out my
.bash files to be organized across multiple servers/computers and each one seems to need different paths appended -- so thats where this little guy comes in handy. Just a simple
push_path and no worries.
I've been spending a lot of time creating reports lately, and I generally live in a terminal, so naturally I started to think of ways to easily send emails with these reports attached. I'm stuck using Microsoft Entourage here at work, but thankfully they have a pretty robust AppleScript library. Mixing some stuff together I pulled together this Ruby script which will allow me to do some neat stuff:
At its core, it is nothing more than a simple ruby shell script which compiles AppleScript and uses
osascript to execute the AppleScript. When run it will pop open a new Entourage mail window with the To/CC/Subject filled out, as well as any attachments and moves focus to the window. If I had piped anything to STDIN that would be the body, otherwise it would blank and ready for a quick message. Then a quick
CMD-ENTER and off the mail goes. Simple and elegant, yet kind of powerful :)
I was writing a small shell script in Ruby today that needed to check STDIN for data, but I didn't want to prompt the user to enter data when nothing was found (I only wanted piped in data). This turned out to involve a little more effort than just checking
Luckily, I found a solution at Footle that worked out great. Heres to anyone who needs only piped in data from STDIN without prompting the user.Continue Reading
I re-discovered the fun that is OpenSSL's encryption today when I was cleaning up some bash aliases and though I'd share them.
This allows you to do some really stupid but fun things like encrypt backups, or messages to pass to a buddy. The uses are endless!Continue Reading
It seems like every time I re-compile PHP I get some whacky error. Anyway, I was fortunate enough that a quick Googling found a solution from katmai for compile error.
I'm popping this up here as a reminder to my future self, as well as anyone else who stumbles into this.
If you get this error when attempting to compile PHP 5.3.3 with MySQLi on, in my case, Snow Leopard
/usr/local/include/mysql/my_global.h:1008: error: duplicate ‘unsigned’ /usr/local/include/mysql/my_global.h:1008: warning: useless type name in empty declaration
Was solved with a simple patch to ext/mysqli/phpmysqlistructs.hContinue Reading
This is a simple, but useful little script I ended up writing to test some things. I found it easier to use this than to constantly use the
./spoofmail.rb --email@example.com --firstname.lastname@example.org --subject='Hey You!' --body='whatsup guy?'
or using STDIN
./spoofmail.rb --email@example.com --firstname.lastname@example.org --subject='Hey You!' < bodyofmessage
cat|./spoofmail.rb --email@example.com --firstname.lastname@example.org --subject='Hey You!' whatsup guy? ^d
It might come in handy one day when you need to mess with a co-worker or test a mail receiver... or something else?Continue Reading
This is admittedly ghetto, but I needed a super simple small-scale solution to creating unified diffs based off large blocks of text. The easiest way to do this was by creating temp file and using the native
diff command to do the comparison.
I've used this method for a really small snippets app for our intranet, which can be found on GitHub.Continue Reading