Wednesday, April 29, 2009

uni2ascii

If you are ever having issues with g++ compiling code cut and pasted from a website, specifically stuff like "stray \200 on line" or other similar errors, then uni2ascii is for you.

Just take the problem file, and do the following

cat problem.cpp | uni2ascii -B > problem_clean.cpp

The uni2ascii program will do it's very best to convert unicode to ascii where possible.

The new file should compile okay. Remember the -B, if you forget it, you will have lots of random unicode escapes in your output.

Labels: , ,

Wednesday, February 18, 2009

cifs mount in centos

Trying to follow the "Better Method" steps in this guide http://wiki.centos.org/TipsAndTricks/WindowsShares

Not going so well. The mount completes properly, but the directory is always empty when I do an ls.

Not quite sure what could cause this.

Update: This was an artifact of an incorrectly configured DFS setup. The instructions work perfectly.

Labels: , , ,

Saturday, July 19, 2008

Prevent nautilus from opening a new window

It often becomes irritating on some gnome installs that nautilus will open a new window for every folder. My desktop quickly becomes cluttered.

The following post describes how to disable this "feature"

http://ubuntuforums.org/archive/index.php/t-361989.html

For the impatient, the following commands will probably do the trick for you.


gconftool-2 --type bool --set /apps/nautilus/preferences/always_use_browser true

gconftool-2 --type bool --set /apps/nautilus/preferences/always_use_location_entry true

Labels: ,

Monday, November 12, 2007

webdot problems again

Upgraded to Bugzilla 3.x, and had of course, additional problems getting dependency graph generation to work.

Turns out this time that when I installed the graphviz rpm's from graphviz.org that the config file was not automatically generated.

Running "dot -c" from the terminal generated the needed config file. The error I was getting when running /usr/bin/dot before was as follows.

