Tuesday, November 10, 2009

Happy 5th Year Firefox! Would It Still Be The Best Browser In The Future?

Glad to hear and celebrate a prospering success of an open source browser, Firefox, in 5 years in a row beating the Microsoft's Internet Explorer. Firefox was release on November 9, 2004 written by the Mozilla geeks which I would say, runs in a cross-platform (M$ Window$, Mac OS X, Linux/Unix) just like Sun Microsystem's Java programming language results in "software that is portable across multiple machine architectures, operating systems, and graphical user interfaces, secure, and high performance".

Due to Firefox innovative technology in the browser arena, many of the browsers that are up-to-date being innovative, and does alleviate its flaws to something more reliable User Experience, obviously, Internet Explorer 8 (I feel being cynical).

Firefox still my best choice, not to mention the fast pacing Google's Chrome browser, compared to other browsers. Safari does a good job specially loading a heavy AJAX application.

So what makes Firefox be my best choice and be my best browser of all? Well, Firefox is extensible and does has lots of add-on's, just like your favorite Youtube downloader :D. It's very helpful for a developer, it has lots of promises that can offer and bring forth to me as a user or a developer. You can check also for Firefox's "new device API for Firefox 3.6: orientation".

However, it seems that Google's Chrome is going more far from its infancy and they are really doing a pretty good job, specially on their development for Chrome OS and their Google Wave. Google focuses much more on desktop applications that is optimized for data exchange and software in the cloud. I found it more innovative in their focus on making OS in the cloud, whereas Firefox is on the user-level but extensible on making it just like Chrome.

Chrome is much better on loading AJAX requests load than Firefox. Mostly I got hangs or browser crash which I think it's because of too much add-on's I installed or there's really an underlying bug in Firefox (though I experience this in my Slack).

Well, still, Firefox is my best friend! I have firebug, I have web developer tools, I have a validator for my XHTML/CSS tags (Total Validator or HTML Validator, I have Live HTTP headers, Web Mail Notifier, Answer.com's very helpful add-on, and as well, I can transfer through FTP using FireFTP and install FireFTP if my privileges are stricted for any installation, like Filezilla FTP.

I might rather say that, Firefox still has success in the user-level and deemed to be most usable browser as an alternative to Internet Explorer. However, Google might be enthroned if Firefox cannot take the advantage of it's massive users to take thrive more on it's development tools (XUL), extensibility, and its innovative philosophy. We know Google is really kicking asses because of their cool technologies developed, and made it open source as well, which worries the Firefox community.

Some articles I've read which you might also be interested are:
Can Firefox Last Five More Years? Forecast: Cloudy
Firefox: Five Years In The Open Source Hen House

Checkout also FFEHR (an electronic health record) http://trac.afterfivetech.com/ffehr/

Enjoy reading!!! =)

Sunday, November 8, 2009

Changing the Keyword Location Search Engine For Firefox

If you might notice, installing Yahoo toolbars might override the settings in your Mozilla Firefox browser. I am not quite fan of Yahoo's search algorithm, as it seems quite naive to me, and I need to change the search engine using Google.

To change it, just type (see image below):

on the location toolbar of your Mozilla Firefox browser. Then search for

then double click it or right click, and select Modify and paste this

Try typing keywords on your location bar and hit enter, you will be redirected to a particular site, or else the Google's default search page.

Happy Googling!!! ;-)

about config

If you're viewing this blog from a feed, click here to fully read this post =)

Saturday, November 7, 2009

Pacquiao vs. Cotto bout on November 14, 2009

I just see the HBO's Episode for the fight of Manny "Pacman" Pacquiao over Puerto Rico's pride, Miguel Cotto in youtube.com.

Most analysts, still favors Manny Pacquiao for his abilities in the boxing ring, with speed, strong punches, and a good training along with his coach, Freddie Roach.

Miguel Cotto stands at 5'7 with with 34 winds, 27 knockouts, and 1 Loss. While Manny Pacquiao has 49 wins, 37 knockouts, 3 losses, and 2 draws.

Both of them shares the prominence and noble respect with their respective country, Philippines for Pacquiao, and Puerto Rico, for Miguel Cotto, as heroes bringing forth the name of their country on their behalf in the sports entertainment.

