Main

March 7, 2008

Simple Bulk rename : A Bash file rename script

often I have to rename a whole set of files that have not processed correctly, to do this I rename them with Bash, a simple script to do this is :

for f in *_3; do mv "$f" "${f/_3/_0}"; done

this renames all files ending in _3 to the same filename but now ending in _0

January 15, 2008

Freebsd PHP ports tree

So I have noticed that from time to time the /usr/ports/lang/php5-extensions versions get out of sync, to fix this its as simple as just removing the config (make rmconfig [only if you want to add more modules]) and rebuilding make install -DFORCE_PKG_REGISTER

November 1, 2007

X11 Display on Vista with ssh

Need an X11 interface that works quickly and for free... install Cygwin with X11 and openssh.... then make sure your ssh on your remote host has X11forwarding=yes.

from your bash shell in cygwin type startx a x11 xterm will come up and type:

DISPLAY=localhost:0.0 ssh -Y remotehost


you set... then any remote x app will appear on your desktop

February 16, 2007

Stderr .... output to grep

When you use some program like spamassassin, you will notice that the debug information :

spamassassin -D --lint

goes to stderr ... so you cant use grep as straight forward as you want. Here is how to pipe it to grep in bash:

spamassassin --lint -D 2>&1 | grep ....

or spamassassin --lint -D > output.txt 2>&1

to pipe it to a file first.

Disk Hog on Unix

So it often comes to the time to find what is taking all the space on your hard drive and like many things in unix, this isnt so straight forward, du (disk usage) will tell you how to do this, here will show you your top ten offending directories:

du -ha / | sort -n -r | head -n 10

du -ha = disk usage in human readable format ( lowest to highest )
sort -n -r = reverse the order
head -n 10 = top ten

| = pipe the output to the next command

November 30, 2006

Simple Script to check if a process is running and if not restart it

I wrote this simple script to check if a process is running and if not restart it

Continue reading "Simple Script to check if a process is running and if not restart it" »

November 9, 2006

ddns for linux / unix in a simple cron job

Here is a script to update your dynamic dns for linux / unix...

Continue reading "ddns for linux / unix in a simple cron job" »

September 28, 2006

rm * results in /bin/rm: Argument list too long.

This will fix this problem:

find . -name '*' | xargs rm

September 18, 2006

Pc hdTv3000 Firmware

Incase you want to know where hotplug firmware goes:

in fedora core 5 it goes in /lib/firmware/

Mythtv rc.local startup additions

My rc.local for mythtv on fc5

Continue reading "Mythtv rc.local startup additions" »

Samsung LCD TV xorg.conf settings

Section "Monitor"

Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "SAMSUNG"
DisplaySize 890 500
### Comment all HorizSync and VertSync values to use DDC:
HorizSync 30.0 - 61.0
VertRefresh 60.0 - 75.0
ModeLine "1360x768" 85.5 1360 1416 1528 1792 768 771 777 795 +hsync
+vsync
Option "dpms"
EndSection

August 2, 2006

How to export MYSQL to CSV

Simply execute

SELECT <fields or *> INTO OUTFILE '/tmp/result.text'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM <table> WHERE <condition>

June 11, 2006

Replace mPlayer with Xine for the default Video player in MythTV

edit your media player in settings and change it from mplayer -fs %s to :

xine -pfhq --no-splash -r anamorphic %s

May 9, 2006

Mysql to fix Contrast on pcHDTV

So you got the pcHDTV and now the contrast is to high the best would be to use v4lctl to change the contrast on the card:


Continue reading "Mysql to fix Contrast on pcHDTV" »

May 8, 2006

Mythtv Add Eject DVD / VCD

Just add the following to /usr/share/mythtv/dvdmenu.xml
and optical_menu.xml :

fin

April 27, 2006

Nvidia Drivers on Fedora Core 5

How to install nvidia drivers on fedora core 5

Continue reading "Nvidia Drivers on Fedora Core 5" »

HTPC remote on Fedora Core 4 or 5 [Using Lirc]

images.jpg

How to get the Windows Media Center remote to work with Linux:

Continue reading "HTPC remote on Fedora Core 4 or 5 [Using Lirc]" »

March 12, 2006

Installing OpenSUSE on a SuperMicro with an Adaptec 2015S

What you need to do to ensure OpenSUSE and mkinitrd will see your Adaptec 2015S after install

Continue reading "Installing OpenSUSE on a SuperMicro with an Adaptec 2015S" »

Freebsd Dovecot Drac Plugin

I noticed the following error in my dovecot.log :

dlopen(/usr/local/lib/dovecot/pop3/drac.so) failed: /usr/local/lib/dovecot/pop3/drac.so: Undefined symbol "dracauth"

After reading Timo's read me on building drac.c (http://www.dovecot.org/patches/drac.c), there a few things you need to do to get rid of this error:

Continue reading "Freebsd Dovecot Drac Plugin" »

March 11, 2006

Getting WebDAV to Work with Calendar

I have a series of bars in San Francisco and I want to share our daily calendars for events, new projects etc... so I started looking at iCal using WebDAV and Sunbird or Calendar.

Continue reading "Getting WebDAV to Work with Calendar" »

April 2, 2003

Subnet Cheat Sheet

A Network Subnet CIDR breakout guide

Continue reading "Subnet Cheat Sheet" »