Posts Tagged howto

ICOD – 6.2.10 – Delete all SMS messages on iPhone

Howto jailbreak and delete all SMS messages on your iPhone.

Click to continue reading “ICOD – 6.2.10 – Delete all SMS messages on iPhone”

, , , , , ,

1 Comment

LCOD – 4.12.10 – Quick Mysqlreport to e-mail setup

This will be a quick install to setup your server to e-mail you daily mysql reports using the cool mysqlreport application at hackmysql.com

Click to continue reading “LCOD – 4.12.10 – Quick Mysqlreport to e-mail setup”

, , , , , , , ,

No Comments

LCOD – 5.9.07 – Updating CPAN in Perl

Perl rocks, it’s easily my favorite programming language. One of the nice things about Perl is the CPAN (Comprehensive Perl Archive Network). Your Linux box has CPAN installed already, and to begin using it you should first update it. To do so run the commands just below. The first time you invoke CPAN it’ll launch the configuration module, just hit enter until it gets into the part about which mirrors you want to use, it’ll have you pick geographic areas first, and then tell you to enter servers by number, separated by spaces. I usually put in about 20 servers, which looks like kinda this

30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10

#invoke perl’s CPAN shell (and first time configuration with)
bash$ perl -MCPAN -e shell
#once configuration is done, update CPAN, and then reload
CPAN> install Bundle::CPAN
CPAN> reload cpan

Now, head on over to CPAN and search for some cool new Perl modules to play with!

A great place to dive into the world of Perl is Perl.org

Also the Perl Monks is a good Perl site, and Use Perl is as well.

Make sure you have a correct build environment setup, on Ubuntu/Debian you need to install the build-essential package (sudo apt-get install build-essential)

, , , ,

No Comments

LCOD – 3.12.07 – Speeding up your DNS queries

I did some testing and OpenDNS is fast.

To change to use OpenDNS instead of your own, or worse! your ISP’s crappy, poorly maintained dns server, you can follow the instructions here.

http://opendns.com/start/

The basic info is to put in these 2 IP’s as your dns servers

208.67.222.222
208.67.220.220

On Linux/*BSD you’d put them in your /etc/resolv.conf file like this

nameserver 208.67.222.222
nameserver 208.67.220.220

If you’d like to double whammy your performance run a local cache, I use DJB’s djbdns dnscache in forwarding only mode, as described here.

http://cr.yp.to/djbdns/run-cache-x-home.html

With the above IP’s in the @ file.

Installing DJB’s stuff is cake, you can pretty much cut & paste his instructions found here

http://cr.yp.to/djbdns/install.html

Of course you’ll need Daemontools, and ucspi, install instructions (cut & pasteable) here

http://cr.yp.to/daemontools/install.html
http://cr.yp.to/ucspi-tcp/install.html

If you get compilation errors cuz DJB hasn’t fixed a bug in his code and some systems (lots of recent Linux systems), run these commands.
(run after you’ve extracted the archive, and cd’d into it’s directory, and run for EACH install.) You may get a no such file for the src one on some, but he mixes software locations, so just run em both.

perl -pi -e ‘s/extern int errno\;/\#include <errno.h>/’ *
perl -pi -e ‘s/extern int errno\;/\#include <errno.h>/’ src/*

Enjoy!

, , , ,

No Comments

LCOD – 2.18.07 – Simple command line perl substitutions

Ever have a list of things that you want to change all the same? Say you have an image directory and you want to make an html list of all the images in your directory? Perl to the rescue!

first, make a file that lists all the images (we’re using *jpg, but you could do *gif, or *coolimages*, or just * for all files in the dir – note: all files in dir * with a redirect will catch the file you are redirecting to, and it will likely need to be removed)

From the shell / command line, run:

/bin/ls *jpg > ourfiles

Now the fun part! This will take a line like this

picture1.jpg

And make it look like this
<a href=”picture1.jpg”><img src=”picture1.jpg” border=”0″></a>

From the shell run / command line, run:

perl -pi -e ‘s/^(.*)$/<a href=\”$1\”><img src=\”picture1.jpg\” border=\”0\”><\/a>/’ ourfiles

The basic pattern of this command is

‘s/SEARCH PATTERN REGEX/REPLACEMENT PATTERN/’

The search pattern is a Regular Expression, and the Replacement Pattern needs to have any special characters escaped (including / $ # @ “) with a \

The Search Pattern we’re using is a simple one ^ for start of line, (.*) for . anything and * any number of times, with paranthesis around it to put it into the perl variable $1, and $ for end of line.

, , , , ,

No Comments

LCOD – 2.5.07 – Debian package management

This is all over the web, but for some inane reason I can never find it when I need it.

List all packages installed in a Debian system, piped to more for readability

dpkg -l | more

(dpkg dash lower case L pipe more)

Seach installed packages for ones containing the word foobar

dpkg -P /*foobar/*

This info from this site
http://electron.mit.edu/~gsteele/debian/

, , , , ,

No Comments

LCOD – 5.9.05 – mounting cdrom (iso) images transparently

mount -o loop /path/to/cdimage.iso /mnt/imageX

that’s it, of course you’ll need a kernel with loop support, but most modern linux’s have this built in.

This lets you save a CDR and get faster access to CD media you’ve downloaded. I use this at work to install Oracle from the hard drive remotely instead of having to be on side swapping CDROM’s.

Also, if you have a CD that you’d rather have an iso, here’s how to rip iso’s easy like..

dd if=/dev/cdroms/cdrom0 of=/path/to/cdimage.iso

you may went to grep cdrom /etc/fstab to see what the device is of your cdrom. Also, I’ve had some problems with this failing with copy protected type cdroms, sometimes if you mount it first it works better, sometimes worse.

, , , , , ,

No Comments

LCOD – 3.28.05 SVN commands/howtos

SVN is a version control management software
Subversion’s home page can be found here
http://subversion.tigris.org/

Lots of the links below go to the svnbook, the entire thing can be found here
http://svnbook.red-bean.com/

Sometimes you may checkout from one location and want to checkin to another location, use svn switch command detailed here
http://svnbook.red-bean.com/en/1.0/re27.html

Sometimes your SVN repository can be messed up, usually from somethign like running out of disk/memory and there will be lock files that prevent anyone from effectively using the repository. The best way to deal with this is shutdown apache (assuming you use apache to access your repo, shutdown anything else you have that accesses your repo) and running svnadmin recover /path/to/repository
more info here
http://svnbook.red-bean.com/en/1.0/ch05s03.html#svn-ch-5-sect-3.4

Backing up SVN is relatively simple, use the svnadmin dump command
For example
svnadmin dump /svn/sourcecode | gzip -c > /bkup/svn/sourcecode.gz

To restore SVN is pretty easy as well
svnadmin create /svn/newsourcecode
gunzip -c /bkup/svn/sourcecode.gz | svnadmin load /svn/newsourcecode

, , ,

No Comments