Tuesday, August 25, 2009

Code::Blocks "process terminted with signal 255 (0 minutes, 0 seconds)"

Yesterday after I came home from work I thought I'd try working on a project I've been working on this past weekend.
I was away from home this weekend, so all the work I'd done had been on another computer, in a virtual Ubuntu installation, so I hadn't yet tried it at home.

Trying to build it went fine. Running it from a terminal went fine. Even compiling and running on another Ubuntu installation (my work laptop, non-virtual) went fine, but Code::Blocks reported to me that whenever I tried running my application on my Fedora 11 home installation that it terminated with signal 255.
I couldn't find what was wrong, I knew the application worked since I tested it in another terminal window and if I debugged it it'd go great up to the point where it met with a cin or cout.
Being tired from a really long day (getting up at 5:00am, get on train at 6:25am, get off train at 8:30am and at work 8:50am), I gave up fairly quickly.

This morning though the itch got worse and I just had to investigate further.
After about a minute of looking around I found someone at the Ubuntu Forums asking about the exact same thing and it turns out that the problem was that xterm wasn't installed. So a simple
su -c "yum install xterm"
was enough to fix the problem.

Now I can start developing my application again!

Wednesday, August 19, 2009

Low Resolution in Fedora 11 with Nvidia drivers

Finally, after hours of looking and working I have finally again found how to set the resolution to what I need (have 1280x1024, had 640x480). I've had trouble with my resolution in Fedora before, but I don't ever remember it being this much of a pain, but then again I don't remember much about it at all, wish I'd remembered how I fixed it.
So to help me remember and perhaps even help someone else work around it, here's how I finally got it working.

I'm now using the Nouveau driver with a generic LCD Panel 1280x1024. I tried setting this in
system-config-display
many times, but it just wouldn't accept my monitor.
So in the end I looked at
system-config-display --help
and noticed
--reconfigure
, which doesn't base the new configuration file on an old one.
Using this option and setting my driver to nv and my monitor to generic 1280x1024 and then
su -c "init 3"
[log in]
su -c "init 5"
got me the right resolution again. However the nv driver is just a little too basic, so I thought I'd try the same thing with the proprietary driver, so I did everything exactly as before, only I used the driver nvidia instead of nv.
Now again X wouldn't start at all, so I ran
livna-config-display -a
to get it to my old low-res configuration, and then I tried it a third time, this time using the nouveau driver (which I've heard is better then nv) and that worked!

I know that supposedly you're also able to use xorg.conf to set certain Modes values for your display, but this didn't do anything for me at all in fedora, did help me in ubuntu, but then there I got the weirdest resolution.

finally I can look at a normal screen again.

Now I should get going to work, I'm gonna be really late (this really bugged me!)

Tuesday, August 18, 2009

Convert .VOB to .WMV with ffmpeg in Linux

A fairly simple command gets the job done:
ffmpeg -i filename.vob -vcodec wmv2 -acodec wmav2 -sameq -s 720x576 filename.wmv

Tuesday, July 21, 2009

SyntaxHighlighter follow-up

Something about SyntaxHighlighter has just caught my attention.

As I'd mentioned in my post about it I started out from an older version. I noticed there are a few more brushes then I'd initially added.

I added
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushXml.js' type='text/javascript'/>
But the list consists of
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushAS3.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushBash.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushDiff.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushGroovy.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJavaFX.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPerl.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPlain.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPowerShell.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushScala.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushXml.js' type='text/javascript'/>
Wow that's quite a few. You can add any/all of these along with or instead of the ones I'd posted before. Each one is needed for it's respective language, of course.

My custom RDP script

I have a crazy situation. I work at a .Net company, but my installed OS is Linux (Ubuntu Jaunty atm). This is ok though, I asked my boss first, because we use Remote Desktop to do almost all actual work.
Now we move around from time to time. So sometimes I have a different printer I need to share with the server. And since I also want to share a single folder with the server (not my entire filesystem like the TerminalServer client would like), so I decided to write a bash script to help me decide where I am.

startremote.sh:
#!/bin/bash

# Ask where we are, since we don't know where we might end up we add 'other'
# which will default to no extra parameters
srem_WL=$(zenity --list --text="Were Are You?" --radiolist --column="Pick" --column="Locations" TRUE location1 FALSE location2 FALSE other)

# Only do something if cancel wasn't pressed
if [ -n "$srem_WL" ]; then

# The user on the server, I use $USER because I know that on this PC I'll
# always be logged in under the same name as on the server
srem_usr=$USER

# The IP address of the server
srem_ip=0.0.0.0

# The size I want my screen to be
# I add the -g here because one might want fullscreen (with -f)
srem_geo="-g 1910x1120"

# The shares I want to send along
srem_share="-r disk:ShareName=/path/to/some/share"

# The start of my execute command
srem_ex="rdesktop $srem_geo $srem_share"

if [ -n $srem_WL ]; then
# Here we define the configuration differences for each location
case $srem_WL in
location1)
srem_ex+=" -r printer:MyPrinterForLocation1"
;;
location2)
srem_ex+=" -r printer:MyPrinterForLocation2"
;;
esac
# Since other has not been added to the case list it won't add anything
fi

# The end of our execute command
srem_ex+=" -u $srem_usr $srem_up"

# EXECUTE
$srem_ex
fi
You could of course also always share both printers, rdesktop won't complain if it isn't connected, but I'm always looking for stuff to program. And this way you can kind-of create different profiles for different locations.