January 2007 Archives

2007 Jan 31

Most of the time i do work with the linux shell, so most of the time i will be using ls to display files the current folder. However, in windows the command to display files is dir. i would always interpret cmd as a linux shell.

Back with the good old days, we could use doskey to assign shortcuts to DOS commands. So, we could just assign ls to its windows equivalent like this:

C:\> doskey ls=dir

Now, whenever we type ls, dir command is executed. We could also do that in Windows XP Command prompt, but the problem is after you have closed the window the doskey is also removed as well and we have to type it again every time we would run cmd.

There is actually a work around with that, we could modify our cmd shortcut in the start menu to add the doskey instructions there so that everytime the cmd is loaded the extra line is also executed as well.

cmd-shortcut.jpg cmd-properties.jpg

i have modified my shortcut target from


%SystemRoot%\system32\cmd.exe

to

%SystemRoot%\system32\cmd.exe /k doskey ls=dir

the /k makes the window stay after the doskey is executed. For more additional options about cmd you can issue the command

C:\> cmd /?

here are a few common options:
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K
/Q Turns echo off
/D Disable execution of AutoRun commands from registry


Alternatively, you could also change the value of your registry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

to

Value name: AutoRun
Value data: doskey ls=dir

Actually, its better to use the registry option because after adding the code to the shortcut properties; the code completion for the command prompt no longer works.

2007 Jan 30

Making a tarball and adding a mysqldump to it then naming it as example.tar:


shell> tar cvf example.tar dump.sql


Making a tarball and adding all files in the current directory then naming it as example.tar:


shell> tar cvf example.tar *


Compressing the tarball by zipping it (.gz):


shell> gzip example.tar


Restoring a tarball gzip file example.tar.gz


shell> gunzip example.tar.gz
shell> tar xvf example.tar

2007 Jan 29

Ready, Set, Go !!!

It was indeed an awesome experience with go-karting; you could fell the rush and the excitement combined. it was my first time to drive on a real life high speed machine?, toy? kart? ahh, well just call it Kart. Although, i had my 2 year experience with Need For Speed but its different with the real ones, had some nice drift moves out there. We had 8 laps of hardcore racing, during that time i felt like i was Michael Schumacher, but only with different outfit. Unlike with the other competition, the race was started with a mere GO shout, no sexy ladies waving sign numbers.

Go-Kart Race Start   Go-Kart Champion

2007 Jan 28

I'm pretty much excited with the upcoming movie Transformers! Been watching this cartoon series since I was in little now its back again. This time in the big screen, yeah! I can't wait to see Optimus Prime in action. I wonder how they will portray Megatron. Cool thing is, I think they'll be featuring Spike, the autobot's homo sapien friend on earth.

But if Spike really is in the movie and he's the decepticon's enemy, he'll pretty much need a revision rhinoplasty in any case he gets hit on the face by one of those big robots. Then again, autobots will save the day and it will be cool to see bumblee saving him. Hurray for the autobots, for more updates please check this site.

2007 Jan 25

mysqldump - i often use these to copy tables from one server to another since i find the phpmyadmin dump to be very slow and sometimes i get a page timeout. aside from copying a database to another you can also use it to backup your database or all of your databases. a mysql dump file contains sql statements to create databases, populate tables, or populate rows. Most of the time i saved the dump file as a .sql but you could also specify to save it as a .csv or perhaps .xml etc.

When restoring it i use the command \. on the mysql command prompt, i find it much easier that way than typing it on the shell.

i keep on forgetting the syntax to these commands so i better jot them down. These are syntax from the manual and is the most common syntax used in creating a mysql database dump.

shell> mysqldump [options] db_name [tables]
shell> mysqldump [options] --databases db_name1 [db_name2 db_name3...]
shell> mysqldump [options] --all-databases

example in backing up the mysql database:

shell> mysqldump db_name > [backup-file.sql]

dump all databases:

shell> mysqldump --all-databases > all_databases.sql

and restoring it back:

shell> mysql db_name < backup-file.sql

this is what I use:

mysqldump -u [user] -p[pass] [dbname] > [filename.sql]

add it in cron:

#!/bin/sh
date=`date -I`
mysqldump --opt --all-databases | bzip2 -c > /var/backup/backup-$date.sql.bz2

2007 Jan 17

snapshot

This is so nice, saw it on wordpress blogs. it lets you see a snapshot of the link before actually visiting it.

to add it to your site, you need a generated code from the snap site and paste it on you blogs head tag.

2007 Jan 17

Got this one from a post from lordtasyo's blog. you can visit this link and find out which file extension are you?

inf extension

About this Archive

This page is an archive of entries from January 2007 listed from newest to oldest.

December 2006 is the previous archive.

February 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Today

  • tildemark tweeted, "im so sleepy. Zzzzzzzz"

Sunday

  • tildemark tweeted, "some of my scipts are not working with godaddy. but works fine on the others. not mention their poorly coded admin page"

Thursday

  • tildemark tweeted, "so many pending tasks i need to finish. need more coffee !!!"
  • tildemark tweeted, "@gmtristan i dont think that is true."

Thursday

  • tildemark tweeted, "how does godaddy subdomain behaves? i have some problems with it on my scripts. it does not seem to accept query strings.."

Monday

  • tildemark tweeted, "i had a hard time removing the error messages generated by surf side kick. i ended up uninstalling most of my applications."

Sunday

  • tildemark tweeted, "i got hit by surf side kick and im getting numerous error messages on my screen. tskkkkk"

Saturday

  • tildemark tweeted, "check boxes, i didn't know they can also be complex"
  • tildemark tweeted, "this smart bro internet speed is depressing, i thinking of filling a complaint to the DTI next week."

Today

  • tildemark tweeted, "the seminar turned out to be leadership training. it was fun, learned alot. i have already attended numerous seminars but this is different."