echo -ne "\033]2;My_term_name\007"
Split a pdf file or cut off one,two pages
pdftk original_50_pages_long_document.pdf cat 8-12 output what_I_wanted.pdf
Apply changes from one file (database) to another.
$ diff ldap_sorted.txt mysql_sorted.txt >master.diff
$ patch
patching file mysql_sorted.txt
Reversed (or previously applied) patch detected! Assume -R? [n] y
$ diff ldap_sorted.txt mysql_sorted.txt
$ (empty line indicates the two files are identical again)
Get rid of ^L character
For example using sed you can do something like this (by typing Ctrl-V and Ctrl-L):
Code:
sed 's/^L//' file
or by means of the octal code:
Code:
sed 's/\o14//' file
Watching network with tcpdump
# tcpdump -n #simplet monitor of network traffic
# tcpdump -nnv -A |grep ".80" #shows traffic on port 80
Which TCP ports are open on the BSD server
# netstat -nat | grep LISTEN |grep tcp\
Who is doing what on the server
$ w
Runing X remotely
on the server:
$ export DISPLAY 192.16.1.3:0.0
one the laptop:
$ xhost +192.16.1.1
on the server:
$ k3b
on the laptop:
The K3b gui appears
$ cat /home/petr/.config/caja/scripts/zmensi_pdf #!/bin/bash xterm -e /home/petr/.bin/zpdf $ cat /home/petr/.bin/zpdf echo "vybiram tyto soubory:" echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS" sleep 3 for i in $CAJA_SCRIPT_SELECTED_FILE_PATHS do echo "zmensuji $*" h=`echo "$i" |sed -e 's/\.pdf/\-ok\.pdf/g' ` gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dPDFSETTINGS=/ebook -sOutputFile="$h" "$i" echo "$i" je nyní zmenšen jako "$h" done sleep 10 $ cat /home/petr/.config/caja/scripts/zmensi_foto #!/bin/bash xterm -e /home/petr/.bin/zjpeg $ cat /home/petr/.bin/zjpeg #!/bin/bash echo "vybiram tyto soubory:" echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS" for i in $CAJA_SCRIPT_SELECTED_FILE_PATHS ; do if test -f $i then # zmensi a zapise do noveho souboru #convert -resize 800x600 $i # zmensi a prepise puvodni soubor mogrify -resize 1024x768 $i echo "zmensil jsem obrazek $i ." ; fi done sleep 10
- HOME
~~~~~~~~~~~~~~~
- OpenBSD
- NetBSD
- FreeBSD
- Linux
- Solaris
- Windows
~~~~~~~~~~~~~~~
- Git
- Ansible
- Atlassian
- Network tools
- Qemu
- Virtualbox
- Vim
- Tmux
- Mutt
- STar
~~~~~~~~~~~~~~~
- MySQL
- PostgreSQL
- Postfix
- OpenSSL
- tcpdump
- SSH
~~~~~~~~~~~~~~~
- Packet Filter
- IP Filter
~~~~~~~~~~~~~~~
- Bash
- web-dev
- Hacking
- LINUX DAYS