<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2795445709708053711</id><updated>2011-07-31T05:36:48.433+02:00</updated><category term='sdl'/><category term='awesometd'/><category term='gamedev'/><category term='c'/><title type='text'>Trygves blog</title><subtitle type='html'>Random crap I would like to share with random people.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://trygvevea.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://trygvevea.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Trygve Vea</name><uri>http://www.blogger.com/profile/02064101076363039617</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2795445709708053711.post-7313387652813960782</id><published>2009-04-14T10:26:00.003+02:00</published><updated>2009-04-14T19:21:06.272+02:00</updated><title type='text'>Bladecenter annoys me</title><content type='html'>&lt;p&gt;If you ever remote control with Bladecenter using Linux, and want to use the remote media applet, you may get the following error: "The Remote Disk tool can not load a shared library into memory.".&lt;/p&gt;

&lt;p&gt;Not very helpful.&lt;/p&gt;

&lt;p&gt;Well&lt;/p&gt;

&lt;p&gt;Since google couldn't help me on this, I hope it will be able to help someone else in the future (by me posting this): The missing library is most likely libstdc++5 ...&lt;/p&gt;


&lt;p&gt;Fun fact: When you attempt to start the applet, the java-stuff copies a file named libibmxrdisk_1_BPET36H_14.so.1.0.0 to your home directory --- it is this file which depends on libstdc++5. The file is of course deleted when you close the browser. strace is useful!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2795445709708053711-7313387652813960782?l=trygvevea.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trygvevea.blogspot.com/feeds/7313387652813960782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2795445709708053711&amp;postID=7313387652813960782' title='39 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/7313387652813960782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/7313387652813960782'/><link rel='alternate' type='text/html' href='http://trygvevea.blogspot.com/2009/04/bladecenter-annoys-me.html' title='Bladecenter annoys me'/><author><name>Trygve Vea</name><uri>http://www.blogger.com/profile/02064101076363039617</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>39</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2795445709708053711.post-8577573253772416234</id><published>2009-02-15T03:18:00.001+01:00</published><updated>2009-02-15T03:20:57.817+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sdl'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='awesometd'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>Awesome Tower Defense!</title><content type='html'>My pet-project Awesome Tower Defense 0.1 is released!

Head over to &lt;a href="http://anticrap.net/awesometd"&gt;http://anticrap.net/awesometd&lt;/a&gt; to check it out! \o/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2795445709708053711-8577573253772416234?l=trygvevea.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trygvevea.blogspot.com/feeds/8577573253772416234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2795445709708053711&amp;postID=8577573253772416234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/8577573253772416234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/8577573253772416234'/><link rel='alternate' type='text/html' href='http://trygvevea.blogspot.com/2009/02/awesome-tower-defense.html' title='Awesome Tower Defense!'/><author><name>Trygve Vea</name><uri>http://www.blogger.com/profile/02064101076363039617</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2795445709708053711.post-8744668089829141680</id><published>2008-12-15T18:45:00.009+01:00</published><updated>2008-12-15T19:22:45.740+01:00</updated><title type='text'>Reading from a character device for a specified / limited amount of time with a bash-script</title><content type='html'>&lt;p&gt;Bash is awesome. I have this neat TV-tuner which encodes the video to mpeg2 on the fly (the downside is the 1 second lag, so it's not usable for game consoles). If you want to rip something, just read from the /dev/video0 and pipe it into a file. Easy.&lt;/p&gt;

&lt;p&gt;But let's say you have a library of home-made VHS tapes which you want to save before it's too late - then you have this repetive task which to some extent requires attention - right?&lt;/p&gt;

&lt;p&gt;What I wanted to do, was to create a script which could read from that file for a specified amount of time, and then terminate. I also wanted to make sure that it stops reading when I kill the script, or if the script was interrupted. This is what I came up with:&lt;/p&gt;

&lt;pre&gt;
#!/bin/bash

# Default settings

device=/dev/video0
outfile=out.mpg
seconds=3600

# Gives the user the oppertunity to override the default settings by supplying
# arguments to the script, f.ex -d /dev/video1, or -o someotherfile.mpg, or
# -t 1800 to wait 1800 seconds (half hour) in stead of 3600 (an hour)

while getopts "d:o:t:" flag
do
 case "$flag" in
     d) device=$OPTARG;;
     o) outfile=$OPTARG;;
     t) seconds=$OPTARG;;
 esac
done

echo "Will do the following:"
echo " * Record from $device"
echo " * Into file $outfile"
echo " * Will stop after $seconds seconds"

# Issueing some commands to my TV-tuner before we start ripping
# (The TV-tuner is a Hauppauge PVR-350, but all the cards using the
# ivtv-driver should do...

v4l2-ctl -d $device -c temporal_filter=0 &gt; /dev/null
v4l2-ctl -d $device --set-input 2 &gt; /dev/null

# Puts the reading process into background, and saves the PID-variable

cat $device &gt; $outfile &amp;amp;
THEPID=$!

# Making sure that the background process get's killed on CTRL+C or kill

trap "kill $THEPID" SIGINT SIGTERM

# Waiting for the specified amount of time

sleep $seconds

# Killing the cat background process

kill $THEPID

echo " DONE !!! "
&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;NOTE&lt;/b&gt;: The script is bash-specific. On many systems, sh is symlinked to bash. But do not, by habit, run this script as 'sh script'. It will fail (because it uses bash-specific functionality, like $!), and you may have to kill the cat-process manually. Set the executable bit and run it like './script' or run 'bash script'.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2795445709708053711-8744668089829141680?l=trygvevea.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trygvevea.blogspot.com/feeds/8744668089829141680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2795445709708053711&amp;postID=8744668089829141680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/8744668089829141680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2795445709708053711/posts/default/8744668089829141680'/><link rel='alternate' type='text/html' href='http://trygvevea.blogspot.com/2008/12/reading-from-character-device-for.html' title='Reading from a character device for a specified / limited amount of time with a bash-script'/><author><name>Trygve Vea</name><uri>http://www.blogger.com/profile/02064101076363039617</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