I both salute for these guys but only one can win on their match. I love Manny's speed and strong punches, and I love Cotto's stance, looks like a ferocious bull to me, and his devastating punches just like Manny too.

We'll see what they can do in the ring, and of course, entertain us with full satisfaction! On November 14 (15 hours ahead of our time), watch their fight which will be aired via pay-per-view.

I will try to find a live streaming for their fight, with no commercial breaks, and put the link here in my blog.

Watch the video for the first Episode of their fight. Hope you'll enjoy!

If you're viewing this blog from a feed, click here to fully read this post =)

Skeleton Prank Riding on Bike and Taxicab - Very Funny

I really love this very funny prank video from Brazil. It's about frightening the people, wittingly, with those skeleton props using a remote device to obtain manipulation over the vehicles had been used for this video.

The first video, shows a skeleton--resembles like "Ghost Rider"--riding on a bike and yawping on those people walking alongside the cemetery. Watch it and, I bet no penny would be wasted on your time. It really scrumbles my stomach because of so much laughter. I can't imagine if I would be the victim, I might perhaps throw a heavy stuff I can grab on that Skeleton! LOL!!!! I put the translation on the first video below the video object.

Note: For the translation on the first video, I just relay on one of the comments where the skeleton
is saying, "Hey you, do you want a ride to hell muahahahaha, don't run I will get you one by one!",
and on the drunk or the hobo part, he said "hey you drunk let me take you to hell muahahahahaha"...
Really, hahahaha! Very funny!!!

The second video, is still the same, but on a different vehicle which is a taxicab.  Very funny prank!!! Watch them, and hope you'll enjoy!

If you're viewing this blog from a feed, click here to fully read this post =)

Monday, November 2, 2009

Higante of Ely Buendia and Francis "Kiko" Magalona

Have you heard of this song?

Such a great composition! I was waiting for this album to be release and hearing this significant collaboration of two
famous legendary music icon in the Philippines, Ely Buendia and Francis Durango Magalona. Their hit song entitled "Higante" (which means Giant) top at the Philippine charts at #20 in Myx and ended at #10 in the month of October.

The lyrics of the song seems embodies some political views or power because of the abusive power that the "Higante" has, oppressing "Higante's" diminutives.

Have a listen to their video, it's really a cool song!
Here's the video of their gigantic song, "Higante" courtesy of Youtube:

I posted the lyrics of the song below.

Higante Lyrics

(Ely Buendia)
Narito palagi
Di nawawala
Ang bendisyon ng pari
Laging nasakanya
'Sing taas ng ulap
Ang kanyang tindig
Nakaupo sa palad
Ang buong daigdig

Siya ay dambuhala
Siya'y nakakalula
Dadalhin ka niya
Sa sukdulan

(Francis M.)
Tumingala sa langit
Kung nais mong makita
Ang higanteng panget
Tila naninindak
Sa noo nakasipa
Ang aking saltik
Sa lakas ng tira
Sa lupa siya humalik

Siya ay dambuhala
Siya'y nakakalula
Dadalhin ka niya
Sa sukdulan

maliliit na tao ay walang kalaban-laban
sino ka kung makaasta
isa kang kontra bida diba
maliliit na tulad namin sinasaktan mo at kinakain
magtago ka na dambuhala kakampi namin si bathala
kung ayaw mo na maniwala sa bato mapipinsala

Siya ay dambuhala
Siya'y nakakalula
Dadalhin ka niya

Siya ay dambuhala
Siya'y nakakalula
Dadalhin ka niya
Sa sukdulan

Ahhhhhh Ahhhhh
Siya ay dambuhala
Siya'y nakakalula
Dadalhin ka niya
Sa sukdulan

Friday, October 30, 2009

Cloud Computing - What is it?

"Soon thereafter, everything we are using will stay in the cloud!"

Well, what does really "Cloud Computing" means?

Salesforce.com has a pretty decent explanation about cloud computing on how this operates between the user and within the Internet. Cloud means, the Internet. Conceptually, Cloud Computing is designed to make abstracted behind the users of the software, where no need for in-depth knowledge of some specific software. Actually, Cloud Computing will be far more adapted
for so many years.

