Monthly Archives: February 2013

RabbitMQ: users disappear / settings gone after reboot / restart

If you are using RabbitMQ on am Amazon EC2 instance and your node settings and users seem to disappear on reboot, it may be because of how the RabbitMQ server works. Settings, users, vhosts, and the rest of the RabbitMQ are all bound based on the node name – or the hostname. You can check by running either hostname or hostname -f for the FQDN. You will also notice that RabbitMQ stores settings in: /var/lib/rabbitmq/ And more specifically in: /var/lib/rabbitmq/mnesia If you check the contents you will see something like: drwxr-xr-x 5 rabbitmq rabbitmq 4096 Feb 27 14:55 [email protected]/ drwxr-xr-x 2 rabbitmq rabbitmq 4096 Feb 27 14:55 [email protected]/ drwxr-xr-x 5 rabbitmq rabbitmq 4096 Feb 25 15:08 [email protected]/ drwxr-xr-x 2 rabbitmq rabbitmq 4096 Feb 25 14:41 [email protected]/ drwxr-xr-x 5 rabbitmq rabbitmq 4096 Feb 23 04:48 [email protected]/ -rw-r–r– 1 rabbitmq rabbitmq 5 Feb 23 04:41 [email protected] drwxr-xr-x 2 rabbitmq rabbitmq 4096 Feb 23 04:41 [email protected]/ drwxr-xr-x 4 rabbitmq rabbitmq 4096 Feb 18 17:31 [email protected]/ drwxr-xr-x 2 rabbitmq rabbitmq 4096 Feb 18 17:28 [email protected]/ drwxr-xr-x 4 rabbitmq rabbitmq 4096 Feb 26 15:32 [email protected]/ drwxr-xr-x 2 rabbitmq rabbitmq 4096 Feb 26 15:26 [email protected]/ Why do RabbitMQ settings disappear on restart? Well, if you “stop” an amazon ec2 instance and then “start” it, it will have a new IP address unless you are using static IP addresses. Note that this doesn’t happen on “reboots” – just “stop” and “start” for EBS / (Elastic Block Storage) volumes. If you are not using an EBS volume then … Continue reading

Posted in Linux, Server Administration | 3 Comments

Chef: Configure a Workstation

On Mac OSX I would recommend first installing hombrew’s ruby-env and then the latest version of ruby/gems Then you can do: gem install chef –no-ri –no-rdoc gem install knife –no-ri –no-rdoc I think by default these files go in these locations: USERNAME.pem ~/.chef validation.pem ~/.chef knife has an interactive setup tool invoked by knife configure

Posted in Uncategorized | Leave a comment

VideoJS m3u8 example

Here is an example of how to use video.js with HTTP Live Streaming (HLS) with an m3u8 playlist file: < !doctype html> <html> <head> <link rel=”nofollow” href=”” rel=”stylesheet”/> <script src=””></script> </head> <body> <video id=”my_video_1″ class=”video-js vjs-default-skin” controls preload=”auto” width=”640″ height=”264″ poster=”my_video_poster.png” data-setup=”{}”> <source src=”″ type=’application/’/> </video> </body> </html> via

Posted in Web Development | Tagged , , , | 3 Comments

chef knife setup

For more info you can visit the knife configuration page on opscode % knife –help Usage: knife sub-command (options) -s, –server-url URL Chef Server URL -k, –key KEY API Client Key –[no-]color Use colored output, defaults to enabled -c, –config CONFIG The configuration file to use –defaults Accept default values for all questions -d, –disable-editing Do not open EDITOR, just accept the data as is -e, –editor EDITOR Set the editor to use for interactive commands -E, –environment ENVIRONMENT Set the Chef environment -F, –format FORMAT Which format to use for output -u, –user USER API Client Username –print-after Show the data after a destructive operation -V, –verbose More verbose output. Use twice for max verbosity -v, –version Show chef version -y, –yes Say yes to all prompts for confirmation -h, –help Show this message

Posted in Tech Tips | Tagged , , , | Leave a comment

linux: What does hash -r do?

The hash utility shall affect the way the current shell environment remembers the locations of utilities found as described in Command Search and Execution. Depending on the arguments specified, it shall add utility locations to its list of remembered locations or it shall purge the contents of the list. When no arguments are specified, it shall report on the contents of the list. The following option shall be supported: -r: Forget all previously remembered utility locations.

Posted in Server Admin | Tagged , | Leave a comment

windows system32 host location

