Audio stream recorder

0 comments

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

0 comments

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)

8 comments


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
rtmpsuck
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):

https://ma156-r.analytics.edgekey.net/9.gif?a=P~b=6ca41fbb12c742746~c=B52593FBC2ADBE676E7B7420EBF8913D8734A47F~d=C95E2AB3C06C42881C40741832462822EC385E99~e=2~f=R~g=0~h=1.2~i=1.1~k=B98698AD2185209EFAAC0ADFB1D982CFF7C42761~ag=www.lds.org~al=Linux~_cd_1557=624246188001~m=PL~n=52386913.1305:9~r=43657:9~s=43423:9~t=30064770995:9~u=0~v=4592~w=6087~x=5174~y=4591~z=0~aa=cp168414.edgefcs.net~ac=&mp4:66852713001/66852713001_2008369076001_2007-04-004-the-district-2-episode-1-8000k-eng.mp4~ad=1935~ae=rtmp~af=https://sadmin.brightcove.com/%5B%5BIMPORT%5D%5D/79423.analytics.edgekey.net/csma/brightcove/BrightcoveCSMALoader.swf~ai=Mozilla/5.0%20(X11;%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://cp168414.edgefcs.net/ondemand/&mp4:66852713001/66852713001_2008369076001_2007-04-004-the-district-2-episode-1-8000k-eng.mp4?__nn__=1701429841001&slist=66852713001/&auth=daEbuc0awbycaa1bTbaaxcucucxdqcdavbh-bsJdpa-bWG-knzAtqvy_yDyr_umE_AEvA_GsD&aifp=bcosldsuds~ay=csma-3.4.6:brightcoveLoader-1.0.27~az=1.0~ba=900000~cm=Akamai~da=0~db=164.0757:9~dc=0~dd=0~de=0~dg=0~dh=0~dl=43657:9~dn=0:9~do=0~dp=0~dq=3764582~du=72000:9~dv=1~dx=5.166~ea=10~eb=1:0.0051~en=The%20District%202%20Episode%201~fb=0~fd=0~fe=0~ff=0~fg=0,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://cp168414.edgefcs.net/" -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

 ...my current favorite is Jelastic

Lubuntu 13.10 xscreensaver

0 comments

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

0 comments

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:

sites/default/themes/seven/style.css


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:

onetime.info


onetime.module


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.