Hb6Hdotneato_args_initialize: Assertion `v' failed.H1NlH1.png

If it's working properly, you should get no output, as dot will wait for input if you pass it no arguments. Just CTRL+C out of that one.

Also, the graphviz rpm was complaining about libltdl.so.3 not existing, but I did a locate for libltdl* and found the source code was already on the system. A quick .configure, make, and make install, and I was almost there. Had to create a symlink from /usr/lib/libltdl.so.3 -> /usr/local/lib/libltdl.so.3

Additionally, you will want to do a view source on your graph dependency display page in bugzilla to see what whacky URL prefix it is using. On my system I had to do an Alias directive in the apache config to redirect the data/webdot URL's it was using to the actual directory on the server.

Labels: , ,

Saturday, October 13, 2007

Remembering, how to redirect output and stderr to null

info found here

./example.pl > /dev/null 2>&1

Labels: , ,

Thursday, October 04, 2007

ubuntu and the gutsy gibbon


I decided to try out the new pre-release version of Ubuntu, titled Gutsy Gibbon. Overall I found the installer to be very polished and easy to use. Make sure that you have at least 512MB of ram or you will have to use their alternate installer CD.

User Interface
They've added a lot of really neat user control panels, including an "Appearance" panel and a very useful "restricted drivers" panel. the latter is used to enable binary drivers from manufacturers like Nvidia and ATI, something that most users of high end 3d cards will want to do.

Printer Detection
I unlike most folks, have an HP 4600 at my house. The detection and driver installation of HP printers using jetdirect is so fast and easy, i'd venture to call it seamless. Amazing work by the Ubuntu team on supporting business class printers.

It automatically sought out and correctly detected the printer model of my HP 4600 Color Laser.

Eye Candy
In the Appearance control panel there is an option for tweaking the desktop effects. If you choose the "Extra" radio box, you will be enabling Compiz Fusion. I was able to enable Compiz, but unfortunately all my window titles disappeared after doing this. Something wrong with the window decorator I guess. They are releasing tons of updates each day as this is a pre-release, and other users who have had the window titles working before have mentioned that some of these updates have broken, then later fixed this problem. They should have it worked out by the final release.

For the testers
I recommend that if you are testing gutsy, set up your home directory in it's own partition. That way when the final release comes out you can do a complete reinstall. Some of the problems experienced during testing might linger unexpectedly when you install the final release, which I believe is set to be out at the end of October.

Crash Reporting
The crash reporting tool is pretty badass. it's very easy to submit crash reports, a lot less intrusive in fact than the Mozilla project's crash report tool. This app comes up every time an application crashes unexpectedly, but it does go one up on the Microsoft crash reporting tool in that it will give you the option to ignore future crashes of the same application. This is sometimes useful for apps like firefox that take a dive when they are told to terminate with more than one tab open.

Firefox Extension Manager
Not only can you grab generic firefox add-ins, the Ubuntu team has their own firefox add-in manager that can be reached from within firefox. This extension manager will load Ubuntu approved extensions through the system package manager. Word of warning though, when you use this panel you are not told to restart to activate the plugin, as you are with the standard add-in manager panel. This may confuse some users down the road.


Conclusion
If you'd like to try out Gutsy, and are looking strictly for the eye candy, hold off until the release, or use a test machine. Also, dont go manually mucking about with the /etc/apt/sources.list file until you have applied ALL the current updates and still are experiencing problems. I'm somewhat suspicious that my messing with this file may have broken the window titles when compiz was enabled, since there were two batches of distribution upgrades following my tweaking.

Labels: ,

Wednesday, October 03, 2007

Single keypress dropdown kde terminal

I have wanted something like this for ages in KDE:


YaKuwake - a simple dropdown terminal screen that comes with one hotkey press from the top of the screen. Like the old quake dropdown terminal.

Cant wait to try it out.

Labels: ,

Sunday, September 30, 2007

Playing Descent 3 on Ubuntu Gutsy Gibbon (7.10)

In the tribe5 pre-release of Ubuntu Linux 7.10 I managed to get the nvidia drivers working after a few updates.

Make sure to run

sudo apt-get update && sudo apt-get dist-upgrade

Regularly when you are in pre-release, as changes are happening all the time.

So, here I am at 1:45 in the morning, bored again, and I break out my Descent 3 CD. Actually it's an ISO backup, but I do have the CD in the bookshelf, so don't sue me. I mount the ISO to make it look like a cd drive, then do the following in the root of the CD.

sudo bash setup.sh

It asks me if I want to run the installer, and it also asks me if I want to install the mission data. Say yes to both.

After you finish the install, say no when it asks you if you want to launch d3 now. Then do the following

sudo ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so


You have to do this, because if you dont, you will get the following error:

jonnyro@jonnyro-desktop:~$ descent3
Failed to load library [libGL.so].

Descent 3 Message(Error: Failed to load library [libGL.so].
)

System Error


Happy gaming. If you have any problems running d3, just comment here in the blog and i'll be happy to help you out.

P.S. If you use the --nointro argument to descent3, you wont have to insert the second CD. it just skips those pesky intro movies.

Get your linux gaming on :)



P.S. There are very few places, if any to buy the linux version of the game. If you send me a picture of you holding up the windows CD, i'll hook you up with an ISO of the linux CD. Even better, an MD5sum of the first of the two windows CD's.

md5sum /dev/cdrom # or whatever you happen to be using

Labels: , ,

Saturday, September 08, 2007

bored saturday, ffmpeg and audacity rule!




Using Audacity, FFmpeg, and Fast Video Download (Firefox Addon), I recombined two youtube clips into one. All of this was done in Ubuntu Linux. Note that since the source videos contained mp3 audio data, you will need to add the MP3 codecs to your system. You can do this via Automatix, a GUI tool for adding all the extra codecs and programs that don't come by default in Ubuntu.

I didn't do it using a video editor. Details at the bottom.

Combined Video first.



Source video one.



Used the audio from this one.



Use Fast Video Download to download the videos from YouTube. They come down as FLV files.

ffmpeg -i source.flv -vn source_no_video.wav
ffmpeg -i source.flv -an source_no_audio.avi

Then open up audacity, and mix up the audio however you want, but keep the length the same. I just add another audio track in audacity, import the extra audio file, then trim, generate silence, cut, paste, etc.

Once you are done with audacity, export the file as a WAV file, with the same number of channels as the original. And use ffmpeg to put your monstrosity back together!

ffmpeg -i source_no_audio.avi -i new_audio.wav output_special.avi

And there you go!

Labels: , , , ,

Monday, July 02, 2007

Create a letterhead using OpenOffice.org Writer

I have not tried this article myself yet, but I was working on a letterhead using the Google Documents system, and came across this in my Google searches for letterhead samples.

Might be useful if you need to use OpenOffice for business or personal correspondence.

Creating a Letterhead in OpenOffice.org

Labels: , ,

Wednesday, June 27, 2007

KDE OpenOffice Integration

I am working in Kubuntu as my day to day desktop, and the only thing that is really bugging me right now is when I open a file link on the intranet to a word doc, and when it launches openoffice, Openoffice 2.2 complains about not being able to open the file directly.

This is a minor issue, but hopefully long term a workaround can be put in place that will allow me to do this sort of thing.

The Openoffice KDE Integration project is here:

http://kde.openoffice.org/

Labels: , ,

Tuesday, April 10, 2007

I want to check out this article later entitled "the perfect setup - debian etch"

It basically walks you through setting up a box for web hosting.

Perfect Setup - Debian Etch

Labels: , ,

Wednesday, March 28, 2007

Speeding up multiple windows xp installations

We set up a lot of windows boxes, and invariably they require quite a bit of patching before we send them out the door.

Sometimes we set up 3 at a time, which can be a real big hastle when you have to download the patches all at once. Lots of waiting, coming back, checking, etc.

So I thought, why not set it up to where we proxy the windows update files. It used to be that windows update would use WPAD to find the location of the local proxy server, but according to various sources on the internet, you now have to manually configure the proxy using the proxycfg tool. More details can be found from this article and the squid faq.


Windows Update v5 and squid (squid wiki)

Another very useful article from javier arturo rodriguez:

JR's article on windows update and squid

Labels: , , ,

ipod backup info.

Interesting article on backing up your ipod. very relevant since I want to switch my ipod from hfs to fat32 for better interplay between my windows and linux systems.

The blog is pretty interesting too, worthy of more research

Labels: , ,

Monday, January 15, 2007

Scanning a bunch of photos at once using scanimage in linux

Just replace the plustek:libusb:001:002 with whatever sane-find-scanner comes up with for your scanner. This script, once started, will just keep looping. It starts at 2.jpg incidentally, but you are free to modify it if that bothers you.

You will end up with a directory of images, hitting enter between each scan, so that you have ample time to swap the image on the scanner head.

The measurements below are set up for a 4x6 picture at the marked corner of the flatbed.


#!/bin/bash
VAL=1
while true; do
VAL=`expr $VAL + 1`
echo "Now scanning $VAL.jpg"
scanimage --resolution=300 --depth=16 -d plustek:libusb:001:002 -l 0 -t 0 -x 151 -y 101 > output.pnm
convert output.pnm $VAL.jpg
echo "Press enter for next scan"
read

done


Requirements
1. Sane, along with the various sane utility packages.
2. Imagemagick
3. Bash
4. Compatible scananer.

Labels: , ,

Thursday, December 28, 2006

Cpan problems and mediawiki from perl

I'm trying to install this mediawiki client for perl, so that I can update some pages via a perl script.

I am however having a hard time of installing it, as cpan insists it's not available on the server. Is that possible given that it's listed in the search?

http://search.cpan.org/~markj/WWW-Mediawiki-Client/bin/mvs

I'm not very familiar with CPAN, so if anyone has any tips or manages to install this package themselves, please let me know.

Labels: , ,

Wednesday, December 20, 2006

tmpwatch

Was hanging out in #gentoo, and marduk posted the name of a program that clears out temporary files based on their atimes, the last time they were accessed.

http://linux.about.com/library/cmd/blcmdl8_tmpwatch.htm has a little synopsis.

Labels: ,

Saturday, June 03, 2006

Open source podcasting?

Here is a somewhat old but interesting article on Open Source Podcasting. It talks about the various open formats out there as an alternative to the proprietary mp3 format, as well as a list of devices that at the time supported ogg playback.

The most interesting part for me is really the brief tutorial on the construction of RSS podcast feeds.

Labels: , ,