Tags » Bash Script

Easy Timestamping with Bash

Here’s a quick Bash script to prefix lines read from standard input by a time stamp.

#!/usr/bin/env bash

while read line
    echo $(date "$@") "$line"
… 189 more words

Username and password with wget/curl

To download a url with basic authentication we need to pass username & password.

To acheive this functionality with wget or curl observer following examples: 69 more words


Check Current Battery Cycles on Mac OS X

Sometimes it’s helpful to know how many times a battery has been fully cycled on a MacBook Pro. For Instance, if a user is requesting a replacement because their current battery isn’t holding a full charge. 114 more words

Mac Admin

Countdown timer without bells but whistles

While writing the previous post, I felt the urge of.. eating. Yeah, I do that sometimes. So, I decided to cook. My problem with multitasking, when one of the tasks is cooking, is that I always fuck up the cooking. 649 more words


Including source code in LaTeX documents

Needed to include some R script in a document. Pasting straight in causes problems. Turns out the \listings package works well. Settings need to be tweaked a bit but otherwise easy to use. 146 more words


Batch converting images

Had a bunch of very large pdf images that needed to be scaled down to be included into a thesis. Converting to jpg in ubuntu seemed to bring file sizes down. 57 more words


Tip # 5 - Profilling R Code with Bash Script

Today I’ll show how to profile R code when you have a bash script to run you’re R code. Why you have a bash script? Why not? 73 more words