Sorry, I’m Lazy

Posted on Saturday 11 November 2006

Other

Yeah, I know. I’ve not updated this in a while. I’m just lazy. That’s all.

Well, that and all of the homework that I’ve constantly been doing. This has been my hardest semester yet. Programming Languages and Algorithms Analysis are not exactly easy classes. I’m learning a lot, but it’s not easy. Thanks to good ole’ OCAML, I know recursion like the back of my hand, and I’m developing a taste for functional programming. It’s nice for getting certain things done, but I wouldn’t want to write a graphics library using it.

Also, I’m getting better at proofs, but they’re not any fun. If I wanted to write proofs, I’d have been a math major. My favorite class: Microcontrollers. I like actually seeing tangible results from the code I write. I’d extrapolate on said enjoyment, but keeping with the theme of my post: I’m just too lazy.

As a happy side note: I was pleasantly surprised by the results of this week’s elections. I didn’t think the Democrat’s had it in them. They’re constantly snatching defeat from the jaws of victory, but this time, I suppose this time they just got lucky. I was also pleasantly surprised to see that Haggard finally got what was coming to him. That guy was an asshole. As Jon Stewart quite aptly put: “It’s a said day when you cede the moral high ground to a drug-dealing, gay prostitute”.
Ah, good ole’ fundamentalism.

That, and quality, non-rambling writing.

Kyle Hill @ 9:45 pm
Filed under: Personal
New Room Setup

Posted on Sunday 28 May 2006

Music

I’ve gotten back from my second year at K-State. Thank God finals are finally over. I’ve gotten all of my stuff setup in my room back home. I’ve got a pretty good setup going now. I’ve got my Xbox, this server and laptop plugged into my WRT54GS. I can use everything I need from the comfort of my bed. Oh, wondrous luxury. I’ve got my speakers plugged into the sound card on my server and through a combination of mp3blaster and my own custom script, I can play music on those speakers from anywhere through putty. I think it’s pretty sweet.

