mount -t smbfs -o username=scott,password=tiger //skywalker/f$ /mnt/skywalker
sudo apt-get install smbfs smbclient
username=heinrich password=qwerty
/etc/fstab
erweitern
//nas/Public /mnt/nas/public cifs rw,credentials=/root/.nas_credentials,uid=1000,gid=100 0 0 //nas/heinrich /mnt/nas/heinrich cifs rw,credentials=/root/.nas_credentials,uid=1000,gid=100 0 0
id
#!/bin/sh dd if=/dev/cdrom of=/u/cdimage/cdcp_iso.img bs=2048 cdrecord -v -eject speed=8 dev=0,1,0 /u/cdimage/cdcp_iso.img
mount -o loop mycdimage.iso /mnt/xyz
#sudo su - hdparm -d1 /dev/hda dd if=/dev/hda1 bs=64k of=/dev/hda7
Beschreibung in c't 23/2003 Seite 134
Einstellungen in .gvimrc
set guifont=Lucida\ Console:h9 set ts=4 set lines=66 columns=130
cp abc.txt "xyz.txt.`date +%y%m%d-%H%M%S`"
snoop -d ce1 -V -o /tmp/snoop.out
Wireshark filters: http://www.thegeekstuff.com/2012/07/wireshark-filter/
tcp.dstport == 3003
ifconfig eth0 up
find / -perm +000
ssh -L localport:desthost:destport gatewaylogin@gateway
ssh-copy-id -i ~/.ssh/id_dsa.pub user@remote-system
Dateien publizieren:
rsync -urz -e "/bin/ssh -l sshuser" ~/web/staging rsyncuser@remotehost:/var/www/myweb/httpdocs
Option | Bedeutung |
---|---|
-e | ssh command |
-u | update remote file system with newer files on local filesystem |
-r | recurse subdirs |
-z | gzip transfered data |
Keyboard Shortcuts
Shortcut | Function |
---|---|
Alt-F1 | Start Menu |
Alt-F2 | Execute Command, Start Program |
Ctrl-Alt left/right/up/down | Switch Desktop Workspace |
~ + Shift | Move current window to workspace |
Strg-Alt-T | Start Terminal |
Alt-F10 | Maximize/Restore Window |
Alt-F9 | Minimize |
<Win>+E | Show/Switch Desktops (only w/ Compiz) |
Suche die Maven “target” folder und Subversion “.svn” überspringt
find \( \( -name target -o -name .svn \) -prune \) -or -type f -exec grep -l MY_SEARCH_PATTERN {} \;
Find files and tar them (using cpio)
cd res find -name strings.xml | cpio -ov --format=ustar > i18n.tar
# don't output subdirectories and output a grand total
du -csh /root/ /etc/ /home/
If you need to debug something under user which has /bin/false
as its shell, you can do it with su - user -s /bin/sh
# mkdir /ramdata # mount -t tmpfs -o size=16000M tmpfs /ramdata/
ts '[%Y-%m-%d %H:%M:%.S]'
fg
holt ihn wieder her, optional mit %njobs
listet Jobs aufkill %n
killt den Job
mypc$ ssh root@abc.com root# ~^Z mypc$ jobs mypc$ fg %1
set -o vi
Verhalten von vi auf der cmd-line
function simple-backup() { filename=/tmp/backup-`date +%y%m%d-%H%M%S`.tar.gz echo "creating $filename" tar cfz ${filename} . echo "moving file to S:/simple-backups" mv ${filename} /cygdrive/s/simple-backups/ }
Also see:
Was? | Befehl |
---|---|
Packages auflisten | dpkg –get-selections |
Dateien eines Package auflisten | dpkg -L pkgname |
Update Paketlisten | apt-get update |
Upgrade auf aktuelle Versionen | apt-get upgrade |
Paket downloaden und installieren | apt-get install pkgname |
Package löschen | apt-get remove pkgname |
Nicht gebrauchte Packages löschen | apt-get autoremove |
Paket neu konfigurieren | dpkg-reconfigure pkgname |
# enable apache web server with defaults (run-level 2,3,4,5) update-rc.d postfix defaults # specify priority and levels (stop with .) update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 . # disable a service (all run-levels) update-rc.d -f apache2 remove
Disable all mail-relating services on my server:
update-rc.d -f courier-imap remove update-rc.d -f courier-imap-ssl remove update-rc.d -f courier-pop-ssl remove update-rc.d -f courier-pop remove update-rc.d -f courier-authdaemon remove update-rc.d -f postfix remove update-rc.d -f saslauthd remove update-rc.d -f spamassassin remove update-rc.d -f policyd-weight remove update-rc.d -f amavis remove
sar | Collect, report, or save system activity information sar -u 5 600 gibt alle 5 Sekunden CPU-Usage aus (10 Minuten) |
time command | Time taken by program in user mode, in kernel mode, average memory usage by the program |