Clear and simple. The path for the windows system32 host location is c:\windows\system32\drivers\etc\hosts on most systems. On linux systems it is in /etc/hosts so that part makes sense to me, but I have no idea why it is in the drivers folder. Remember if you want to edit the hosts file you may need to have “administrator access” which can be done by right clicking “Notepad” and choosing “Run As Administrator” and then opening the file with Notepad. Otherwise you might be able to view the file but you will get an erro when saving it. Make a backup before you start Other windows system32 host location Windows 95/98/Me c:\windows\hosts Win2k, Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts Windows XP Home c:\windows\system32\drivers\etc\hosts

Posted in Tech Opinion | Tagged , , | Leave a comment

Streaming RMTP

Streaming video has a format known as rtmp or Real Time Messaging Protocol which allows videos which are viewed via flash based players (desktop and some android – sorry iOS / iPhones!) to pull their video source in “streaming” through a protocol url like rtmp:// ‘rtmp’ is what you mean when you say ‘rmtp’ but the correct version is actually rtmp

Posted in Tech Tips | Tagged , | Leave a comment

ffmpeg: Convert .mpg / .mov to .ts for Amazon Cloudfront

I just finished writing up a short article describing how to convert h.264 files into .ts files for Amazon Cloudfront streaming with HLS (HTTP Live Streaming) It is not a difficult process although you need to have the latest version of ffmpeg. For more details about converting mov files to ts files for HLS streaming, check out How to use HLS (HTTP Live Streaming) with Amazon CloudFront

Posted in Uncategorized | Leave a comment

How to use HLS (HTTP Live Streaming) with Amazon CloudFront

I have a mp4/h.264 video that is a around 300mb. I would like users to be able to watch it on both desktop browsers and mobile devices. I have the video file stored on Amazon S3. I have two cloudfront sources enabled – one for download and one for streaming. I know I can use something like VideoJS to play the file with the ‘video/mp4’ source being the “download” cloudfront source which, I believe, plays while the file is being downloaded – I think this is called “progressive download” but it is not true streaming. I also realize that I can use something like JWPlayer and the “streaming” cloudfront source to give users on a desktop device, or a device that supports flash, the RTMP streaming experience. The problem I’m facing is poor performance on iOS devices – especially ones with limited bandwidth. From what I’ve been reading HTTP Live Streaming (HLS) seems to be the only “streaming” protocol that iOS devices really support. And as far as I can tell, Amazon Cloudfront only natively offers RTMP streaming of uploaded mpeg/h.264 files (not HLS). Amazon has a Live Smooth Streaming tutorial for use with Amazon CloudFront which appears to be, in a nutshell, a Windows IIS server running Adobe Flash Media Server and pushing out the HLS stream via Amazon Cloudfront. So, my questions were: If I want to push H.264/mpeg4 files “streaming” to iOS devices or HTML5 players, is the “right” way to do this to use HLS? Can … Continue reading

Posted in Web Development | Tagged , , , , , , | 2 Comments

Using VideoJS with YouTube

I have been using VideoJS for some streaming videos and mp4 videos, but also wanted to pull YouTube videos into the player along with the other videos I had on the site. First of all, the working example. Then, the list of problems ;) VideoJS and Youtube Example How to replicate the Youtube and VideoJS integration: First, clone or download this fork of videoJS and build it. Next, place this in your webpage’s <head> (needs to be there to work with older browsers). Also fix the odd character after the href in the first line (sorry about that) and make sure the path points to the correct location for the files. <link href≠”/video-js/video-js.css” rel=”stylesheet” type=”text/css”/> <script src=”/video-js/video.js”></script> And then place this in your document’s <body>: <video id=”example_video_1″ class=”video-js vjs-default-skin” controls preload=”none” width=”640″ height=”360″ data-setup='{“techOrder”:[“youtube”,”html5″],”ytcontrols”:false}’> <source src=”” type=’video/youtube’ /> </video> There is also an example file in the dist directory which will only be created after you “build” the fork you have cloned from github. VideoJS and Youtube Problems With Integration I tried simply giving VideoJS the URL to the YouTube video but that didn’t workout so well. Here are a few things that might help you out with playing You Tube videos in Video JS: There is a pull request for changes that would allow VideoJS to work with YouTube. A few problems with it are: Has not been pulled in Both the Video JS maintainer and the pull requestor have become busy with other projects so it might not … Continue reading

Posted in Tech Tips, Web Development | Tagged , , , | 1 Comment