Here’s a copy of my shell script:

  1. #!/bin/sh
  2. #
  3. # Music Script 0.1
  4. #
  5. # Plays specified or default playlist using mp3blaster.
  6. #
  7.  
  8. default=/home/kyleh/playlists/syntax.m3u
  9. custom=$1
  10.  
  11. # If no playlist is given, play the default
  12. if [ $# -ne 1 ]
  13. then
  14. mp3blaster -a "$default" -p allrandom
  15. else
  16. # If custom playlist is readable
  17. if [ -s "$custom" ]
  18. then
  19. mp3blaster -a "$custom" -p allrandom
  20. else
  21. echo "ERROR: Unable to open custom playlist, opening default"
  22. mp3blaster -a "$default" -p allrandom
  23. fi
  24. fi
  25.  
  26. exit 0

Here’s a link to my script: music.zip

Kyle Hill @ 6:25 pm
Filed under: Music
Server Up and Running

Posted on Monday 20 March 2006

Site News

I had some server issues this week. My main webserver had a broken CPU fan, which, from my experience is never a good thing. I replaced the fan it should be back up and running smoothly.

Kyle Hill @ 5:39 pm
Filed under: Site News
Mythexport

Posted on Sunday 12 March 2006

Computers

UPDATE: I’ve posted a newer version of the script with better documentation

I’ve written a bash script that uses nuvexport in conjunction with my custom nuvexportrc file to automatically transcode my HUGE mythtv files after they are recorded. The only thing that this script doesn’t do is delete the source file after creation. I’m working on getting a patch submitted to nuvexport to allow source file and the associate database entries to be deleted upon successful transcode. The easiest way to invoke this script is to create a user job in mythtv’s job queue. Anyway, included below is a copy of my script:

  1. #!/bin/sh
  2. #
  3. # Transcodes and removes commercials from MythTV files.
  4. # Requires nuvexport and a properly configured nuvexportrc file.
  5. # See attached nuvexportrc for an example.
  6. #
  7. # Invoke from mythtv user job with the following line:
  8. # /path/to/mythexport "%FILE%" "%TITLE%"
  9. #
  10. # USAGE: mythexport [infile] [title]
  11. #
  12.  
  13. # User to run nuvexport as, should own both sharedir and outdir
  14. user=mythtv
  15.  
  16. # Location of nuvexport
  17. nuvexport=/usr/local/bin/nuvexport
  18.  
  19. # Directory where MythTV stores its .mpg files
  20. indir=/shared/.mythtv/
  21.  
  22. # The temp location for use during transcoding
  23. outdir=/shared/.mythtv/out/
  24.  
  25. # For my setup, the location to copy the finished .avi after transcoding
  26. sharedir=/shared/video/TV/
  27.  
  28. # User must provide at least two arguments
  29. if [ $# -lt 2 ]
  30. then
  31.         echo "ERROR: Invalid arguments"
  32.         echo "USAGE: mythexport [infile] [title]"
  33.         exit 1
  34. fi
  35.  
  36. # The provided absolute path to the mythtv file.
  37. infile=$1
  38.  
  39. # Get rid of the first parameter, the rest are the title of the show
  40. shift
  41.  
  42. # Title of the show
  43. title=$@
  44.  
  45. # If the mythtv file exists
  46. if [ -r "$indir$infile" ]
  47. then
  48.         # The "command"
  49.         sudo -u $user $nuvexport –infile "$indir$infile" –noconfirm > /dev/null
  50.        
  51.         # Create a directory for the show, if one doesn‘t exist
  52.         if [ ! -d "$sharedir$title/" ]
  53.         then
  54.           mkdir "$sharedir$title/"
  55.         fi             
  56.        
  57.         # Move the transcoded file to the sharedir
  58.         mv -f "$outdir$title – "*.avi  "$sharedir$title/"
  59.  
  60. else
  61.         echo "ERROR: Unable to open source file " "$indir$infile"
  62.         exit 2
  63. fi
  64.  
  65. exit 0

Here’s a link to my script: mythexport.zip. This file also contains a copy of my nuvexportrc file.

You must be sure to pass the filename to be transcoded, as well as the title of the show, from mythtv itself. This is easily accomplished by using appending %FILE% and %TITLE% to the user job description of the file.

Also, since these are impossible to find online, here are the custom arguments you can pass jobs from myth’s job queue:

  1. * %DIR% – the directory component of the recording’s filename
  2. * %FILE% – the filename component of the recording’s filename
  3. * %TITLE% – the title of the recording (e.g., name of the series)
  4. * %SUBTITLE% – the subtitle of the recording (e.g., name of the episode)
  5. * %DESCRIPTION% – description text for the recording (from guide data)
  6. * %HOSTNAME% – the backend making the recording
  7. * %CATEGORY% – the category of the recording (from guide data)
  8. * %RECGROUP% – the recording group
  9. * %CHANID% – the MythTV channel ID making the recording
  10. * %STARTTIME% – the recording start time (YYYYMMDDhhmmss)
  11. * %ENDTIME% – the recording end time (YYYYMMDDhhmmss)
  12. * %STARTTIMEISO% – the recording start time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
  13. * %ENDTIMEISO% – the recording end time in ISO 8601 format
  14. * %PROGSTART% – the recording’s start time (from guide data; YYYYMMDDhhmmss)
  15. * %PROGEND% – the recording’s end time (from guide data)
  16. * %PROGSTARTISO%, %PROGENDISO% – the recording’s start and end time in ISO 8601 format.
Kyle Hill @ 3:50 pm
Filed under: Technology
Bridging The Gap

Posted on Monday 2 January 2006

Technology

Trying to create a bridged wireless network can be a nightmare, as I have learned from first-hand experience today. Trying to create a 400 m wireless link seems easy enough, right? A few things to keep in mind in case I do this in the future: The whole Client-Bridged Mode -> AP Mode paradigm sucks. Don’t waste your time trying to get it to work out. Simply use WDS and get on with your life. Problems with traditional bridged mode include: Only allowing the use of 3-addresses so that DHCP handshaking is impossible…..I’m sure there’s more, but this seems like a bit of an oversight! Anyway, my firmware, DD-WRT v23 final, does not seem to handle WPA2 authentication very well either. So, I’m stuck with a crappy ol’ 128-bit WEP encryption scheme. It’s OK….but c’mon, I need 256-bit Temporal Keys. I promise I do.

Kyle Hill @ 9:38 pm
Filed under: Technology