Watch this movie from Salesforce.com:

Well, why should I say that? Well, as we all know, globally, we are down with such crisis. Financially really hit many countries down, specially the United States of America (well, thanks God, this happens because alternatives are arising!). Cloud computing doesn't want you to buy or pay every applications you use. It does only counts every time you use your applications, basing on how much have you used or scaling your statistics of usage with the applications you have utilized, by either personal, business, or some social networking. It's actually ideal and of course, economical.

I would say, Cloud Computing has a vast idea behind other known computing development technology, such as Grid Computing and Utility Computing.

And what are those things might we consider as disadvantages of this?
Well, this is really tough for us, like Software Engineers. Since users behind the cloud computing, it's predictable that it's rapid
growth of traffic, and of course subscription, might deliver from pain-in-the-ass sticking in our neck. Well, it's very tough, of course, to handle such a massive amount of networks, but if a good or perfect algorithm has been appropriately applied and involved as a practice, as well as smart people are living in, well, this can be just a plain documentation.

Cloud computing is much known for running virtualization which is, typically a perfect tool because, cloud computing involves cost-cutting, of course! What's the benefit of this approach, if we don't think of a much better solution, isn't it?

As of today, various companies are really developing on these stuffs. IBM has their Autonomic Computing, which heals by itself, fix itself, and it does also optimization being transparent to the user. I actually love how their algorithm behind it's philosophies are applied. It follows actually how our motor neurons work. Sounds interesting? Well have a visit on their page http://www.ibm.com/autonomic/.

With all these stuffs, I'm so happy that these various technologies, including Cloud Computing is emerging. It phases our knowledge, mind, and impossibilities to possibilities where people can think of various alternatives for a better live, in virtual world.

Thursday, October 29, 2009

Installing wpa_supplicant in Slackware

Ever since I'm connecting to my wireless router WRT54GL from LinkSys, I never thought of WPA and the wpa_supplicant for my Slackware Linux box. I do connect through WEP security mode for my encryption algorithm. I know it's just a basic authorization for my wireless, instead with wpa_supplicant for WPA, until I found out that my neighbors are abusing my connection, and don't want my stuffs to be exposed.

It was funny actually when my neighbors approach me and ask me if I'm the owner of that connection that they able to detect, and say, "hey, don't put any password on that". Really, it sounds daring and hilarious but rude.

I do connect from my Slackware Linux via shell using the commands:

$> ifconfig wlan0 up

$> iwlist wlan0 scan
$> iwconfig wlan0 essid "myssid" key "8EEDEEFE41"

$> dhcpcd wlan0

The first command will take my wireless LAN card to be up, which actually down during start up. Somewhat like, disable and enable if in Windows environment. The second command will scan for available wireless connections in my area. It's actually fine to not do this, but I do usually check how my wireless status is, and if I have some available connections that I can reach through, that is lurking for some free connections. The third command will be the one to grant me access for my router and lastly, dhcpcd will connect the interface through the Internet.

WEP, which stands for Wired Equivalent Privacty, is already a deprecated algorithm for wireless connections. There are actually lots of issues with its algorithm for being weak and is also susceptible to be hacked easily. I remember, I found some videos in the Internet able to grant the WEP key but there's a lot of tools involve to achieve this. Because of those things, I choose to use WPA.

That's all about with WEP!!!

WPA stands for Wi-Fi Protected Access. My setup is just simple, achieving to connect through my WPA setup in my wireless network. Installing wpa_supplicant is easier through Slackbuilds, though I use the binary package, the .tgz file for my installation.

So I downloaded the package for wpa_supplicant for my Slackware at http://connie.slackware.com/~alien/slackbuilds/wpa_supplicant/pkg/12.0/wpa_supplicant-0.5.9-i486-1.tgz at http://connie.slackware.com/~alien/slackbuilds/wpa_supplicant/pkg/12.0/ list.

Then issue the command:
$> installpkg wpa_supplicant-0.5.9-i486-1.tgz

Afterwards, I move first the original file named /etc/wpa_supplicant.conf to /etc/wpa_supplicant.conf.backup and edit the contents leaving only the required things I need to have for my connection. My ssid is "myssid" and the WPA shared key is "mysecretcode".

