Monday, January 21, 2008

CyberQuiz aka IT quiz

Quizzing again.. A few information on IT industry in quiz format.

What is Wikiality.com

It is an Internet Encyclopedia dedicated to the Honorable Professor Dr. Stephen T Colbert, D.F.A and his creation truthiness

With which cyber major has Mayo Clinic set up a collaborative research facility "The Medical Imaging Informatics Innovation Centre (MI3C)" to improve the quality of patient care ?

IBM

What is 'Stevenote' ?

The colloquial term used for the keynote speeches by Steve Jobs, generally given at Apple events

Name the former CTO of the One Laptop Per Child Foundation who has started a new company called Pixel Qi to commercialize the technology for low priced laptops for poor children


Mary Lou Jepsen

With whom is Google jointly developing televisions that display internet content such as photos and videos


Panasonic

Who developed Postscript in 1985


Adobe

What 'spider' term is used for "the use of a table or structured list of URLs for Web sites (or words that hyperlink to Web sites) in order to help locate them ?

Arachnotaxis

The BlackBerry Pearl 8100 won the first BlackBerry to do way with what ?

A trackwheel. It was replaced by a miniature trackball.

What does Wikipedia define as "the act of taking a task traditionally performed by an employee or contractor and outsourcing it to an undefined generally large group of people in the form if an open call"

Crowdsourcing

In the context off spam what is spinging

Pinging from a splog to make recipients think that content of interest has been updated though that may not be the case.

Thursday, January 17, 2008

Where all standard deletion fails...

Long time, since I updated the blog eh ? A good..a bit challenging one, till I remembered the command, debugfs.

Issue

Location : One of my clients' VPS.
Concern : One of his vps clients is not restarting properly. Stucks at initializing the vzquota. Error message when doing 'vzctl start 738' is below


Starting VE ...
Initializing quota ...
vzquota : (error) quota check : lstat `photos.friendster.comphotos6968532886961_494183449s.jpg': No such file or directory
vzquota init failed [1]


Diagnosis

I couldn't find any files with the name photos.friendster.comphotos6968532886961_494183449s.jpg inside the vps, or when looking at /vz/private/738. Then did a

find . -name "*494183449s.jpg" inside the /vz/private/738. It returned me location as ./.trash/lsm/photos.friendster.comphotos6968532886961_494183449s.jpg

/me so happy. Ran
rm -f ./.trash/lsm/photos.friendster.comphotos6968532886961_494183449s.jpg
worked fine. But the problem persisted . Reason was though it didnt give any errors, it actually didnt delete the file. Ran a ls -l inside the directory lsm which showed output where it was question marks everywhere except for the name. AFAIK, name of a file is also stored in the directory info in the FS.

[root@vpsit lsm]# ls -l
total 0
?--------- ? ? ? ? ? photos.friendster.comphotos6968532886961_494183449s.jpg


So how can I fix this and make the vps start ? "rm -f filename" was not working.. neither a bigger command, "find . -exec rm -rf {} \;" nor even rm -rf /.trash or rm -rf /.trash/lsm. The directory delete was not working, since it was not empty. Tried unlink also.

[root@vpsit lsm]# find . -exec rm -f {} \;
rm: cannot remove `.' or `..'
find: ./photos.friendster.comphotos6968532886961_494183449s.jpg: No such file or directory


Then tried to turn off quota for vps ..so executed the vzquota off command and got the o/p as below

vzquota off 738
vzquota : (error) Can't open quota file for id 738, maybe you need to reinitialize quota: No such file or directory


So didnt want to initialize the quota by command, since it wont work for sure, just as in case when it starts the vps.

Temporary fix: turn off disk_quota parameter in /etc/sysconfig/vz and started the vps. Turned on the parameter later.

Permanent fix: you can't use fsck to fix this, on a live server. Not when you have to run the fsck in / itself. So fsck was not an option here. So next choice went to debugfs

here is what I did with debugfs

debugfs -w /dev/hda1
cd /vz/private/738/.trash/
unlink lsm


gone..and the issue is fixed. I dont see a proper solution anywhere in web for this ???? question marked cases of file deletion and hence this post.

I am tired of freelancing. Need to find some salaried job..Till next time..cya..

Monday, December 10, 2007

hypervm errors. Zend error

Failed loading /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so: /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied

Okay that was the message which I got during the hypervm stop. And the solution..

Simplest solution was to disable selinux. But proper solution can be using chcon to change the context

chcon -t texrel_shlib_t /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so
chcon "user_u:object_r:httpd_sys_content_t" /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so

should fix it.. I havent confirmed but hopefully proper solution will work.

Tuesday, December 04, 2007

Technical Quiz a.k.a Cyber Quiz

I am hereby starting a series of Quizing sessions to test yours and improving my knowledge, which I left updating since the last 3 years. These quizzes are not compiled by me, instead took from various sources, online and print. At a time the number of questions, wont exceed a max of 20.

So there you go, hovering the mouse over the Answer will give you the answers

  1. What is Google's open operating system for mobile phones called ?


    Answer

  2. Which telecom major is the biggest stakeholder in Symbian Ltd?

    Answer

  3. What is 'zoo' in context of security ?

    Answer

  4. Nigel Clifford is the CEO of .... ?

    Answer

  5. Who has Peter Dengate Thrush replaced as the Chairman of ICANN ?

    Answer

  6. What was founded in July 1990 by Mitch Kapor, John Gilmore, and John Perry Barlow ?

    Answer

  7. The graphics Processing Unit used in Nintendo's Wii video fame console is called ... ?

    Answer

  8. What in the context of Linux is "bash"

    Answer

  9. The maximum packet length of IP, including the IP header is ........................ bytes

    Answer

  10. What is 'Wardriving' ?

    Answer

Sunday, November 25, 2007

Multiline search and replace using sed

I had to code in to remove a host entry from hosts.cfg file of nagios. Here is a bit of superb code to do so..

sed '/#/{:a;N;/\}/!ba;/212.217.202.112/s/#.*\}//;}' hosts.cfg

That will remove the entire block starting with "# '212.217.202.112' host definition" and ending in "}"

Obfuscated code eh ? Not so..learn about registers in sed!!

Sunday, May 20, 2007

How to remove the mails from exim mail queue based on certain keywords ( cPanel specific )

How to remove the mails from exim mail queue based on certain keywords, especially in a cPanel. Below command will help in that and is for cPanel server. Matter of seconds for a seasoned admin, but posting so that I can copy and paste in future.

find /var/spool/exim/input -type f | xargs grep -l 'search_keywords' | xargs rm -frv