Monday, April 22, 2013

extension ram files

I was helping my girlfriend watch some videos that she needed for a class that she was having trouble playing on her mac. Once I saw that ubuntu wasn't able to play them out of the box I looked at the extension and found a solution on ubuntu forums.

The solution suggested that I try mplayer to play the file:

$ mplayer -playlist file.ram

Success! I could watch the video streaming.

 However, it also pointed out that extension ram files were just real player's playlist and the file was simply a text file. I opened the file and it contained one line which was the url to the video. A .rm file, real players video file, that I was sure I could covert with ffmpeg.

The url was rather long so I used cat and wget to download the whole file.


$ wget `cat file.ram`


Next, I used a tutorial on ehow to find the correct flags for converting using ffmpeg. (I am lazy and why read man pages when you have examples you can search and find)


$ ffmpeg -i IN.rm -vcodec mpeg4 -sameq -acodec aac -ab OUT.mp4


It seems I am never going to remember that avconv is the new replacement for ffmpeg. But no matter what I tried I couldn't seem to get it to work.

I decided because I knew it would run in mplayer that mencoder was the logical choice.


$ mencoder IN.rm -aid 0 -vid 1 -ovc lavc -oac lavc -o OUT.mp4


And that .... worked a little but the video seemed poorly made.

Next i tried something called transmageddon which was a gui and seemed to spin rather than work. More to come if I get it to work...


Sources:

http://ubuntuforums.org/showthread.php?t=1177723
http://www.ehow.com/how_6306550_convert-realmedia-mp4-using-linux.html

Wednesday, April 17, 2013

Wireless Broadcom

So I have had this issue where my wireless card would one day suddenly disappear. I had a wireless usb so I used that for a month or so and finally I decided that I would just reinstall and see if that fixed it. It did like magic but then a couple days later poof gone. Now if you are reading this there is a good chance you have search for linux and broadcom related information and you have found a ton. Ultimately I fixed mine using information from a few sources:

First you can list your network related hardware using:

$ sudo lshw -C network

Confirm that you have a broadcom chip. In my case the broadcom chip was listed as "*-network UNCLAIMED". Next you can check for some sort of blocking

$ rfkill list all

In my case before I fixed the issue my wireless device wasn't even listed. After that I would run:

$ lspci -vnn | grep 14e4:

In my case after finding that command I check back on the table at http://linuxwireless.org/en/users/Drivers/b43#Supported_devices. My device was listed as 14e4:4727 which is BCM4313 (same as lshw listed) Next I looked at http://linuxwireless.org/en/users/Drivers/brcm80211 I found my chip in a table listed under "
brcmsmac" from my research I knew that "brcmsmac" was one of the options for broadcom drivers. So I tried modprobing it as I had done for 'b43' and 'brcmfmac' earlier.

$ sudo modprobe brcmsmac

And success!

Lastly if you don't want to run that command every time you turn your machine on you could add "modprobe brmsmac" on a line immediately before "exit 0" in the file /etc/rc.local


The four most helpful and complete sources:
https://wiki.archlinux.org/index.php/Broadcom_wireless#broadcom-wl
http://linuxwireless.org/en/users/Drivers/brcm80211
http://linuxwireless.org/en/users/Drivers/b43#Supported_devices
http://askubuntu.com/questions/235279/my-wifi-adapter-is-not-working-at-all-where-to-start-troubleshooting



Tuesday, April 16, 2013

Forward and Back Buttons

For what ever reason perhaps just nostalgia possibly because I happen to use them more than expected, I have forward and back links on my website. The buttons are JavaScript powered and I have had "noscript" tags warning users of their lack of functionality since I added the links years ago. However, I don't like that they still exist without scripting. Anyway, I decided that I was going to use scripting to draw the buttons.

<script type="text/javascript">
            document.write('\x3Ca href="javascript:history.back()">Back\x3C/a>');
            document.write('\x3Ca href="javascript:history.forward()">Forward\x3C/a>');
            document.write('\x3Chr />');
</script>

Note: that by using '\x3C' rather than '<', I eliminated a potential problem in the parsing of the page and made it so that they would validate again. 

Saturday, April 6, 2013

Image Magick IV: watermark

I decided to try and start signing my pictures.


$ for i in *.JPG; do echo -e "$i... \c"; composite -watermark 15% -gravity southeast sign-1.png $i $i; echo done; done

It needs more tweaking but that will do for now.