I then issue the command:
$> wpa_passphrase myssid mysecretcode

and the output is:
So I edit the file with my favorite editor, vi
$> vi /etc/wpa_supplicant.conf

With contents:







As you can see, I put the generated psk after I ran the command wpa_passphrase.

Afterwards, I run this command:
$> wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

-B = runs in the background
-D = specifies the driver to use. Mine is generic, which is shifted by Intel, so I use wext.
-i = specifies the interface to listen
-c = specifies the path of the configuration file.

In my opinion, I don't like to configure my stuffs automatically during start up, instead it would be great to create a bash script instead of putting them in somewhere else while I might forgetting them.

Afterwards I do:
$> ifconfig wlan0 up
$> dhcpcd wlan0
$> ping toytoygogie.blogspot.com

For some external resources, I recommend http://www.thinkwiki.org/wiki/Wpa_supplicant this page, so check it out.

Although there are some reports about the algorithm of WPA specially with TKIP, my guide here is to achieve installing wpa_supplicant in Slackware Linux. I will post more about the exploits that WPA encounters soon.

Wednesday, October 28, 2009

Prosperity - List of Countries in 2009

In reference from the site of Prosperity.com, please see the image posted below for the list of country rankings for Prosperity in 2009.

As far as I've read their downloadable PDF file , Legatum are basing their surveys from an objective data and subjective responses. These involve the status quo of every country in its stance.

Prosperity embodies health, personal freedom, wealth or financial security, good fortune, as well as environmental living, success, and flourishing. My country, Philippines, is enlisted in the rank 55th position.

I'm just curious why USA is enlisted at the 9th position. I thought, the USA are much bogged with the global financial crisis, but well, President Barack Obama did aleviate its prosperity back astir.

I've read the article from Yahoo, seemingly agreeing it's position. The country has it's economic boom, but their government and politics are too tight for me, to think of, when it comes to personal freedom.

One thing I might, in my opinion, have to be consider of, are countries tradition and the language. There are languages that are hard to learn, albeit English language is mostly used, but there are among the countries doesn't talk English. Filipinos are good though, and we have long lands too that I consider a paradise and as well, the "Prosperity" in its existence. I'm proud anyway Philippines is not too deep in the list.

Well, it is how we, humans, do create prosperity and so retain also the prosperity by our own nature and own values.

How about you? Do you have prosperity in life now?



Tuesday, October 27, 2009

It's Gonna Make Sense - Michael Learns To Rock

My first impression for this song was from a boy band, and I hate boy band. Never knew that this from MLTR (Michael Learns To Rock) band. I love MLTR, of course, back in my younger years playing with my guitars.

Have a try to listening to their song. It's a pop song but it's actually a cool song.

I have pasted also the lyrics, so if you wanna song feeling like in a karaoke bar (so do I?), have fun singing the song.

It’s Gonna Make Sense

Life comes in many shapes
You think you know what you got
untill it changes

And life will take you high and low
you gotta learn how to walk
and then which way to go

Every choice you make
when you’re lost
Every step you take
has it’s cause

After you clear your eyes
you’ll see the light
somewhere in the darkness
After the rain has gone
you’ll feel the sun comes
and though it seems your sorrow never ends
someday its gonna make sense

Tears you shed are all the same
when you laughed ’till you cried
or broken down in pain

All the hours you have spent in the past
worrying about
a thing that didn’t last

Everything you saw
played a part
in everything you are
in your heart

After you clear your eyes
you’ll see the light
somewhere in the darkness
After the rain has gone
you’ll feel the sun comes
and though it seems your sorrow never ends
someday its gonna make sense

Someday you’re gonna find the answers
To all the things you’ve become and all they’ve done
At your expence
Someday it’s gonna make sense

Monday, October 26, 2009

Trouble WIth BIOS After a Failure Update Is Just an Easy Fix

Updating a computer BIOS is really trivial. Once you come up into trouble with your BIOS, like a failure during update, or an error that will cause it a failure update, might turn you into trouble by perhaps a total replacement of your motherboard, unless you are really prepared for things to do.

In my experience, it's not that, it's actually easier than what I think before taking an attempt to update. My CPU's motherboard is PM8PM-V from MSI.

