With the shortcut alt+F2
in KDE you invoke the "run command" dialog (also accessible from the start menu if it's not hidden of course). It is a fast and easy way to launch an application if you know its command line name (which is mostly the same as its …
-
-
shell redirection of standard output and standard error to the same file
Consider a program
hello_and_error
that writes to both stdout and to stderr. To redirect both to stdout:hello_and_error 2>&1
If you want to redirect both to the same file
hello.txt
you can do in bash the following:hello_and_error &> hello.txt
If you …
-
Easy moving and resizing application windows on the Linux desktop (KDE, Gnome, IceWM, ...)
If you work in a Linux desktop environment/windows manager like KDE, Gnome, IceWM (and probably many others), you definitely should try the following mouse trick: click/drag while holding <alt> above a (not maximized) application window. Depending on the mouse button and the windows manager this should move or …
-
Using plain latex and pdflatex: conditional switching in your LaTeX document
Writing a LaTeX document that you want to feed to both plain
latex
andpdflatex
can be sometimes a conflicting task. If you want to embed graphics for example, latex needs EPS based graphics but pdflatex needs PDF based graphics. Other problems can occur if you want to use some … -
Customize the Gimp toolbox
The Gimp toolbox contains some buttons I never use. Because I don't like spilling screen estate, especially on my 1028x800 laptop screen, I wanted get rid of those unneeded buttons.
A first solution (available for Gimp 2.2 and later, I think) is editing the file
~/.gimp-2.2/toolrc
. Close … -
Python: pickling and dealing with "AttributeError: 'module' object has no attribute 'Thing'"
The
pickle
module of python is a very handy module if you want to store and retrieve your python data structures to and from a file. Using that module you don't need to waste your time on writing your own export and import functions any more.We will write a …
-
moving files to the (KDE) trash can from the command line
When you want get rid of some files, but fully deleting them is bit drastic, a trash can is an handy option. In a graphical environment the tools are there to do it (drag and drop, right mouse button on a file, etc.), but on the command line it is …
-
redirecting python's "print" statements to a file
Something I find annoying about writing a program/script that writes to text files is that you explicitly have to write the linefeeds (things like "\n", "\r", "\r\n" or std::endl). I remember Pascal having something like a
writeln()
function, which was very handy when I spend my time … -
Avoid duplicates in your bash history
Sometimes I need to repeat a command several times on the bash commandline. I don't mean a scenario where you could use a for or while loop, but take for example editing a script in an editor and periodically running it in a terminal. In that case my bash history …
-
Bash: about .bashrc, .bash_profile, .profile, /etc/profile, etc/bash.bashrc and others
Ever wondered about the difference between
~/.bashrc
,~/.bash_profile
,~/.profile
,/etc/profile
,/etc/bash.bashrc
(and maybe others) and what their purposes are? I do.Some interesting excerpts from the bash manpage:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the
--login
option …