понедельник, 18 апреля 2011 г.

TeX: Centering images

Place image in center of the paper with noindents.

\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\noindent\makebox[\textwidth]{%
\includegraphics[width=1.4\textwidth]{mypic}}
\end{figure}\end{document}

пятница, 1 апреля 2011 г.

Linux: fast cli password generator

Following command ll generate 8-digit password:
cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 8 | head -1

Bash: exit from shell without saving history

Just run:

kill -9 $$

Another variant:
unset SAVEFILE; unset HISTFILE;

Kernel: boot time parameters

With this command you can see boot time parameters of running kernel.

cat /proc/cmdline

Output ll be like this:

root=/dev/disk/by-uuid/e2d77d8c-52e2-4a21-881a-c5bae4645a1c ro vga=775

четверг, 31 марта 2011 г.

Wine: run app in virtual desktop

Example:

wine explorer /desktop=fallout,640x480 fallout2.exe

Urxvt: open url with 1 click

Add this to .Xdefaults
URxvt.perl-ext-common:  default,matcher URxvt.urlLauncher:  firefox URxvt.matcher.button:   1 URxvt.colorUL:      #86a2be