I follow the guidelines I have read from MSI, using their live update, but it comes into trouble when it goes a failure update. Now, since I did skip the "Create a disk Recovery", where it needs a floppy drive (but who uses a floppy drive this days?), and now, I'm in trouble with my BIOS.

Since I have my floppy, but have never used for almost more than 2 years, now it seemed my floppy drive is a little bit dusty inside because it always fails to ready any floppy disk I have. Luckily, I have a floppy disk cleaner I bought last 2003, so that was 6 years ago LOL! I put my floppy cleaner and it works reading my floppies.

So back again, what I did is, I found my BIOS version that bypasses that LiveUpdate (only just files) which I get from here, http://forum-en.msi.com/index.php?action=dlattach;topic=124428.0;attach=5328. Then I save those files into my floppy diskette, and create an "AUTOEXEC.BAT" file with its contents "AWDFLH.EXE W7222VMS.330" (without the quotes).

After I reboot and after I encountered that failure on BIOS update using the window version update, I encountered this message, like the image shown below:


Everything on my UI hardware stops to work like my mouse and my keyboard. When you encounter this trouble, the BIOS
by default will look for the floppy drive and detects if it's a BIOS program or not. If it's not a BIOS program, it will give you a message anyway.

After I put my floppy during reboot, the BIOS will be automatically be flashed and reads that content in the floppy I have stored. It will actually look or execute the AUTOEXEC.BAT and read it's contents inside that file.

Now, after flashing my BIOS, you will see a status of "complete" or a "reset" button will be colored. Now, you can push the reset button of your CPU, and everything will be back to normal.

Hence, my BIOS version also has been updated, and I conclude that, it was easier than i think of.

Sunday, October 25, 2009

Geocities Marks it's Goodbye on October 26, 2009

It's the mark of the end from the starter back on the early years of Yahoo. Founded by David Bohnett and John Rezner, the company is shutting down it's service effective this October 26, 2009. Maybe later, my time here is GMT +8:00.

Geocities have been a massive users using it's service. It's actually cool back then, some of it's competitors like Angelfire which was also ceased it's opertion in 2002.

Make HTML a PDF via Internet

There are many tools in the internet built now these days. One of the tools I mostly used is to convert a page, an HTML page, to PDF because I like PDF format to read and and shared also with my friends.

I use this tools in the net:

And after I grab this pdf convert pages, I stored it via Google docs.

When storing in Google Docs, I do always make my documents in order so that it would be easier for me to locate things I need to find or use.

Try it, and it's really helpful to store your documents in PDF being centralized. PDF viewer from Google too is really awesome!

CCTV in Davao City Caught a Man Murdered

This video was caught on CCTV (Closed-Circuit Television) where a man, who was identified as Chris Anthony Togle, a City Hall employee
of Davao City.

Just watch the video below, and this guys are really exchanging bullets with the heat they feel without thinking they might be dead or they
would kill their fellowmen.

I hope there will be more CCTV's here in Davao.

For the latest Philippine news stories and videos, visit GMANews.TV

Thursday, October 22, 2009

libMagickCore.so.1 No such file or directory

ImageMagick is such a very cool tool for editing/modifying images through shell. However, when I ran out of trouble encountering the problem like, example running the "convert" (one of the ImageMagick tools)command:

$> convert test.png test.pdf
convert: error while loading shared libraries: libMagickCore.so.1: cannot open shared object file: No such file or directory

and doing:

$> locate libMagickCore.so.1

which means, it does exist. In order to fix this, just run:

$> ldconfig

and everything will solve the problem!

Hope this helps!

Sunday, October 18, 2009

Make Youtube or AVI Movies to DVD in Linux

Tools I did download:

- ffmpeg
- Dvdauthor
- dvd+rw-tools
- transcode
- Mjpegtools
- mplayer

I installed library dependencies which are libdvdread, libdvdcss, libquicktime, amrwb, libdc1394, libgsm, x264, libraw1394, and libmpeg2.

I use the online downloader http://online.movavi.com/ and enables me to download the "flv" file format of the file. Afterwards I use ffmpeg to convert the file from flv to avi with this command.

