Displaying articles with tag

Open Source Flash Players

Posted by hank, Mon May 26 19:52:00 UTC 2008

I decided after reading this article, I decided to try out SWFDec instead of Adobe Flash Player. I shied away from Gnash early on since it didn’t support many newer features of Flash, and it didn’t work with YouTube. But, apparently, SWFDec works with YouTube (I just tried it), and according to the article above, my browser may use less resources now. We’ll see.

Update

Well, it turns out it crashes on my TheSixtyOne player on the right! Time to try Gnash…

Update 2

Experiment over. The OSS Flash solutions completely fail at playing the flash audio on the right. Once they get just a little more compatible, I’ll try again.

Tags:

Finding the best apt mirror in Ubuntu

Posted by hank, Sat Mar 22 12:27:00 UTC 2008

I wanted to speed up package downloading to set up my apt-proxy today in Gutsy, so I decided to find the correct way to find the fastest Ubuntu mirror. It’s actually done like so (stolen from here):

  1. Click on “System | Administration | Software Sources”
  2. Under “Ubuntu Sotware” tab, choose “Other” in the “Download from” list box.
  3. Choose your country and then click “Select Best Server” and choose the recommendation.

This automatically updates the /etc/apt/sources.lst file. The same utility can also be reached from the Synaptic Package Manager, through “Settings | Repositories”. In action:

It says mirrors.rit.edu is the best one for me. Makes sense.

Tags:

libpango1.0-0 dependency issues in Gutsy

Posted by hank, Sat Dec 01 17:56:00 UTC 2007

If you, like me, were having issues like the following:


  Depends: libpango1.0-0 (>=1.18.3) but 1.18.2-0ubuntu1 is to be installed

The solution is adding this to your /etc/apt/sources.list:


deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

Apparently, they only put the new libpango libraries into gutsy-updates. That’s kinda lame IMHO.

Tags:

Finding bad JPEGs with Xorg hacks in Ubuntu

Posted by hank, Sat Nov 24 19:46:00 UTC 2007

So, I have all these JPEGs, and I want to know which ones are corrupt (specifically, ones that end prematurely). qiv will spit out the following to STDERR when it finds one:


Premature end of JPEG file

So, this is nice, except it’s entirely unscriptable. The solution I found was using the following script to the display the images in sequence:


perl -e 'for(glob("*.png *.jpg")){$output = `qiv "$_" 2>&1;`; if($output =~ /Premature/){print $_, "\n";}}'

All this does is mix STDERR with STDOUT for a qiv of the file, and check the output for the word “Premature”. If it finds the word, it prints the filename. Simple.

The only problem is that qiv doesnt have a way to just check whether a JPEG file is corrupt (and if there is a command line utility that does, please let me know). To make it go thru the list, I wrote this little gem:


while(true); do xte "key q"; done

All this does is send the q key to the Xserver infinitely. All I have to do is put focus on the first qiv window to make it and all subsequent qiv windows receive q’s. So, just run it, and click on the window. Then there are lots of flashes, and eventually that perl script will print out the names of the bad files. It’s totally ghetto, but it’s the best I’ve got right now. The point of this post is to hopefully find new ways to do this more programmatically.

Tags:

Adding Progress Bars to cp and mv in Gutsy

Posted by hank, Sun Nov 11 02:07:00 UTC 2007

Notice that I can do a -g for a progess bar! Yay! Now for an action shot:


hank@rofl:~/tmp/coreutils-6.7$ cp -g coreutils_6.7-1_i386.deb /nexus/mod0/www/deb/binary/
coreutils_6.7-1_i386.deb         |  48% |   3.2 MiB |   118 KiB/s | ETA 

Continue Reading Tags:

Hacking a WRT54G v8 With DD-WRT

Posted by hank, Sat Oct 06 11:20:00 UTC 2007

So, last month sometime, BrainSlayer got DD-WRT working on version 8 of the WRT54G. Now this was great news to me when I read it since I’ve been wanting to get rid of the crappy LinkSys management from the beginning. Some of the procedure worked, and some of it didn’t for me.

Do not try this if you don’t know exactly what you’re getting into.

Continue Reading Tags:

DMIDecode to find used RAM slots

Posted by hank, Wed Sep 26 21:11:00 UTC 2007

So, someone asked if there was a way to find out which memory slots were used in a running machine without opening it using Linux. Here’s the answer:


$ sudo dmidecode | grep "Installed Size"
        Installed Size: 1024 MB (Double-bank Connection)
        Installed Size: Not Installed
        Installed Size: 1024 MB (Double-bank Connection)
        Installed Size: Not Installed
        Installed Size: 64 KB
        Installed Size: 2048 KB

If you just run sudo dmidecode by itself, you can find out all kinds of awesome system info.

Tags:

Setting EXIF dates with a loop

Posted by hank, Mon Sep 17 20:11:00 UTC 2007

Magic EXIF recursive tagging!

Have you ever had your files all nicely nested in directories, but needed to change their EXIF dates? Here’s what I used today to do it:


# Structure like this: 1997/08/Picture.Whatever Maybe Some Spaces.jpg

# Delete the EXIF tags (DONT DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!)
find . -mindepth 3 -exec jhead -de "{}" \;

# Make Fresh EXIF tags
find . -mindepth 3 -exec jhead -mkexif "{}" \;

# Set the dates according to the Year and Month information in the filenames
find . -mindepth 3 | perl -ne '@a = split(/\//, $_); chomp($_); print `jhead -da$a[1]:$a[2]:01-2007:09:17 "$_"`, "\n"'

This worked wonderfully.

Tags:

PL/Ruby on CentOS 5

Posted by hank, Wed Aug 01 16:24:00 UTC 2007

I had some trouble compiling PL/Ruby for PostgreSQL today on Modzer0. I solved it with some clever extconf.rb switches:


ruby extconf.rb --with-pgsql-include=/usr/include/pgsql/ --with-pgsql-version=81

Now I avoid the problems I was having before:


[root@modzer0 plruby-0.5.1]# make
make[1]: Entering directory 
#...
In function ‘perm_fmgr_info’:plruby.c:116: error: ‘TopMemoryContext’ undeclared (first use in this function)
plruby.c:116: error: (Each undeclared identifier is reported only once
plruby.c:116: error: for each function it appears in.)
plruby.c: In function ‘plruby_call_handler’:
plruby.c:706: warning: unused variable ‘result’
plruby.c: In function ‘pl_compile’:
plruby.c:875: error: subscripted value is neither array nor pointer
plruby.c:876: error: subscripted value is neither array nor pointer
plruby.c:879: error: subscripted value is neither array nor pointer
plruby.c:889: error: subscripted value is neither array nor pointer
plruby.c:937: error: ‘TopMemoryContext’ undeclared (first use in this function)
make[1]: *** [plruby.o] Error 1

Now I just have to create the language in Postgres. I’m making it trusted since I don’t want anyone doing anything nasty. I might build the untrusted version later like Robby did here.


CREATE FUNCTION plruby_call_handler() RETURNS language_handler
  AS '/usr/lib/ruby/site_ruby/1.8/i386-linux/plruby.so'
  LANGUAGE C;

CREATE TRUSTED LANGUAGE 'plruby'
  HANDLER plruby_call_handler
  LANCOMPILER 'PL/Ruby';

Voila!


Procedural Languages
  Name  | Trusted? 
--------+----------
 plperl | yes
 plruby | yes

OH OH

Tags: