One of my clients, whom I act as a trainer and an admin, had an issue recently regarding the sftp. He created a vps (Lxlabs' HyperVM) named testvm with vpsid 120. The main hardware node IP be 192.168.0.1 . And the VPS IP be 192.168.0.101. He was trying to sftp testvm@192.168.0.1.
sftp testvm@192.168.0.1 was failing giving the message "Received message too long 1534226287" ;
It was a bit confusing for me, since it was a VPS and the shell assigned was /usr/bin/lxopenvz and I was not sure of the proper rc file it reads before switching the control to the vps. All I know was the shell is not verifying whether the $TERM is dump or not. And 1534226287 was translated to [roo (Decimal --> HEX --> ASCII)
So it was PS1 which is polluting the sftp stream. Spent 1 hour or so figuring out how to make it check the value of $TERM. And it was then I thought of trying the sftp root@192.168.0.101 (the VPS IP) and that worked. haha..
Client only needed to sftp to the VPS. He was not specific about sftping to root@VPS_IP or testvm@HN_IP. Spent one hour for just because of my absent mindedness. I should be more smart :-P
Friday, May 02, 2008
SFTP and the Received message too long 1534226287 in a VPS
Posted by
HJKL a.k.a h2l
at
10:46 PM
0
comments
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.
Posted by
HJKL a.k.a h2l
at
7:45 AM
0
comments
Labels: Cyber Quiz, CyberQuiz, IT Quiz, Technical Quiz
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.jpgworked 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..
Posted by
HJKL a.k.a h2l
at
10:57 AM
0
comments
Labels: debugfs, Linux, linux file deletion, openvz, rm, unlink, vzquota
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.
Posted by
HJKL a.k.a h2l
at
3:39 AM
0
comments
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
- What is Google's open operating system for mobile phones called ?
Answer - Which telecom major is the biggest stakeholder in Symbian Ltd?
Answer
- What is 'zoo' in context of security ?
Answer
- Nigel Clifford is the CEO of .... ?
Answer
- Who has Peter Dengate Thrush replaced as the Chairman of ICANN ?
Answer
- What was founded in July 1990 by Mitch Kapor, John Gilmore, and John Perry Barlow ?
Answer
- The graphics Processing Unit used in Nintendo's Wii video fame console is called ... ?
Answer
- What in the context of Linux is "bash"
Answer
- The maximum packet length of IP, including the IP header is ........................ bytes
Answer
- What is 'Wardriving' ?
Answer
Posted by
HJKL a.k.a h2l
at
9:46 PM
0
comments
Labels: Cyber Quiz, Quiz, Technical Quiz
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!!
Posted by
HJKL a.k.a h2l
at
1:46 AM
0
comments
Labels: bash scripting, Linux, sed