$> ffmpeg -i video.flv -y -f avi -b 1150 -s 320x240 -r 29.97 -g 12 -qmin 3 -qmax 13 -ab 224 -ar 44100 -ac 2 -acodec libmp3lame -target dvd youtube_movie.avi

Afterwards, I use transcode to convert my avi files to mc3 and m2v format where the audio and video are being separated. I use the command to convert it through:

$> transcode -i youtube_movie.avi -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o movie -D0 -N 0x55 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.9 -f 3

The fps of 29.9 can be set manually. I set that since i was trying hard to get the timing of the frames per second of the video from youtube I got.

Afterwards, I combine them together, video and audio with this command:

$> mplex -f 8 -o youtube_movie.mpg movie.m2v movie.ac3

And then to create a dvd formatted files, I use the dvdauthor to make the job done. The command I use is:

$> dvdauthor -x dvdauthor.xml

In my dvdauthor.xml file, I have two movies where the contents is:

<dvdauthor dest="DVD">
<vmgm />
<vob file="dvd_movie.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
<vob file="youtube_movie.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>

Then I test my movies by issuing the command:

$> xine dvd:/my/full/path/of/DVD/VIDEO_TS

Then I burn to my DVD by issuing the command:

$> growisofs -Z /dev/hda -dvd-video DVD/

In reference from linuxquestions.org post, I arrive to make youtube or
AVI movies to DVD in Linux successfully.

Friday, October 9, 2009

Linux Using xargs to Copy All Files in Directory or Subdirectory

To copy all the files, for example, mp3 files in a directory/subdirectory to another directory in Linux, you can use the xargs command and the find but by using "sed" tool to also filter the quotes of file names.

The command is pretty simple which is write down below.

$> find . -name "*.mp3" | sed -r "s/'/\\\\\'/g" | xargs -t -I '{}' cp '{}' /media/disk/Music/

What it does, is that, it will find any files that ends with *.mp3 file extension from the current directory the command is being executed, and sed will will apply a regular expression to filter the quotes and replace it with "\'" (a slash and a single quote). After this, xargs command will catch the lines outputed by the find command but filtered with sed and executes a cp command and directs it to /media directory.

find options:
-name = specifies the name to find

sed options:
-r = will do an extended regular expression

xargs options:
-t = print the command line (which is the cp) in the standard error output before executing the command
-I = replaces the brackets '{}' with the input from find and sed (or the initial-arguments with names read from standard input) and it's separator is the new line

Friday, September 25, 2009

Explaining About Bittorrent Encryption

I remember I downloaded a torrent with KTorrent in my Slackware-Linux box, thinking that everything is alright, but that was in the office. After I downloaded that source, which is an ISO file, I told my boss to share that I did download an updated version of that file. Then he look at me and ask me disparagingly, "Are you downloading it securely or using encryption?". I ask myself, "dang, what did I do?" and stuck in a moment, geeze! We'll he told me to download anything since our internet is faster than a DSL.

Okay, cut the crap! I'm not digressing here.

So I did a research about encryption and other stuffs with Bittorrent and this will be explained!

I read some articles "
How To Encrypt BitTorrent Traffic", "BitTorrent Encryption Confuses the BPI, ISPs and Journalists Who Don’t Research", and "BitTorrent Encryption Myths" and learned that encryption doesn't do anything about hiding user's end information or even the data packets being shared are not encrypted in a way that, you can hide the data being transmitted from one user to another user's end. AFAIK, in P2P system, IP is not hidden from it's origin.

Bittorrent clients that implements encryption are using MSE/PE (Message Stream Encryption/Protocol Encryption) or PHE (Protocol Header Encryption). Its purpose
IS NOT TO PROVIDE ANONYMITY OR CONFIDENTIALITY of files being shared/transferred. This encryption only aims to speed up the download at full-speed using bittorrent clients which avoids the third parties (ISP's) to throttle the traffic in a peer-to-peer network.

I don't think so that a P2P system that enables a massive downloads by user's would enable the encryption that makes your data secure or anonymously hide your information from the provider, though it is but it worth a penny and I cannot call it as massive or swarm uploads.

I realize that, the thoughts that my boss he has was wrong with encryption in bittorrent clients implicitly saying that "it would provide data security or anonymity to user using bittorrent clients", sorry but it's not that way.

At least, I made it clear now. =)

