Interactive Programs
Emacs
Indent everything | M-x indent-region |
Forward search | C-s |
Backward search | C-r |
Repeat old searches | C-s M-pC-s M-n |
Regexp search | C-M-s |
Search word under the cursor (beginning at the cursor position) | C-s C-w |
Show only lines which match your regular expression | M-x occur RET fooM-x list-matching-lines RET foo |
Removes lines which matches regular expressions | M-x flush-lines |
Removes lines which does not match regular expression | M-x keep-lines |
Counts the number of occurrences for the given expression | M-x count-matches RET foo |
Execute grep and get output | M-x grep RET grep -e root /etc/passwd |
Search and replace | M-% |
Set mark | C-SPACE |
Mark paragraph | M-h |
Mark whole buffer | C-x h |
Cut region | C-w |
Copy region | ESC-w |
Insert region | C-y |
Split Window | C-x 2 |
Split Window side by side | C-x 3 |
Jump to an other part of the window | C-x o |
Unsplit Window | C-x 1 |
New Window | C-x 5 2 |
Close Window | C-x 5 0 |
Close Buffer | C-x k RET |
Switch to another buffer | C-x b RET |
Insert a spoiler (^L): | C-q C-l |
Macro Start | C-x ( |
Macro Stop | C-x ) |
Macro Execute | C-x e |
Edit last macro | C-x C-k |
Replaces newlines | M-q |
Make current word upper case | M-u |
Make current word lower case | M-l |
Compare two files, buffers or directories | M-x ediffM-x ediff-buffersM-x ediff-directories |
Emacs file manager | M-x dired |
The last 4 Words before the current cursor position are automatically inserted whenever you type foo | C-u 4 C-x a + RET fooM-x list-abbrevsM-x edit-abbrevsM-x write-abbrev-file RET ~/.abbrev_defsM-x abbrev-mode |
Search and Replace and line breaks
You can use this
to insert a line break with search and replace.
Select Columns, Copy and Past columns
In emacs you can not only select rows for copy and paste but also columns. In order to achieve this, just move the cursor to the top left position of your column (in this example we assume it should start at the letter A). Now select CTRL-SPACE to start the selection.
xx xx xx
xx xB xx
xx xx xx
Afterwards, move the cursor to the lower right corner of your column. (We assume this will be at the letter B). Now you can issue
The column disapears
xx xx
xx xx
xx xx xx
You can insert it again with the command
Open remote files and directories
Change to passive mode
First row in file helps emacs to load mode
There are some special lines you can add as the first row of a file to trigger a mode in emacs SQL
-- For the benefit of emacs users -*- mode: sql; sql-product: ansi; -*-
Highlight parenthesis
Show where the current parenthesis opens and closes
Show column of cursor
Show the cursor position in current row
Emacs Links
VI
Command Line
Restore files | vi -r |
Modes
Command mode | ESC |
Insert mode | i |
Append after cursor mode | a |
Append after linebreak mode | A |
Replace one character | r |
Replace mode | R |
Files
Open file | :e |
Reload file | :e! |
Open file, jump to the end of the file | :e + |
Open file, jump to line z | :e +z |
Show filename + linenumber | :f |
Next file | :n |
Save file | :w (:w!) |
Quit | :q (:q!) |
Save + Quit | :wq (ZZ) |
Navigation
Move one position to the left, right, up, down | h l k j |
Move one page nach up | CTRL f |
Move one page down | CTRL b |
Move to the beginning of the file | 0 |
Move to the end of the file | $ |
Move to line z | :z NR |
Move to the beginning of the line | ^ |
Move to the end of the line | $ |
Edit
Delete everything from here to the end of the line | D |
Delete this line | dd |
Delete this character | x (dl) |
Copy this line | y |
Copy the next n lines | nyy |
Paste after this line | p |
Paste before this line | P |
Undo | u |
Undo this line | U |
Search, Replace
Search | / |
Search backwards | ? |
Continue search | n |
Continue search but backwards | N |
Replace the next alt with neu | :s/alt/neu/ |
Replace in this line all alt with neu | :s/alt/neu/g |
Replace from line anfang till line ende in each line the first alt with neu(use $ for the last line) | :[anfang,ende]s/alt/neu/ |
Example: | :3,5s/Fogel/Vogel/ |
General
Show user settings | :set |
Show all settings | :set all |
Repeat command | . |
screen
Start a program with screen | screen prg |
Send the program to the background | C-a C-d |
Restore the program | screen -r PID |
blender
Object scale (x,y,z direction) | s, s x, s y, s z |
Object rotate (x,y,z direction) | r, r x, r y, r z |
Object move (x,y,z direction) | g, g x, g y, g z |
Edit / objekt Mode | TAB |
Duplicate objekt | SHIFT d |
Join objekts | CTRL J |
Stow
cd /usr/local/src/
tar xzf quelle.tgz
cd quellpaket
./configure
make
make install prefix=/usr/local/stow/paket
cd /usr/local/stow
stow -n paket
stow paket
Subversion (svn)
Revision / version control Subversion
Bochs
- .bochsrc
megs: 256
vgaromimage: /usr/share/vgabios/vgabios.bin
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=0, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9
# bximage -> X
ata0-master: type=disk, path="c.img", mode=flat, cylinders=X, heads=X, spt=X
#boot: disk
boot: cdrom
ips: 5000000
#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=/dev/stdout, dmatimer=600000
ne2k: ioaddr=0x240, irq=9, mac=12:34:56:78:90:01, ethmod=linux, ethdev=eth0
usb1: enabled=1, ioaddr=0xFF80, irq=10
GNU Plot
GNU Plot Links
GNUPLOT GNUPLOT - A Brief Manual and Tutorial
Function -> Diagram
gnuplot> splot sin(x*y/20)
gnuplot> plot x**2
gnuplot> set out "/tmp/my_output.ps"
gnuplot> set terminal postscript portrait enhanced color
Data -> Diagram
myfile.dat:
0 0 1
1 2 2
2 4 4
3 6 8
4 8 16
5 10 32
Time / Date Axis
gnuplot> set timefmt "%Y%j"
gnuplot> set format x "%Y_%m"
Even More GNU Plot Commands
set yrange [0:60]
set yrange [0:*]
set xrange [-1.5:1.5]
set xlabel "Foo"
set format y '%g MB/s'
set xtics ('foo' 1, '2 bar' 2)
set mytics 2
set grid
set style fill pattern border
plot "myfile.dat" using 1:2 title "foo" with boxes, "gp" using 1:3 title "bar" with boxes
set terminal png size 800 600
set output "/tmp/my_output.png"
replot
cdrdao
toc Datei
Audio-Tracks
Without leading break |
NO COPY
FILE "01.wav" 00:00:00
With a 10 second leading break |
NO COPY
SILENCE 00:10:00
START
FILE "01.wav" 00:00:00
Only the part from 3 minutes 5 seconds to 3 minutes 35 seconds |
NO COPY
FILE "01.wav" 03:05:00 00:30:00
Part from 1 minute to 1 minute 30 seconds from file 01.wav and from file 02.wav everything from 2 minutes. After 1 minute and 30 seconds the index is increased |
FILE "01.wav" 01:00:00 00:30:00
SILENCE 00:02:00
FILE "02.wav" 02:00:00
INDEX 01:30:00
Take all wav files beneath the current folder and create a toc file for an audio CD without breaks
echo CD_DA;
find . -name "*.wav" | while read line;
do
echo "TRACK AUDIO";
echo "NO COPY";
echo "FILE "$line" 00:00:00";
echo;
done
} > myaudiocd.toc
Ethereal
Filter
!(ip.addr eq 10.0.0.3)