24/01/2006
SSH Escape Characters
I am sure a LOT of people reading this blog use ssh in their everyday work/life/etc. I am not sure though how many of you have heard of ssh EscapeChar unless you’ve read the ssh_config file (and even if you have done so, did you pay any attention to it ?). So what can you do with EscapeChar ? not a lot, but certainly very usefull stuff.
My most frequent problem with ssh is sessions that sometimes they don’t end as they are supposed to. You logout from the remote system and you never get a prompt on yours because something has stuck somewhere, sometime. Wouldn’t you wish there was an escape sequence to end this suffering, like telnet’s ctrl+] ? Well there is! Just edit your client’s ssh config file (/etc/ssh/ssh_config for gentoo) and add to the end:
EscapeChar ~
now try ssh to a host and when you are in, try this: ~?
. You will see a list of helpfull options. The solution to the previous described problem of stale connections is ~.
Dummy-safe: So to get it to escape press[alt gr] + [~] two times and then [.]
If that doesn’t work, try pushing Enter before “~”.
What’s also very helpfull is the ability to start/end portforwarding during an active ssh session! Say you have opened an ssh connection to a host and you now have to portforward a port, what do you do ? New ssh connection with -L/-R options ? nope! You just press ~C
and do what you want from the ssh “command shell”.
enjoy!
Filed by kargig at 13:16 under Encryption,Internet,Linux,Networking
Tags: connection, escape, escape chars, Linux, ssh, tilde
8 Comments | 114,160 views
mplayer headaches with alsa solved (hopefully)
Lately I had a problem with my gentoo. I could not get HR video files with mplayer to work smoothly. In order to test what was going on I downloaded ExperienceMP10_1280x720_8mbps.wmv from http://www.wmvhd.com/ .
Whenever I tried playing it the result was choppy video and sound. Mplayer gave me a banner that said: Your system is too SLOW to play this!
. Hey my pc is based on an Athlon XP 2800+! It’s NOT slow! So the problem was surely not cpu power. I tried playing around with mplayers’ -vo options. In fact -vo gl gave me some more fps…but it was still unwatchable. Then it was time to play aroung with -ao options. I tried them all… alsa, oss, sdl, alsa:mmap, alsa:noblock, nothing…each one was worse than the other. Then I tried -ao null. And what a surprise…when audio was disabled video stopped being choppy. It was playing just fine! So the problem was surely audio related. I have the latest alsa installed from portage and other programs play really ok with it, so I thought maybe there a newer mplayer version could do the trick. I first checked on gentoo forums where I found this very helpfull thread about multimedia overlay in portage. I installed it in my portage overlay dir, unmerged mplayer from normal portage tree and emerged mplayer-cvs from the new overlay. After some compile time it was finally ready. The results ? amazing 🙂
It works with every video format I’ve tried! No sloppy playback, no lagging sound, just perfect.
I hate using custom solutions and ebuilds to cure my problems, but at least I have not compiled anything by “./configure;make;make install” yet. Long live the gentoo community. Thnx a lot to all 🙂
Filed by kargig at 00:09 under Linux
No Comments | 7,405 views
17/01/2006
howto use utorrent rss feeds with bitme and bitmetv
Latest utorrent has the ability to fetch rss feeds from torrent sites so you can download automatically (or automagically if you prefer :P) your favorite content without user interaction.
It’s kinda tricky though to enable it for bitme and bitmetv. As an example I will use the Desperate Houswives rss feed. If you go to bitmetv’s Links page and select RSS feed (Choose Category Feed) you will see a full listing of various categories. Pick Desperate Housewives and then “Download Link” from Feed Type and “Standard” from Login Type. It should give you a url like this:
http://www.bitmetv.org/rss.php?feed=dl&cat=75&passkey=YOUR-PASSKEY
In order to enter that feed inside utorrent’s rss parser you need to find out your UID and PASS from bitme or bitmetv cookies. You can learn how to do that for each browser here: utorrent faq on “Torrent_support_RSS_feeds”
Let’s say you got that UID and PASS. Now press ctrl+r inside utorrent and paste the following url REPLACING your own YOUR-PASSKEY, YOUR-UID, and YOUR-PASS variables!
DH|http://www.bitmetv.org/rss.php?feed=dl&cat=75&passkey=YOUR-PASSKEY:COOKIE:uid=YOUR-UID;pass=YOUR-PASS
If you were able to do that now go to Releases tab. Pick the one you would like to download from now on…let’s say “Desperate Housewives HR”, right click and “Add to Favorites”. Now you should be at Favorites tab. Leave the “Filter” as utorrent created it for you and just pick a download location (in “Save in”) for the new torrents. I have chosen the same location where my other torrents go.
If you only want specific episodes to download, just click on the proper checkbox in “Favorites” tab and enter something like “2×12”.If you want all episodes from a specific season just do it like this: “2×1-25”.
You can now go to bed and let the torrents come to your hard disk automatically. Happy downloading.
P.S. I have nothing to do with any of the sites mentioned. Whatever you do is at your own risk. You might get to jail for downloading copyrighted material…so you better use utorrent to download your favorite and latest linux ISOs 🙂
Filed by kargig at 22:00 under Internet
8 Comments | 20,258 views
15/01/2006
HOWTO remove spikes from RRD graphs
If you happen to use rrdtool to create graphs to monitor equipment you might have come upon some “spikes” in your graphs. These are perfectly normal and happend due to machines that have rebooted and have reset their counters or other anomalies that might occur.
There is a script called removespikes.pl made specially to fix these cases. You can either find the tool here: http://oss.oetiker.ch/rrdtool/pub/contrib/removespikes.tar.gz or get it from my blog removespikes.pl.gz
Extract it, and then type something in the command line like the following:
for i in /location/of/rrds/*; do /full/path/to/removespikes.pl $i; done;
You should probably see some messages like these:
Chopping peak at <!– 2005-10-25 17:00:00 EEST / 1130248800 –>
Chopping peak at <!– 2005-10-25 19:00:00 EEST / 1130256000 –>
That’s all…enjoy your graphs.
Filed by kargig at 17:41 under Linux,Networking
10 Comments | 20,093 views
Lightbox JS addon
I’ve ‘re-found’ (Charmed[] had originally showed it to me, but I couldn’t find afterwards) a really nice addon for my blog. It’s called Lightbox JS and it just makes image viewing a bit better.
Just click on the image below from a previous post about yahoo’s expired SSL certificate to see what it does
Filed by kargig at 03:28 under General
No Comments | 2,880 views
14/01/2006
fixing gentoo’s php mess
OK…there’s one thing gentoo is REALLY messy. And that’s php support. In fact it’s so crappy at the current time, that it’s almost imposible to use PEAR without a ton of user “hacks”, unless you can find someone else to do it for you. There are lots of packages still depending on the old dev-php scheme…and some newer depending on the dev-php4 or dev-php5. So when one tries to install dev-lang/php with some pear packages he might need, a pear package might request installing dev-php/php too. So you end up with 2 php packages, php5 and php4! Anyway…if you really want to setup the latest php support in gentoo you should do it with gentoo-php-overlay. I got bored of trying to fix gentoo’s php packages to depend on dev-lang/php and not dev-php/php using regular expressions to edit the ebuilds and re-digest them on my local PORTDIR_OVERLAY.
Someone should really fix gentoo’s php support SOON.
Filed by kargig at 16:03 under Linux
No Comments | 3,130 views
13/01/2006
Who said Windows is easier than Linux ??
I’ve heard a lot of times that windows is a lot easier than Linux, that you cannot easily install programs on linux and so on and so on…so here’s my little story from yesterday.
A friend came at home today and he had to finish a project for today. His project involved some math problem solving and unfortunately he had chosen Microsoft Office and MathType to do it. So I rebooted my PC from Linux to Windows XP and that’s how about the problems begin. Upon booting to windows various popups started appearing that programs needed update. The anti-virus (I would have nearly forgotten that word while using Linux, unless someone very very close to me ( 🙂 ) kept asking over and over about Panda Antivirus, heh), Windows itself, acrobat reader and so on…OK, maybe that was my mistake because I had not booted into windows since last September when I needed it for a project of my own. Then I wanted to install Microsoft Office, Microsoft Word to be exact. I found an old CD of mine with Microsoft Office XP Pro and put it inside the tray…I opened the cdrom drive with Windows explorer and what I saw was…shocking. At least 10 to 15 different executables with weird names and some .msi files. In fact…here’s what the cd contents look like!
athlios:/mnt/cdrom%ls -1
access.msi
autorun.inf
excel.msi
files
fp.msi
instmsi.exe
instmsiw.exe
msde2000
office1.cab
ork
outlook.msi
owc10.msi
ppt.msi
pro.msi
proplus.msi
readme.htm
setupacc.exe
setupexl.exe
setupfpg.exe
setupolk.exe
setuppls.exe
setupppt.exe
setuppro.exe
setupstd.exe
setupwrd.exe
sharept
std.msi
word.msi
athlios:/mnt/cdrom%ls -1 | wc -l
28
athlios:/mnt/cdrom%ls -1 | grep .exe | wc -l
11
athlios:/mnt/cdrom%ls -1 | grep .msi | wc -l
12
So there’s 28 files in the root cdrom dir, 11 of these are .exe and 12 are .msi. As far as I can remember .msi files can be “installed” as well. And…surprise surprise!! there’s no “setup.exe” inside…but a bunch of various setup???.exe. What do we do now ? Oh … there’s autorun.inf…that should tell us.
athlios:/mnt/cdrom%cat autorun.inf
[autorun]
OPEN=setuppls.exe /AUTORUN
ICON=setuppls.exe,1
shell\configure=&Configure...
shell\configure\command=setuppls.exe
shell\install=&Install...
shell\install\command=setuppls.exe
It’s obvious right ? I need to run setuppls.exe!
And now…time for some problems!
Everytime I clicked on setuppls.exe I got this beautiful error message:
The Windows Installer Service could not be accessed. You may be running in Safe mode or Windows Installer may not be correctly installed.
I tried the other setup???.exe files too…same error again…
What is Windows Installer Service ? I am surely NOT running in safe mode…and how could I have incorrectly installed something that I don’t know what it is ?
After some trial and error and some googling I came up to the conclusion that I had to run “instmsiw.exe” first and then the infamous setuppls.exe.
And then …wow! the installation begun!
Is that what windows people call “click and play” ? Ease of Use ? User Friendliness? GIVE ME A BREAK!!!
Do you know how HARD was to install OpenOffice (that has built-in mathematics support, so you don’t need MathType crap) in Gentoo Linux ?
emerge openoffice-bin
And if it even wanted to install something like “Linux Installer Service” it would have done it without any user intervention because it knows what a dependancy is.
Now…Who is user friendly ?
Every time I have to boot into windows it reminds me how happy I am with Linux 🙂 Thanks to all the redmond guys…you ROCK!
Filed by kargig at 03:29 under Linux
1 Comment | 4,235 views
11/01/2006
Some links about shells
A small introduction to shells by Adam Spiers.
And if you wonder how that smiley “:) fishsticks$
” on the prompt of user mendel appears:
Just edit your bashrc, add this line somewhere:
smiley () { if [ $? == 0 ]; then echo ':)';else echo ':(';fi; }
and then change your PS1 line to include this:
\$(smiley)
in the beggining…so that it looks somewhat like this:
PS1="\$(smiley) \[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] "
It’s somewhat funny…
Filed by kargig at 12:57 under General,Linux
No Comments | 2,754 views
06/01/2006
Setting up the sound on the Sony Vaio PCG-GRT896HP
Well, we tried to set up the sound yesterday, after the last post. It was fairly easy to do since we decided to start from scratch. The kernel was recompiled throwing everything in the sound category out, except from sound card support. Then we got alsa-lib-1.0.10, alsa-driver-1.0.10 and alsa-utils-1.0.10 and installed the packages in this order. We ran alsaconf and it was all set!
Filed by dkilim at 13:12 under Linux
No Comments | 3,537 views
Installing Slackware 10.1 on a Sony Vaio PCG-GRT896HP with no CD or Floppy drive.
I just got a second hand Sony Vaio PCG-GRT896HP and decided to get rid of XP installed there and make a fresh Slackware 10.1 installation. The laptop is heavy-duty having a Pentium 4 processor at 2.8GHz, 512Mb RAM, 60Gb of hard disk space, 16″ screen, lots of ports and 802.11b/g support making it perfect to use for computational work at the university and at home. The problem: the laptop’s combo CD/DVD burner was heavily used and out of the game. I had available an external USB combo CD/DVD burner but the BIOS did not support booting from USB. So the decision was to make a network installation but while searching for the relative info we stumbled on this:
http://marc.herbert.free.fr/linux/win2linstall.html
It just looked too good for us not to try! The target was to set the XP machine to boot into GRUB and start the Slackware installer hoping that it would then mount the external USB drive to do the installation. Installing GRUB was like a walk in the park in our case. The package GRUB_for_DOS provides the two needed files grldr and menu.lst. The file grldr was copied to C:\ and then the following line was appended to boot.ini:
C:\grldr=”Start GRUB”
To make boot.ini editable, the command attrib c:\BOOT.INI -s -h -r was issued from the command line and after the addition the file was reinstated with attrib c:\BOOT.INI +s +h +r.Then the whole /boot directory from the GRUB_for_DOS package was copied to C:\ and within the C:\boot directory the bare.i kernel and the initrd.img installer image were copied. Since we were only interested about booting to the installer we did not copy any packages as these would (hopefully) be installed from the USB device. The C:\boot\grub\menu.lst was edited in order to contain these lines:
title My Linux installer of choice
kernel (hd0,0)/boot/bzImage
initrd (hd0,0)/boot/initrd.img
Edit: we copied menu.lst to C:\ to avoid any version-specific problems of GRUB_for_DOS
We did not pass any extra parameters to the kernel but at some other cases this would be very helpful. So that was the GRUB installation. Reboot, fingers crossed and it worked! At the XP boot screen we had a new menu item pointing to GRUB which in turn loaded the copied kernel. Doing this procedure was very important because there was no way that the machine would be rendered unbootable leading us to bigger adventures. If there was a mistake in the GRUB configuration we could boot in XP and make corrections. Once we reached the system shell we could start the installation scripts. First we partitioned the hard drive:
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda1 ext2 9.7G 4.7G 4.6G 51% /
/dev/hda2 reiserfs 25G 34M 25G 1% /disk1
/dev/hda3 reiserfs 23G 34M 23G 1% /disk2
The external USB CD/DVD combo drive was mounted under /dev/sr0 so we made a link pointing to /dev/cdrom and mounted the first Slackware 10.1 installation disk. Since we had booted from the kernel copied to the hard disk we ran setup and just selected /dev/cdrom as the source for the installation.
We proceeded with the installation of the packages from the first CD but we encountered a problem soon. When we were prompted to insert the second installation disc there was no way to unmount the disc. Many remedies to this were attempted including force unmount and even unplugging the drive from the laptop and from the power, taking the CD out and then trying to remount. All resulted in some strange bug (?) where the system somehow saw a different partition table where hda1 was full at that moment thus not allowing the installation of any more packages. Each time the installation script was halted and after that all seemed normal again except that we had to run setup from the beginning without rebooting of course. Then we decided to stop the installation when the first CD finishes and put the rest later on. So fingers crossed again and voila! The Sony Vaio booted for its first time in Slackware 10.1. The rest of the packages were easily installed using pkgtool.
This is the point where the debugging starts. First of all, Slackware 10.1 comes with Gnome along with the other window managers. In order to boot without annoying system errors in Gnome you must log as user and not root. Then we tested all the other window manageers which were found to be functioning except from KDE which freezed the system when it came to Initializing Peripherals. After exhaustive googling it seemed that the problem occurred because of arts. This was uninstalled and KDE would since start smoothly.
The sound-related problems though continued. Everytime a sound was played the system froze requiring hard rebooting. On top of that, disabling the sound system from the KDE Control Center revealed that when a video was played, the application (Xine, Gxine or Noatun) would crash after a few seconds. We decided to recompile the 2.4.29 kernel throwing anything that is not needed out, installing some features like ACPI and Firewire and look at the sound issues later. Using the new kernel, the video freezing bug was remedied but the sound was still freezing the system. On top of that, the ethernet card was not functioning. After a few trial and error attempts we figured out that this was caused because the new kernel enabled Sony Vaio Programmable I/O Control Device support. So this went out of the window and we got eth0 back.
The sole problem (for now of course!) is configuring the alsa drivers from the beginning in order to make the sound work. It is our next goal and then maybe a 2.6.x kernel wouldn’t be a bad idea (that’s for the ones who thought about it!).
Conclusions: there is NO system where you cannot install Linux one way or the other. Try doing the above with XP…
Many thanks to Marc Herbert for his great how-to on installing GRUB in XP.
Filed by dkilim at 02:40 under Linux
2 Comments | 5,702 views