Wednesday, September 23, 2009

Removing of Multiple Files with Exception Using "rm" command in Linux

Now I get into this point. I remember I did some simple command, back then, by using "rm" command in Linux. Try searching in the net but none of it provides me the answer.

The goal was that, I have a directory named, "reports" with lots of files/directories/sub-directories inside it, and try to delete all of them but with exclusion of the files that starts with the word "report-" (ex. report-2009-10-19.html).

I thought the command issued in my shell

$> rm -rf $(ls reports/|grep -e '[^report-*]')

would enable me to delete the files but it seems it doesn't work. My expectation was the files that does not start with "reports" word will be deleted. Then I read the manual of rm ("man rm" in bash), I found that the -v would select those non-matching lines.

Now, issuing the commands in my shell

$> cd reports
$> rm -rf $(ls .|grep -v '[report-*]')

enables me to delete the files that starts with the word "report-".

Hope this helps!

Tuesday, September 22, 2009

Connecting Samba 3 from Linux to Mac OS X Leopard

I'm so befuddled yesterday until I figured it out that it works from Mac OS X to Mac OS X Leopard with Samba 3. I thought my smb.conf doesn't work.

Now, Linux to Mac OS X was hard because I thought, I must ran smbpasswd to provide password for the username I have to used. I was thinking that Mac OS X's Samba configuration directs the use to able to check on the user's of the machine with it's account information (username and password of the Mac OS X Leopard machine).

It does able me to authenticate and access my folder via that Mac OS X machine.

I found this article also, seems we have the same issue faced.

Wednesday, July 1, 2009

delete multiple files/directory with exclusion

I have multiple files in a directory and I was logged in thru my bash shell. Then I just issue the command below.

rm -rf $(ls|grep -E '[^(^ext$)|(mootools)]')

grep -E will execute an extended regular expression so ext and mootools will be retain or excluded upon deletion of files in the current directory.

Sunday, June 21, 2009

eavesdropping in ssh

This happens when we are switching from old server to another server and assigned a different IP address from the specific domain name.

bash-3.1$ ssh myname@example.com
The RSA host key for example.com has changed,
and the key for the according IP address
is unchanged. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /home/myname/.ssh/known_hosts:16
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home/myname/.ssh/known_hosts to get rid of this message.
Offending key in /home/myname/.ssh/known_hosts:13
RSA host key for example.com has changed and you have requested strict checking.
Host key verification failed.

This is how ssh works, but if you know that your server is really which is which. Though dig-ging it might be a help.
example in your bash shell, type:

$> dig example.com
$> dig -x example.com
with -x if you want to know the reverse lookups, mapping addresses to names

Friday, June 5, 2009

find and perl as alternative for sed

In continuation of my migration, some directories with HTML contents their are manually inputted by strings that would let a typical user to edit manually all the HTML files for just a sake of changing a text. However, Perl as an alternative for sed is quite helpful.

The command goes like this:

perl -e "s/www\.hawaiifsbos\.com/test\.hawaiifsbos\.com/g;" -pi $(find . -type f)

-p = will do a loop sequence. For more info, read the page in "Using the -n and -p option"
-i = will modify file in-place. providing after the "i" letter with a word, will be used as a back-up suffix of a file. (Ex. -pi.bak)
-e = means execute

This is the same thing as

find . -name "*.*" -type f -exec sed -i 's/www.mysite.com/test.mysite.com/g' {} \;

The above works in my Slack, but it seems weird it doesn't do in FreeBSD, but the perl is there as my alternative.

rsync: avoid overwriting of files

I was migrating this stuffs we have from an old FreeBSD 4.0 Server to a new FreeBSD 6.0 Server hosted at Verio. I was fumbled and tumbled when I use this rsync tool by migrating the files to our new server.

The situation is that, in every directories we have being assigned in a virtual host and its DocumentRoot are having different owners and group assigned. The old server we have is having a version of an old Apache. Now, in order to achieve the exact ruling or permission, rsync is a tool that enables you to preserve ownership as well as its permission of the files/directories that you're going to copy--or shall we use the term "migrate".

