Audio stream recorder


Tip: Audio Recorder is a useful tool for recording streaming audio from a flash video or some other source (browser, desktop, etc).

Creating a gapless (disc-at-once) audio CD in Linux


1.  If you've created a mix in Audacity, follow these instructions for labeling and then exporting the tracks in WAV format

2.  Once you have the WAV tracks, run this script to prepare the Table of Contents:

echo "CD_DA" >> toc && for file in *.wav ; do echo "TRACK AUDIO" >> toc; echo "FILE \"$file\" 0" >> toc; done
3.  Once the toc file is ready, burn it (at a slower speed for higher quality):
cdrdao write --speed 4 toc

P.S. If you need to create a non-stop gapless CD with a data track, use these instructions.

P.P.S. If you need to create CD-TEXt, use these instructions.

Download BrightCove videos (tutorial)


Update:  The download method described in my original post no longer works.  It looks like they've updated their delivery system to incorporate additional security measures.  Fortunately, there's an easier rtmpdump method that still works:

0.  if you don't already have it, install the rtmpdump suite:

sudo apt-get install rtmpdump
1. open a terminal and become root:
sudo su - root
2. create a firewall rule to temporarily redirect TCP traffic to a custom port:
iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
3. run a (cleverly named) companion program in the rtmpdump package that sniffs traffic for streaming video
4. minimize the root terminal window and then open (or refresh) the video page in your browser and play the video

5. bring up the root terminal window and when it says "Closing connection... done!" (or the video finishes playing) press Ctrl+C to stop rtmpsuck

6. the video will have been saved in the root user's home directory; move it to tmp (note: if the source video is flv, swf, etc. you will need to change the extension in the command below)
mv ~/*.mp4 /tmp
7. delete the temporary firewall rule
iptables -t nat -D OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
8. close the root terminal window and enjoy your video!

P.S. This works for other video sites as well, such as News and Sports broadcasts.


Legacy (non-working) instructions for reference:

KeepVid makes it super easy to download videos from Youtube, Dailymotion, Metacafe, and iFilm, but it doesn't support BrightCove.

Most BrightCove flash-based videos have an HTML5 (iPad/iPhone) alternate so the process is a little technical but relatively easy to do.  But what if you follow those instructions and no HTML5 video appears?  Well, that means there is no HTML5 alternate.  In that case, the process gets a little harder but not impossible:

1.  Install rtmpdump: sudo apt-get install rtmpdump
2.  In Chrome, press F12 to open the browser developer tools and click on the Network tab
3.  Start playing the video and look for entries in the Network list that start with 9.gif?a=
4.  Click on one and view the Headers and it should look something like this (color-coded to highlight important info):;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Ubuntu%20Chromium/30.0.1599.114%20Chrome/30.0.1599.114%20Safari/537.36~aj=11,2,202,310~ak=Flash_PlugIn~am=D~an=309~ao=607~ap=916~ar=0~at=Chrome%2030~au=1425*469~aw=rtmp://,0,0,0~fh=0,0,0,0~fi=8317000:0:5169::1~fj=8317000:5169~fl=42990573000:5169

5. Stop the video playing in the browser
6.  Open a command prompt and craft a rtmpdump command like:

rtmpdump -r "rtmp://" -y "mp4:66852713001/66852713001_2008369076001_2007-04-004-the-district-2-episode-1-8000k-eng.mp4" -a "ondemand?auth=daEbuc0awbycaa1bTbaaxcucucxdqcdavbh-bsJdpa-bWG-knzAtqvy_yDyr_umE_AEvA_GsD&aifp=bcosldsuds&slist=66852713001/" -o my_downloaded_video.mp4

That should connect to the video server and begin downloading the file!

Once done, feel free to create a DVD

Useful tools for selecting a Platform as a Service (PaaS) provider

0 comments current favorite is Jelastic

Lubuntu 13.10 xscreensaver


Lubuntu 13.10 removed xscreensaver for some reason.  I kind of like it and wanted it back, so:

sudo apt-get install xscreensaver-gl-extra

echo "@xscreensaver -no-splash" >> ~/.config/lxsession/Lubuntu/autostart

Custom Drupal 7 site user registration form


With CAS, it's easy to automatically create Drupal accounts when users access the site for the first time.  Furthermore, Drupal 7 now makes it very easy to add custom form fields to the user account page.

But, what if you want to just show those custom fields and none others?  Well, there's a module for that: Edit profile

Okay, that's great but what if you want users to be able to edit those custom fields but not the default Drupal user account fields, such as email, username, password, etc.?  Well, there's another module for that: Edit own user account permission

Good so far.  Unfortunately, hidden custom fields (i.e. fields on admin/config/people/accounts/fields that are set to "hidden" on the Manage Display tab) are still visible on the Edit Profile tab exposed by the module indicated above.  To hide those fields, an easy fix is to add a display:none CSS property to the theme for those hidden fields.  Note, however, that the user account page uses the administrator theme and not the site theme so in most cases you'll likely need to edit the seven Drupal theme.  I personally like to copy the core seven theme (or whatever administrator theme you have selected for your site) into the site-specific theme folder so my edits don't get overridden during future Drupal core upgrades.  For example:


Great!  So we now have a custom user form displaying only the custom fields we want.  Now, how do we redirect users to that form when they login to the site for the very first time?  Ideally, we'd want to remember their original destination so we can redirect them to it after they fill out our custom user form.  To accomplish all that, we need to create a custom module.  Here's my solution with a custom module called onetime:


Due to the ever-changing intricacies of Drupal's API, this solution took quite awhile to solve (every single line has an important significance).  Hopefully this helps someone else along the way.

P.S. This solution will only apply to new users, not existing users, so you'll need to delete and recreate them manually.