Posts

Showing posts with the label linux

Bulk renaming in Debian Linux

The simplest way to this is using a perl script called rename (debian linux only) I used only substitute strings, but it fully supports filenames which is really cool :) rename -v 's/oldString/newString/' *.htm Two sources for this: http://tips.webdesign10.com/how-to-bulk-rename-files-in-linux-in-the-terminal http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

X forwarding: Took me long for this discovery :)

VNC works usually pretty well to control PCs remotely. However, sometimes you only want to run just one program from the remote PC (or 64-core server), like matlab. Better option than VNC is definitely X forwarding. ssh -l username -X -v servername Once you login, simply just run the command for your program, and it will be open like a regular program :) More details on: http://www.vanemery.com/Linux/XoverSSH/X-over-SSH2.html There is also a possibility to do the same in windows using putty and Xwin32: http://www.math.umn.edu/systems_guide/putty_xwin32.html edit: In order to enable the X forwarding on your own machine, do the following (ubuntu 11.10) 1) Install openssh-server “sudo apt-get install openssh-server” 2) Edit the file /etc/ssh/ssh_config. Find/uncomment/modify these lines: ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes 3) Edit /etc/ssh/sshd_config. Find/uncomment/modify these lines: X11Forwarding yes 4) Restart your SSH server. Earlier, yo...

Raising Elephants Is So Utterly Boring

Taken from http://en.wikipedia.org/wiki/Magic_SysRq_key "Raising Elephants Is So Utterly Boring" is a mnemonic device for remembering a keystroke sequence that should be used as an alternative to hitting the power button if a Linux system should ever freeze and need to be rebooted. Alt + SysRq + R – takes the keyboard out of raw mode. Alt + SysRq + E – terminates all processes (except init). Alt + SysRq + I – kills all processes (except init). Alt + SysRq + S – synchronizes the disk. Alt + SysRq + U – remounts all filesystems read-only. Alt + SysRq + B – reboots the machine. Or it can be remembered as "BUSIER" in reverse. "Raising Skinny Elephants Is Utterly Boring" is an alternative mnemonic for the same series of keystrokes, though changing the position of the disk synchronization to before terminating and killing all processes. Regardless of which of the above hotkey sequences are chosen, they should be entered in slow succession, giving the ...

starting program from terminal in background

So, if you want to start the program and to use terminal afterwards, you just need to put "&" character at the end of the line so, for example, if you just want to call skype, then you write skype& It is simple thing, but sometimes one just forget this as a option :)

RPMs

This can be useful for those who had problems installing programs in openSUSE 10.2 (in my case, YasT is somehow crashing very often). To install rpm package: rpm -ivh packagename To upgrade the package: rpm -Uvh packagename To remove the package: rpm -e packagename If you not sure that your package is installed, there is a way to see it: rpm -qa packagename There can be problems to remember full name of the package since it is having all those version numbers etc.etc. so instead of writing out whole name, you can do next command: rpm -qa | grep SomeKeywordOfWantedPackage Cheers!

How to merge multiple pdf files into one

Linux command: gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH *.pdf

how to install source programs in linux

How often does it happen to you to download a new program which happen not to be any kind of debian package or something similar that you just need to use option install. Beforehand, look for README text which will probably tell you how to install the program Often for those, source code applications there are couple of steps to do in order to install them. 1. open terminal window (I use yakuake, in which u can open terminal just by pressing F12) 2. go to directory of your new, just downloaded application 3. run ./configure command - it looks if your system is ready to install application. It is checking for packages it needs to get its installed (newly downloaded application) 4. Look for comments at the end. If there is some comment like, error: 'libxyz' is not found, than you have to look for package that contains this library. I use adept-manager to search for those, and google if I fail to find it there. 5. when you finally install all packages needed, you proceed...

Yakuake

very cool console which starts when u press F12. alt-f2 and then write yakuake

Download a list of files (list of their links)

If you have list of files you need to download, there is a way to do that automatically. so, assuming every line is starting with http:... in any kind of text editor you replace option to replace every "http" with "wget -c -t5 -l1 http". Then Save the list-file as a download.sh. When you do that, then go to terminal/console window, type chmod 777 download.sh and then ./download.sh It then downloads everything from the list into current folder.

HTTPS website download

linux command wget -r --http-user=USERNAME --http-password=PASSWORD https://www.SOMEPAGE.com A lot of download managers and windows freeware website downloaders claim that they can download from https website, but somehow they always fail to login to page.