My mistake was that, migrating with files using rsync is a little bit tricky. Ending a copy like this, for example:

rsync -r -e "ssh -l ahkmed" localhost:/home/ahkmed/documents /www/documents

is a different story than

rsync -r -e "ssh -l ahkmed" localhost:/home/ahkmed/documents/ /www/documents

Note the ending has slash in it while the first one has no slash in it at "/home/ahkmed/documents/".

The first one will copy the "documents" folder and its contents to /www/documents. So this will result into /www/documents/documents. If you're intending to grab the "documents" folder and put it in /www/documents only the contents of that "documents" folder, you need to use the second rsync command that I have shown above, i.e. with trailing slash (/) at the end.

You should really be aware of the differences between the two because you might end up fumble and tumble as what I did. The story goes like this. I have the files in /usr/local/apache/htdocs from an old server and I made the stupid thing when I issue like:

rsync -r --delete -e "ssh -l ahkmed" oldserver.com:/usr/local/apache/htdocs/ ../

where the current directory I am in the new server is at /usr/local/apache2/htdocs/. This means that, delete all the files if not existent at /usr/local/apache2/in the new server. Dang, it really works deleting it, but it's a mistake! However, I do make backups of course.

Now, here's another stuff what I learned from rsync also, you can do filter files like you don't want to be deleted or updated.

rsync -o -p -g -v -r -a -u --update --exclude={camping,journey,files.txt} -e "ssh -l ahkmed" localhost:/home/ahkmed/Desktop/pics .

-u = will tell that the receiver has the updated file
--exclude = will do a filter, excluding a directory name (whether it's a subdirectory of a directory). Appending lots of filters, I suggest to you --exclude-file=FILE_FILTERS.

This prevents an rsync copy that has contents been modified and also a directory that you don't want to update anymore, somewhat like the subdirectory is a final copy, while others needs to be copied if newer files has been copied.

Tuesday, May 19, 2009

Installing MySQL v6 in FreeBSD

FreeBSD places its packages under /usr/ports/. Now for databases, types this command

cd /usr/ports/databases/mysql60-server

Then issue


after make, issue

make install

You can even specify it's configuration options like --prefix by doing "make install --prefix=/usr/local" where it will install the mysql packages.

This is applied also to the client package, just follow the steps how the server is being installed.

Create /var/db/mysql if that direcotry doesn't exist, then "chown mysql:mysql /var/db/mysql" and "chmod 770 /var/db/mysql" for security. Run the mysql_install_db command which will create default tables that mysql will used on its server process.

Run the mysql background process by issuing the command "/usr/local/etc/rc.d/mysql-server start" or perhaps it might be "/usr/local/etc/rc.d/mysql-server.sh start". I think older BSD preserves the .sh suffix on the start up scripts.

Don't forget to provide password to your root. Issue this command "mysqladmin -u root password egret" where "egret" is my database password, just an example.

Hope this helps!

Sunday, May 10, 2009

rsync using ssh via a sudo command

My main goal for this is, I was migrating from an old server to a new BSD server. In order to make preservation of user accounts,
I manage it with this command below using rsync tool to transfer or copy the files.

"rsync -p -o -g -r -a -v -e "ssh -l normaluseraddedviasudoers" --rsync-path "sudo rsync" --delete oldserver.com:/home . --log-file=/tmp/rsynclogs.txt "

-p means to preserve the permission, -o means to preserve the ownership, -g means to preserve the group.

-r means to recurse into ts sub-directories, -a means to archive them, -v means to use the verbose mode, -e specifies the remote login to use. With --rsync-path, it makes how to run rsync which this means like run the rsync via sudo or via root.

Now, I am able to copy all the files under /home directories without prior chmod afterwards when you are on the new server. It makes the rsync set everything for you and not worrying if the files has been able to copy or not it's because you might not copy everything because files/directories was not able to read because the user has no permission. With that command, that will help you solve your problem.

Note: You must add the normaluseraddedviasudoers with no password, that is:
Let say you are on the oldserver shell issue
$root@host > visudo

then locate root, and add it below the line
normaluseraddedviasudoers ALL = NOPASSWD: ALL