This script is a shorter version of the shell script to trim a video clip with avconv, ffmpeg or mencoder.

Main difference is that instead of start/stop times in HH:MM:SS format, which are tedious to type, it just needs start time, defaulting to 8 sec duration (optional script arg allows custom duration).

The reason for this version is that, when making clips out of wakeboard videos, I typically just to need to extract the trick, which, from the cut in, execution, landing, and cut out, lasts about 8 sec. Less typing, means I can make clips faster. In some cases, I want something other than 8 sec, so the script allows custom duration specified as an optional last arg.

Here's the script:

Read the rest of this entry...

This script is an updated version of the Shell script to trim a video with mencoder or ffmpeg.

Main difference are:

  • Adds support for and defaults to avconv (but still supports ffmpeg and mencoder).
  • Uses simpler code to calcuate clip duration from start/stop times.
  • Accepts dot/period (.) in addition to colon (:) as the HH:MM:SS separator in start/stop times. Dots are much quicker to type, which is nice when creating lots of clips.

Here's the script:

Read the rest of this entry...

TL;DR: I fixed my problem by using Thunar instead of Nautilus.

What's my problem?

At some point, file time stamp display in Nautilus (aka "Files") in Ubuntu started insisting on a relative time display, where depending on the file age, the time stamp will either just show time (e.g. 12:31), or just date (e.g. Jan 1), or date and year (e.g. Dec 25 2013).

Nautilus devs, please make time style display configurable!

Read the rest of this entry...

Found this cool site that aggregates HDD and SSD prices from Newegg on a daily basis and lists by price per terabyte: http://edwardbetts.com/price_per_tb/

Unfortunately, it doesn't allow filtering or sorting of the data, so here are some quick and dirty examples.

int_hdd=$(links2 -width 200 -dump http://edwardbetts.com/price_per_tb/internal_hdd/)
ext_hdd=$(links2 -width 200 -dump http://edwardbetts.com/price_per_tb/external_hdd/)
ssd=$(links2 -width 200 -dump http://edwardbetts.com/price_per_tb/ssd/)

Show only 6TB disks:

grep 6TB < <<"$int_hdd"
     $38.33 $229.99     6TB Open Box: WD Green WD60EZRX 6TB 64MB Cache SATA 6.0Gb/s (0 stars)
     $44.00 $263.99     6TB WD Green WD60EZRX 6TB 64MB Cache SATA 6.0Gb/s (4 stars)
     $44.33 $266.00     6TB WD Red WD60EFRX 6TB 64MB Cache SATA 6.0Gb/s 3.5" NAS Hard Drive Bare Drive (4 stars)
     $45.00 $269.99     6TB Seagate STBD6000100 6TB 128MB Cache SATA 6.0Gb/s Retail Kit (4 stars)
     $50.00 $299.99     6TB HGST Deskstar NAS H3IKNAS600012872SN (0S03839) 6TB SATA 6.0Gb/s 3.5" High-Performance Hard Drive for Desktop NAS Systems Retail Kit (4 stars)
     $50.00 $299.99     6TB WD Purple WD60PURX 6TB 64MB Cache SATA 6.0Gb/s 3.5" Surveillance Hard Drive (5 stars)
     $72.67 $435.99     6TB Seagate ST6000NM0024 6TB 128MB Cache SATA 6.0Gb/s 3.5" Enterprise Hard Drive Bare Drive (5 stars)
     $83.33 $499.99     6TB Seagate ST6000NM0054 6TB 128MB Cache SAS 12Gb/s 3.5" SED Enterprise Hard Drive Bare Drive (0 stars)
     $88.33 $529.99     6TB Seagate ST6000NM0104 6TB 128MB Cache SAS 12Gb/s 3.5" SED-FIPS Enterprise Hard Drive Bare Drive (0 stars)
    $121.67 $729.99     6TB HGST He6 HUS726060ALA641(0F20572) 6TB 64MB Cache SATA 6.0Gb/s 3.5" Enterprise Hard Drive (0 stars)

Read the rest of this entry...

For some of my LXC containers, I'm allocating a reserved private IP and need to generate a reasonably unique MAC address that's calculated from the container's hostname. As is LXC's default, I'm using the OUI that belongs to Xensource, Inc (00:16:3e).

Here's a Bash function I'm using:

GetMAC()
{
  if [ -n "$1" ]; then
    OID="00:16:3e"
    RAND=$(echo $1 | md5sum | sed 's/\(..\)\(..\)\(..\).*/\1:\2:\3/')
    echo "$OID:$RAND"
  else
    echo "ERROR: please supply hostname to create MAC address from, e.g.:"
    echo "       $FUNCNAME myhost"
  fi
}

Code in action:

$ GetMAC myhost
00:16:3e:e0:04:92

Useful references:

Remembering the correct openssl syntax for fetching certificate from a remote host or parsing a local certificate file for useful information is a chore, so I finally took my notes and combined into an easy to use shell script.

The script is mostly useful for not having to remember cryptic syntax, but in some cases will also parse and present information in a more readable format than the default openssl output.

It's also easy to add parsing and formatting as needed.

Read the rest of this entry...

Here's an updated version of a previously posted shell script that uses awk to convert a delimited file (where delimiter can be any character) to HTML tables.

For a little automation project I did, the script needed to process input from a pipe, instead of file. So this updated version adds an "-f" option to get delimited data from a file, or "-" option to get it from STDIN.

Read the rest of this entry...

A shell wrapper script that uses awk to convert a delimited file (where delimiter can be any character) to HTML tables.

Read the rest of this entry...

To export Chrome (or Chromium) browsing history on Linux in a more flexible format than what Settings > History displays, could extract it from the History file, which is an SQLite database.

Read the rest of this entry...