User:Ax/Befehle: Difference between revisions
No edit summary |
No edit summary |
||
(8 intermediate revisions by the same user not shown) | |||
Line 52: | Line 52: | ||
## Some notes: | ## Some notes: | ||
#<debianuser> [...] recently someone mentioned "asoundconf-gtk". | # <debianuser> [...] recently someone mentioned "asoundconf-gtk". | ||
lsof | grep [pcm|snd] | lsof | grep [pcm|snd] | ||
fuser -fv /dev/snd/* | fuser -fv /dev/snd/* | ||
Line 58: | Line 58: | ||
alsaplayer -i text .fluxbox/additionalapps/wmclockmon/stihl_ms2.wav | alsaplayer -i text .fluxbox/additionalapps/wmclockmon/stihl_ms2.wav | ||
pasuspender -- speaker-test -c2 -twav -l5 -Dplughw:1,0 | pasuspender -- speaker-test -c2 -twav -l5 -Dplughw:1,0 | ||
https://bitbucket.org/stativ/asoundconf/src/default/ | |||
https://github.com/i-rinat/apulse | https://github.com/i-rinat/apulse | ||
# <rrq> "qasconfig" is a good tool for reviewing the alsa configuration | |||
= badblocks = | |||
badblocks -vw /dev/sdd # write test, destroys data! | |||
badblocks -vn /dev/sdd # non-destructive read/write testing | |||
Line 117: | Line 123: | ||
= cmake = | = cmake = | ||
cmake --trace | |||
<D-HUND> james: can you tell me how to tell cmake to look at a specific path for a specific lib? | <D-HUND> james: can you tell me how to tell cmake to look at a specific path for a specific lib? | ||
<james> D-HUND: some -DLIBNAME_PREFIX=/foo/bar/ | <james> D-HUND: some -DLIBNAME_PREFIX=/foo/bar/ | ||
Line 150: | Line 158: | ||
# Danach mit kdenlive bearbeiten. | # Danach mit kdenlive bearbeiten. | ||
# Audiospur extrahieren | # Audiospur extrahieren: | ||
ffmpeg -i $inputfile.avi -vn -ac 2 -ar 44100 [-ab 320k] -f mp3 $name.mp3 | ffmpeg -i $inputfile.avi -vn -ac 2 -ar 44100 [-ab 320k] [-f mp3] $name.[mp3|wav] | ||
# -f mp3|etc. not required, usually, format detected from file name extension | |||
# Umwandeln (Video (-c[odec]:v)) | # Umwandeln (Video (-c[odec]:v)) | ||
Line 243: | Line 252: | ||
Tags aktivieren wie Branchen: | Tags aktivieren wie Branchen: | ||
git checkout v2.0.0 | git checkout v2.0.0 | ||
Parent einer Branh herausfinden: | |||
git parent # Voraussetzung: ein parent alias muß in ~./.gitconfig angelegt sein: | |||
# [alias] | |||
# parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #" | |||
Line 285: | Line 300: | ||
git checkout -f | git checkout -f | ||
: ''-f'' When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes, auch wenn das gesamte Arbeitsverzeichnis, ausgenommen der .git Ordner, gelöscht wurde. | : ''-f'' When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes, auch wenn das gesamte Arbeitsverzeichnis, ausgenommen der .git-Ordner, gelöscht wurde. | ||
<br/> | |||
# DIFF / APPLY | |||
git checkout master.local; git diff master [pfad/datei(en)] > datei.diff | git checkout master.local; git diff master [pfad/datei(en)] > datei.diff | ||
git apply --index [-R] datei.diff; git commit | git apply --index [-R] datei.diff; git commit | ||
Line 301: | Line 318: | ||
git reset --hard HEAD~1 | git reset --hard HEAD~1 | ||
: go back one commit | : go back one commit | ||
https://git-scm.com/docs/git-bisect | |||
Line 410: | Line 429: | ||
= lshw = | = lshw = | ||
-C multimedia | -C multimedia | ||
= make = | |||
VERBOSE=1 make -j $(nproc) | |||
Line 444: | Line 467: | ||
mplayer -identify -frames 0 # entspricht -msglevel identify=4 -frames 0 | mplayer -identify -frames 0 # entspricht -msglevel identify=4 -frames 0 | ||
mplayer cdda:// /dev/sr0 | mplayer -dvd-device /dev/sr0 dvd://1 # DVD, Titel 1 | ||
mplayer cdda:// /dev/sr0 # Audio-CD | |||
# Videospur aus Datei extrahieren: | # Videospur aus Datei extrahieren: | ||
Line 467: | Line 491: | ||
mencoder -oac lavc -ovc lavc vcodec=msmpeg4:vbitrate=1800:vhq:keyint=250 -o $file | mencoder -oac lavc -ovc lavc vcodec=msmpeg4:vbitrate=1800:vhq:keyint=250 -o $file | ||
= ntp = | |||
ntpdate-debian | |||
= qemu = | = qemu = | ||
https://qemu.weilnetz.de/doc/ | https://qemu.weilnetz.de/doc/5.2/ <BR> | ||
Mouse-grab-keys (MGK), default: Ctrl-Alt <BR> | Mouse-grab-keys (MGK), default: Ctrl-Alt <BR> | ||
Switch to monitor: MGK-Shift-2 <BR> | Switch to monitor: MGK-Shift-2 <BR> | ||
Switch back to guest: MGK-Shift-1 <BR> | Switch back to guest: MGK-Shift-1 <BR> | ||
https://en.wikibooks.org/wiki/QEMU/Monitor | https://en.wikibooks.org/wiki/QEMU/Monitor <BR> | ||
aqemu | |||
qemu 3.1 (Beowulf) | |||
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4096 \ | |||
-netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=emu,hostfwd=tcp::55522-:22 \ | |||
-device e1000,netdev=mynet0 -soundhw es1370 -vga virtio \ | |||
-hda /pub/qemu/Devuan_ASCII_Spielwiese.qcow2 -hdb /dev/sda -hdc /dev/sdc -cdrom /dev/cdrom -boot c | |||
qemu-system- | qemu 5.2 (Cimaera) | ||
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4096 -rtc base=localtime \ | |||
-netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=emu,hostfwd=tcp::55522-:22 \ | |||
-device e1000,netdev=mynet0 -device ES1370 -vga virtio \ | |||
-hda /pub/qemu/Chimaera_LXQt.qcow2 -cdrom /dev/cdrom -boot c | |||
-boot a # a: floppy | c: HDD | d: CDROM | -boot a # a: floppy | c: HDD | d: CDROM | ||
-bios /usr/share/qemu/OVMF.fd | -bios /usr/share/qemu/OVMF.fd | ||
# UEFI, benötigt -enable-kvm | |||
-detach # Run in background | |||
-device # NIC Intel e1000, verbunden mit backend "mynet0" | -device # NIC Intel e1000, verbunden mit backend "mynet0" | ||
-monitor stdio # - | -drive node-name=hda,file=/pub/qemu/daedalus.qcow2 | ||
-drive driver=raw,node-name=hdb,file=/dev/sda | |||
# Include physical disk /dev/sda as hdb | |||
-monitor stdio # -monitor <dev>, device for the monitor | |||
-netdev # Netzwerk-backend, Gast per DHCP | -netdev # Netzwerk-backend, Gast per DHCP | ||
# hostfwd: 55522=hostport, 22=guestport | # ,hostfwd: 55522=hostport, 22=guestport | ||
-device AC97 | |||
-vga vmware # xserver-xorg-video-vmware | -vga vmware # xserver-xorg-video-vmware | ||
-vga [virtio|cirrus|std|none] | -vga [virtio|cirrus|std|none] | ||
Line 506: | Line 548: | ||
; ssh http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Netzwerkoptionen/_Virtuelle_Netzwerke_konfigurieren#User_Mode_Network_Stack | ; ssh http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Netzwerkoptionen/_Virtuelle_Netzwerke_konfigurieren#User_Mode_Network_Stack | ||
user@host:$ ssh ax@localhost -p 55522 | user@host:$ ssh ax@localhost -p 55522 | ||
user@host:$ scp -P 55522 $FILE user@localhost:~ | |||
;nbd http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Speichermedien/_Network_Block_Devices | ;nbd http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Speichermedien/_Network_Block_Devices | ||
: Gast: nbd-server installieren | : Gast: nbd-server installieren | ||
: Host: nbd-client installieren | : Host: nbd-client installieren | ||
=== Win7 guest === | |||
Grafik: | |||
-vga qxl | |||
-usb -device usb-tablet # wegen Mauszeiger | |||
Videotreiber von https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso installieren. <BR> | |||
Audio: | |||
-device intel-hda | |||
-device hda-duplex | |||
SMB-Zugriff auf den host: | |||
-netdev user,id=mynet0,smb=/home/ax -device e1000,netdev=mynet0 | |||
# Für das Netzwerkverzeichnis im Gast angeben: \\10.0.2.4\qemu | |||
# Die .4 ergibt sich aus der Gast-IP + 2 (ipconfig): | |||
-netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=win7emu,smb=/home/ax -device e1000,netdev=mynet0 | |||
# Hier dann: \\192.168.178.4\qemu | |||
= ripit = | = ripit = | ||
ripit -e -c 2 -q | Achtung! Für freedb-Zugriff mindestens Version 4.0.0~rc20161009-1 (Bullseye) verwenden. Download: http://ftp.de.debian.org/debian/pool/main/r/ripit/ripit_4.0.0~rc20161009-1_all.deb | ||
: -e | |||
: -c | ripit -N -z -m -e -c 2 -q 8 -d /dev/sr0 -o /pub/Musik/flac/ [tracks] | ||
: -q | : -N, --normalize [-z, --normopt | ||
:: default: "-a -12 dB"; -b, batch mode | |||
:: optional: -m, mix mode, instead of -b, for mixed CDs] | |||
: -e, --eject | |||
: -c, --coder (0=lame; 1=oggenc; 2=flac) | |||
: -q, --quality (mp3 0; ogg 10; flac 8) | |||
: http://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres | : http://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres | ||
: http://www.freedb.org/ | : http://www.freedb.org/ | ||
Line 543: | Line 610: | ||
=S.M.A.R.T.= | = S.M.A.R.T. = | ||
smartctl -x /dev/sdX # alle Infos zum Laufwerk ausgeben | |||
smartctl -s on /dev/sdX # SMART aktivieren | |||
smartctl -t long /dev/sdX | smartctl -t long /dev/sdX | ||
smartctl -l /dev/sdX | smartctl -l [selftest|error] /dev/sdX # [selftest|error]-log ausgeben | ||
smartctl -l [scttempsts|scttemphist] /dev/sdX # Temperatur [aktuell|history] ausgeben | |||
smartctl -H # Health status | |||
= SSH = | |||
sshd_config: Standardeinstellungen behalten, am Ende der Datei Ausnahmen hinzufügen:<BR> | |||
Match Address 192.168.178.0/24 # LAN | |||
PasswordAuthentication yes | |||
X11Forwarding yes | |||
Match LocalAddress 127.0.0.1,::1 # localhost | |||
PasswordAuthentication yes | |||
X11Forwarding yes | |||
PermitRootLogin yes | |||
Line 553: | Line 636: | ||
man x509 | man x509 | ||
= su = | |||
su - | |||
: If you want to restore behaviour more similar to the previous one you can add 'ALWAYS_SET_PATH yes' in /etc/default/su. | |||
: <fsmithred> or you can put 'export PATH=blah' in /root/.bashrc | |||
= svn = | = svn = | ||
Line 570: | Line 658: | ||
= tune2fs = | = tune2fs = | ||
tune2fs -l /dev/sdXX | tune2fs -l /dev/sdXX | grep -i reserved | ||
tune2fs -m 0 /dev/sdXX # reservierte Blöcke für root auf 0 setzen | # derzeitige Parameter auflisten | grep reservierte Blöcke | ||
tune2fs -m 0 /dev/sdXX # reservierte Blöcke für root auf 0 % setzen | |||
tune2fs -L label /dev/sdXX # Name (label) der Partition festlegen | tune2fs -L label /dev/sdXX # Name (label) der Partition festlegen | ||
Line 608: | Line 697: | ||
[w1]http://wiki.winehq.org/UsefulRegistryKeys | [w1]http://wiki.winehq.org/UsefulRegistryKeys | ||
= X = | = X = | ||
Line 627: | Line 715: | ||
├── Section "Files" (once) | ├── Section "Files" (once) | ||
└── Section "DRI" (once) | └── Section "DRI" (once) | ||
Line 636: | Line 723: | ||
smem | smem | ||
xterm -T xs3 -bg black -fg gray80 -fn 10x20 -geometry 101x30+0+0 -e ssh -t xs3 screen -RRD | xterm -T xs3 -bg black -fg gray80 -fn 10x20 -geometry 101x30+0+0 -e ssh -t xs3 screen -RRD | ||
= Shells = | |||
https://wiki.debian.org/Shell | |||
chsh # Set default shell | |||
=== zsh === | |||
ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/FAQ |
Latest revision as of 18:19, 15 February 2024
ALSA
~/.asoundrc | /etc/asound.conf
## Set PCH,0 the default device defaults.ctl.!card PCH defaults.pcm.!card PCH #defaults.pcm.!device 0 #defaults.timer.!card PCH #defaults.timer.!device 0 #defaults.ctl.!device 0 ## (aplay -L | grep CARD) ## alsaequal plugin. See https://github.com/raedwulf/alsaequal ctl.equal { type equal; } # pcm.plugequal { type equal; # Modify the line below if you don't # want to use sound card 0. # slave.pcm "plughw:0,0"; # or if you want to use with multiple applications output to dmix slave.pcm "plug:dmix" } # pcm.equal { # Or if you want the equalizer to be your # default soundcard uncomment the following # line and comment the above line. #pcm.!default { type plug; slave.pcm plugequal; } ## ameter ## http://laugeo.free.fr/ameter.html ## Bsp.: mplayer -ao alsa:device=ameter #pcm_scope.ameter { # type ameter #} #pcm_scope_type.ameter { # lib /usr/local/lib/libameter.so #} #pcm.ameter { # type meter # slave.pcm 'hw:0,0' #can be hw or hw:0,1 etc... # scopes.0 ameter #} #pcm.dsp0 ameter
## Some notes: # <debianuser> [...] recently someone mentioned "asoundconf-gtk". lsof | grep [pcm|snd] fuser -fv /dev/snd/* amixer set PCM 80% alsaplayer -i text .fluxbox/additionalapps/wmclockmon/stihl_ms2.wav pasuspender -- speaker-test -c2 -twav -l5 -Dplughw:1,0 https://bitbucket.org/stativ/asoundconf/src/default/ https://github.com/i-rinat/apulse # <rrq> "qasconfig" is a good tool for reviewing the alsa configuration
badblocks
badblocks -vw /dev/sdd # write test, destroys data! badblocks -vn /dev/sdd # non-destructive read/write testing
bash
Rechnen
echo $[4*10]
- keine Kommastellen
bzr (bazaar)
???
bzr branch ..? # branch wählen bzr pull # update holen
chroot
Benutzung
chroot starten
chroot /emul/i386-testing/ [COMMAND] schroot -d
Einrichten
Host
- Benötigte Pakete: debootstrap, schroot
- Partition/Verzeichnis anlegen, z.B. /emul/i386-testing/
- Debian dort installieren:
su -c "debootstrap --arch i386 testing /emul/i386-testing/ http://ftp2.de.debian.org/debian/"
- Verzeichnisse des Hosts, die auch vom Client verwendet werden sollen, in /etc/fstab (Host) eintragen:
# i386-testing chroot /home /emul/i386-testing/home none bind 0 0 /tmp /emul/i386-testing/tmp none bind 0 0 /dev /emul/i386-testing/dev none bind 0 0 /proc /emul/i386-testing/proc none bind 0 0
- und mounten:
mount -a
- Benutzerdaten?
Client
- Ins chroot wechseln:
su -c chroot /emul/i386-testing
- bash-Prompt:
echo i386 > /etc/debian_chroot
- Autocompletion: /etc/bash.bashrc bearbeiten
- /etc/apt/sources.list nacharbeiten (contrib non-free)
- (Wechsel-) Datenträger einbinden, wie Normal, da /dev ja vom Host stammt; fstab (Client):
# file system mount point type options dump pass /dev/sr0 /media/cdrom udf,iso9660 noauto,ro,user,exec 0 0 #/dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0 #proc /proc proc defaults 0 0
schroot
/etc/schroot/schroot.conf schroot -c /emul/i386-testing/ -- ls -la /
- http://wiki.ubuntuusers.de/schroot
- http://wiki.debian.org/Kde4schroot KDE4 auf zweitem X-Server
cmake
cmake --trace
<D-HUND> james: can you tell me how to tell cmake to look at a specific path for a specific lib? <james> D-HUND: some -DLIBNAME_PREFIX=/foo/bar/ -L/usr/mylib http://www.cmake.org/pipermail/cmake/2005-August/007136.html
- -D CMAKE_BUILD_TYPE="Release"
- -D CMAKE_INSTALL_PREFIX:PATH="$prefix"
ccmake
für Menugestützte konfiguration.
From now on, pass either -DPythonInterp_FIND_VERSION=<version> or -DPythonLibs_FIND_VERSION=<version> respectively in order to tell cmake to look for the specific Python version. However, if an explicit Python version is requested via find_package(), it will override the one specified on the command line.
dd
ddrescue: https://wiki.ubuntuusers.de/gddrescue/
dd bs=10M if= | pv --size 20G | dd bs=10M of= killall -SIGUSR1 dd
ffmpeg
# Infos zu Containern/Streams ffprobe file
# Bildschirm aufnehmen ffmpeg -f x11grab -r 20 -s 1280x1024 -i :0.0+1024,0 -sameq -f mp4 output.mp4
# recording: ffmpeg [global_options] {[input_file_options] -i input_file} ... {[output_file_options] output_file} ... ffpmeg -i http://localhost:5500/screenshot?stream=y -c copy your_movie.avi # capture stream # Danach mit kdenlive bearbeiten.
# Audiospur extrahieren: ffmpeg -i $inputfile.avi -vn -ac 2 -ar 44100 [-ab 320k] [-f mp3] $name.[mp3|wav] # -f mp3|etc. not required, usually, format detected from file name extension
# Umwandeln (Video (-c[odec]:v)) ffmpeg -i infile.* [-c:a copy] -c:v libx264 -x264opts qp=27 outfile.mkv #(-crf [0-50] # default=23, 0=beste Qualität, 50=beste Komprimierung(?)) # crop (abschneiden: breite:höhe:Ecke links oben(x:y)) https://video.stackexchange.com/questions/4563/how-can-i-crop-a-video-with-ffmpeg -filter:v "crop=706:564:5:3"
# Animated gif http://thanosk.net/content/create-animated-gif-linux convert -delay 50 frame1.gif -delay 100 frame1.gif -delay 150 frame1.gif -loop 0 animated.gif
gdb
~/.gdbinit für die MSPs
set remoteaddresssize 64 set remotetimeout 999999 target remote localhost:2000
Debugging für FG ([1]):
(gdb) set logging file backtrace.log (gdb) set logging on (gdb) run [...] (gdb) thread apply all bt full (gdb) set logging off (gdb) quit
gettext
https://www.gnu.org/software/gettext/manual/html_node/
de_DE: https://www.gnu.org/software/gettext/manual/html_node/Locale-Names.html#Locale-Names
source(s) --> .pot --> .po
source
...
.pot files
xgettext -o $file.pot -L shell source1 [source2 ...] # Erzeugt de.po aus den Quellen (pot-input == Liste der zu durchkämmenden Dateien) -L shell # Syntax für Shell-Skripte anwenden (z.B. suchen nach: $"..."
.po files
msginit --locale=de_DE --input $file.pot # Erzeugt de.po aus $file.pot gtranslator # Editor for .po files mv de.po de.po-alt; msgmerge -o de.po de.po-alt $file.pot # de.po updaten, wenn sich file.pot geändert hat. msgcmp de.po $file.pot # Vorlage und Übersetzung vergleichen.
git
Einige nützliche Befehle für git am Beispiel der FlightGear-Quellen. Alle Befehle werden innerhalb des zielverzeichnis ausgeführt, ausgenommen das erste der hier aufgelisteten.
Repos clonen und verwalten
Ein entferntes (remote) git-Repo zu einem lokalen Repo clonen/nachbilden/vervielfältigen:
git clone git://gitorious.org/fg/flightgear.git [zielverzeichnis]
- Das zielverzeichnis wird erstellt und darin das neue Repo abgelegt.
- Eine Wiederaufnahme eines abgebrochenen Clonen ist nicht möglich.
Update eines lokalen Repos vom entfernten:
git pull
Die im geclonten Repo enthaltenen Branchen anzeigen:
git branch -a
- branch Branchen auflisten, erstellen oder entfernen
- -a listet alle, also die lokalen und die des entfernten Repos, auf. Das mit dem Sternchen * gekennzeichnete Repo ist das z.Zt. aktive.
Eine lokale aus einer entfernten Branch erzeugen:
git checkout -b master origin/master
- checkout - Checkout a branch or paths to the working tree
- -b erzeugt eine neue Branch. Diese wird gleichzeitig als aktiv markiert.
- master ist die neue Branch,
- origin/master ist die Vorlage.
Eine Branch aktivieren. Diese ist also die, welche im Arbeitsverzeichnis dargestellt wird.
git checkout next
Die Tags, also Markpunkte der Versionsgeschichte, einer Branch auflisten:
git tag
Tags aktivieren wie Branchen:
git checkout v2.0.0
Parent einer Branh herausfinden:
git parent # Voraussetzung: ein parent alias muß in ~./.gitconfig angelegt sein: # [alias] # parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
Lokale Änderungen in den Quellen
Am Beipiel vom FlightGear-data Repo in der next, also der bleeding edge, Branch.
Die lokale Branch master clonen:
git checkout -b master.local master
- In die Branch master.local können nun eigene Veränderungen eingepflegt werden. Diese ist dann auch das dargestellte data-Verzeichnis zur Benutzung mit FG.
git status
- will give you a list of files that have been altered or that are new.
git add -i
- [a]dd will add new paths/files (called untracked in status) from the working tree to the index. This has to be done only if you have added paths/files, like an aircraft, to the working tree. man git add
- [u]pdate is the next step and will update the altered and tracked files to the index in the same manner as add does.
git commit
- will commit the indexed updates to the master.local branch. It opens a list of the updates in your standard editor.
git rebase -i HEAD~5
- Die letzten fünf commits bearbeiten.
<timoore> D-HUND: The first step -- creating the new branch -- is fine. Afterwards you need to commit your changes, which is a two step process -- git add and git commit. For files that git knows about (you've already added them once), you can type "git commit -a" which will automatically do the "git add" step on all changed files. AndersG 'd avoid use of -a <AndersG> git status + a deliberate git add is better for detecting problems <pigeon> i pretty much only use git add -p these days.
Änderungen des entfernten Repos ins eigene übernehmen:
git checkout next # Ins Hauptrepo wechseln git pull # und selbiges updaten. git checkout next.own # Ins lokale Repo wechseln git rebase next # und dieses dann updaten.
<AndersG> Brandano: If you don't use your local master for anything you could replace that with: git fetch; git rebase origin/master <AndersG> When on local
Konfiguration
git config --global user.name "Your Name" git config --global user.email you@example.com
Weitere
git help git help [commad]
git checkout -f
- -f When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes, auch wenn das gesamte Arbeitsverzeichnis, ausgenommen der .git-Ordner, gelöscht wurde.
# DIFF / APPLY git checkout master.local; git diff master [pfad/datei(en)] > datei.diff git apply --index [-R] datei.diff; git commit
- Apply a patch to files and/or to the index http://www.kernel.org/pub/software/scm/git/docs/git-apply.html
- '--index' Änderungen auch in den Index schreiben
- '-R' reverse, rückgängig machen
git gc
git remote set-url --add [origin] [2]
git reset [--hard]
- throw away any 'unstaged changes'
git reset --hard HEAD~1
- go back one commit
https://git-scm.com/docs/git-bisect
git-svn
git-svn Repo anonym initialisieren, am Beispiel eines Flugzeugs aus fgaddon:
mkdir Aerostar-700; cd Aerostar-700 git svn init svn://svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft/Aerostar-700 git svn fetch
Updates holen:
git checkout master git svn rebase
grml
grml-quickconfig
/etc/init.d/ssh start echo "root:test7" | chpasswd
grml2usb
- 2011.12 "Knecht Rootrecht" installieren
Partitionen anlegen:
fdisk -l /dev/sdb Disk /dev/sdb: 1031 MB, 1031675904 bytes ... Device Boot Start End Blocks Id System /dev/sdb1 * 63 1333394 666666 6 FAT16 # "grml96" 655 MiB # "grml32" 320 MiB /dev/sdb2 1335296 2013183 338944 5 Extended /dev/sdb5 1337344 1951743 307200 83 Linux # "home-rw" ext3 /dev/sdb6 1953792 2013183 29696 83 Linux # "live-rw" ext3
- GRMLCFG
<debdog> therefore next question: what could possibly go into GRMLCFG that can't live in home-rw or live-rw? <debdog> but reading http://grml.org/config/grml-autoconfig.1.html i could not find anything <mika> debdog: grml.sh, don't care about the rest IMHO /dev/sdb7 # "GRMLCFG" ext3 (5 MiB, grml.sh))
Gibt es einen Grund für ext3, wie in [2] beschrieben, wäre ext2 nicht besser für kleine Datenträger? <MirWRT> the journal <MirWRT> = less data loss (hopefully) and less need for fsck on sudden-unplug <MirWRT> which isn’t all that rare with usb sticks
cd ~/src/grml2usb && git pull su -c './grml2usb --bootoptions="%grml32 %grml64 persistent lang=de swap ssh=passwort nobeep " \ /pub/images/grml96_2011.12.iso /dev/sdb1' [autoconfig] [--bootloader-only --syslinux-mbr] testen: bootfrom=removable-usb keyboard=de xkeyboard=de
--bootoptions= "cheatcodes"
[1] http://grml.org/grml2usb/
[2] http://wiki.grml.org/doku.php?id=persistency
- Problem
<debdog> I am not able to create a grml32 only usb drive with grml2usb v0.11.3 and younger <debdog> ./grml2usb --bootoptions="%grml32 persistent lang=de swap ssh=passwort nobeep" /pub/images/grml96_2011.12.iso /dev/sdb1
hdparm
hdparm [-C|-t|-I|-v] /dev/sda
- -C zeigt den 'drive state'
- -t 'Perform timings of device reads for benchmark and comparison purposes.'
- -I zeigt 'identification info'
- -v zeigt 'current settings'
hdparm -S 252 -M 254 -W [0|1] /dev/sda
/etc/hdparm.conf
html2ps
html2ps -T -F -n -D -o file.ps [file|URL]
- -T nur Text, bilder werden ausgelassen
- -F Rahmen um den Text
- -n Seiten nummerieren
- -D GhostView-kompatibel. Siehe manpage!
- -o output file
hwinfo
Asführen bevor (der X-Server/KMS?) gestartet wird:
hwinfo --framebuffer
Alternative:
# --> https://github.com/wfeldt/mdt aptitude install libx86emu-dev git clone git://github.com/wfeldt/mdt.git mdt.git cd mdt.git make cp mdt /usr/local/sbin/ su -c "mdt --modes"
jscal
jscal -c /dev/input/by-id/usb-06a3_Saitek_Cyborg_USB_Stick-joystick
lshw
-C multimedia
make
VERBOSE=1 make -j $(nproc)
mount
http://www.volkerschatz.com/unix/advmount.html
Images
losetup /dev/loop0 Image.img fdisk -l /dev/loop0 mount -o loop,offset=XXX Image.img /mnt losetup [-D|-d /dev/loopX]
mplayer/mencoder
mplayer -fs -aid ID [-nosub|-noautosub|-sid ID] -aspect 16:9 file [file ...]
- '-fs' fullscreen
- '-aid ID' Audiospur (Audio ID) wählen.
- '-sid ID' Untertitel wählen
- '-noautosub' Untertitel nicht automatisch laden.
- (-ass* ?)
- '-sub <subtitlefile1,subtitlefile2,...>'
- '-subdelay seconds'
- '-zoom -xy [0…8]' Video skalieren
- '-vf <...,filter2,filter1>' Video filter
- 'flip' horizontal spiegeln
- 'mirror' vertikal spiegeln
- 'rotate=[0-7]'
- 0: 90° Uhrzeiger, spiegeln
- 1: 90° Uhrzeiger
- 2: 90° gegen Uhrz.
- 3: 90° gegen Uhrz., spiegeln
- 'screenshot' Screenshot, Taste
s
mplayer -identify -frames 0 # entspricht -msglevel identify=4 -frames 0 mplayer -dvd-device /dev/sr0 dvd://1 # DVD, Titel 1 mplayer cdda:// /dev/sr0 # Audio-CD
# Videospur aus Datei extrahieren: mencoder $input.avi -o $name.$codec -nosound -ovc copy # Audiospur aus Datei extrahieren: mencoder $input.avi -o $name.$codec -of rawaudio -ovc copy -oac [copy|mp3lame] # Video- und Audiospur verbinden: mencoder $inputvideo.avi -audiofile inputaudio.mp3 -oac copy -ovc copy -o $output.avi
- '-oac help' output audio codec
Streams
mplayer http://www.rockantenne.de/webradio/rockantenne-aac.pls mplayer http://mp3-live.swr.de/swr1bw_s.m3u mplayer http://mp3-live.swr3.de/swr3_s.m3u
mencoder -oac lavc -ovc lavc vcodec=msmpeg4:vbitrate=1800:vhq:keyint=250 -o $file
ntp
ntpdate-debian
qemu
https://qemu.weilnetz.de/doc/5.2/
Mouse-grab-keys (MGK), default: Ctrl-Alt
Switch to monitor: MGK-Shift-2
Switch back to guest: MGK-Shift-1
https://en.wikibooks.org/wiki/QEMU/Monitor
aqemu
qemu 3.1 (Beowulf)
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4096 \ -netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=emu,hostfwd=tcp::55522-:22 \ -device e1000,netdev=mynet0 -soundhw es1370 -vga virtio \ -hda /pub/qemu/Devuan_ASCII_Spielwiese.qcow2 -hdb /dev/sda -hdc /dev/sdc -cdrom /dev/cdrom -boot c
qemu 5.2 (Cimaera)
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4096 -rtc base=localtime \ -netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=emu,hostfwd=tcp::55522-:22 \ -device e1000,netdev=mynet0 -device ES1370 -vga virtio \ -hda /pub/qemu/Chimaera_LXQt.qcow2 -cdrom /dev/cdrom -boot c
-boot a # a: floppy | c: HDD | d: CDROM -bios /usr/share/qemu/OVMF.fd # UEFI, benötigt -enable-kvm -detach # Run in background -device # NIC Intel e1000, verbunden mit backend "mynet0" -drive node-name=hda,file=/pub/qemu/daedalus.qcow2 -drive driver=raw,node-name=hdb,file=/dev/sda # Include physical disk /dev/sda as hdb -monitor stdio # -monitor <dev>, device for the monitor -netdev # Netzwerk-backend, Gast per DHCP # ,hostfwd: 55522=hostport, 22=guestport -device AC97 -vga vmware # xserver-xorg-video-vmware -vga [virtio|cirrus|std|none]
qemu-img create -f qcow2 /pub/qemu/Wheezy64.qcow2 3G qemu-img resize /pub/qemu/Wheezy64.qcow2 [+|-]1G qemu-img snapshot -l(ist) -c(reate) -d(elete) -a(pply, auswählen) $snapshot /pub/qemu/Wheezy64.qcow2
- nfs
http://www.cnx-software.com/2011/10/02/how-to-transfer-files-between-host-and-qemu-via-ssh-and-nfs/
Host, /etc/exports:
/pub *(rw,insecure) # fuer qemu-Gaeste
Gast:
mount $HOST_IP:/pub /mnt
Netzwerk
user@host:$ ssh ax@localhost -p 55522 user@host:$ scp -P 55522 $FILE user@localhost:~
- nbd http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Speichermedien/_Network_Block_Devices
- Gast: nbd-server installieren
- Host: nbd-client installieren
Win7 guest
Grafik:
-vga qxl -usb -device usb-tablet # wegen Mauszeiger
Videotreiber von https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso installieren.
Audio:
-device intel-hda -device hda-duplex
SMB-Zugriff auf den host:
-netdev user,id=mynet0,smb=/home/ax -device e1000,netdev=mynet0 # Für das Netzwerkverzeichnis im Gast angeben: \\10.0.2.4\qemu # Die .4 ergibt sich aus der Gast-IP + 2 (ipconfig): -netdev user,id=mynet0,net=192.168.178.0/24,dhcpstart=192.168.178.9,hostname=win7emu,smb=/home/ax -device e1000,netdev=mynet0 # Hier dann: \\192.168.178.4\qemu
ripit
Achtung! Für freedb-Zugriff mindestens Version 4.0.0~rc20161009-1 (Bullseye) verwenden. Download: http://ftp.de.debian.org/debian/pool/main/r/ripit/ripit_4.0.0~rc20161009-1_all.deb
ripit -N -z -m -e -c 2 -q 8 -d /dev/sr0 -o /pub/Musik/flac/ [tracks]
- -N, --normalize [-z, --normopt
- default: "-a -12 dB"; -b, batch mode
- optional: -m, mix mode, instead of -b, for mixed CDs]
- -e, --eject
- -c, --coder (0=lame; 1=oggenc; 2=flac)
- -q, --quality (mp3 0; ogg 10; flac 8)
CDDBMETHOD=cddb CDDBURL=freedb.freedb.org:8880 HELLOINFO=RipIT@www.suwald.com/ripit/ripit.html abcde -d (/dev/sr0?) eject directory datenbank -j ($nproc) -o mp3:"-q 0"(?) # RipIT@www.suwald.com/ripit/ripit.html running RipIT 3.9.0
rsync
rsync [options (-aX)] SRC [DEST]
- -a = -rlptgoD
- -g preserve group
- -l copy symlinks as symlinks
- -o preserve owner (super-user only)
- -p preserve permissions
- -t preserve modification times
- -r recursive
- -D same as --devices --specials
- --devices preserve device files (super-user only)
- --specials preserve special files
- -X preserve extended attributes
- --del an alias for --delete-during
- --delete delete extraneous files from dest dirs
- --delete-during receiver deletes during xfer, not before
rsync -aX --del /home/ax /media/sdb2/ax.rsync
S.M.A.R.T.
smartctl -x /dev/sdX # alle Infos zum Laufwerk ausgeben smartctl -s on /dev/sdX # SMART aktivieren smartctl -t long /dev/sdX smartctl -l [selftest|error] /dev/sdX # [selftest|error]-log ausgeben smartctl -l [scttempsts|scttemphist] /dev/sdX # Temperatur [aktuell|history] ausgeben smartctl -H # Health status
SSH
sshd_config: Standardeinstellungen behalten, am Ende der Datei Ausnahmen hinzufügen:
Match Address 192.168.178.0/24 # LAN PasswordAuthentication yes X11Forwarding yes Match LocalAddress 127.0.0.1,::1 # localhost PasswordAuthentication yes X11Forwarding yes PermitRootLogin yes
SSL (openssl)
man openssl man s_client man x509
su
su -
- If you want to restore behaviour more similar to the previous one you can add 'ALWAYS_SET_PATH yes' in /etc/default/su.
- <fsmithred> or you can put 'export PATH=blah' in /root/.bashrc
svn
svn update -rXXX
- XXX ist die Revisionsnummer
tar
tar -c -j [--directory=/home/] [--ignore-failed-read] -f home_ax_bcp.tar.bz2 /home/ax tar tvf datei
- -t list, Inhalt anzeigen
tee
<command> 2>&1 | tee <file>
tune2fs
tune2fs -l /dev/sdXX | grep -i reserved # derzeitige Parameter auflisten | grep reservierte Blöcke tune2fs -m 0 /dev/sdXX # reservierte Blöcke für root auf 0 % setzen tune2fs -L label /dev/sdXX # Name (label) der Partition festlegen
undelete
- extundelete - utility to recover deleted files from ext3/ext4 partition
- über die inode: http://archive09.linux.com/feature/58142
wine
Icons: icoutils --> wrestool
wrestool -l name.exe wrestool -x -o ~/.fluxbox/icons/ [--raw] name.exe
Danach müssen evtl. noch die Lagen (unterschiedliche Grössen) getrennt werden --> The Gimp.
Umgebungsvariablen:
WINEPREFIX=path WINEARCH=[win32|win64] USERNAME=admin
Problem:
err:d3d_caps:WineD3D_CreateFakeGLContext Can't find a suitable iPixelFormat. err:d3d:InitAdapters Failed to get a gl context for default adapter fixme:x11drv:X11DRV_desktop_SetCurrentMode Cannot change screen BPP from 32 to 16 err:ddraw:CreateSurface Failed to create swapchain, hr 0x8876086c. err:d3d_caps:WineD3D_CreateFakeGLContext Can't find a suitable iPixelFormat. err:d3d:InitAdapters Failed to get a gl context for default adapter fixme:x11drv:X11DRV_desktop_SetCurrentMode Cannot change screen BPP from 32 to 16 err:ddraw:CreateSurface Failed to create swapchain, hr 0x8876086c.
Lösung:
<Jester01> for 32 bit compat, you need /usr/lib32/fglrx/fglrx-libGL.so.1.2 <Jester01> probably not the recommended method, but rename /usr/lib32/libGL.so.1.2 and make it a symlink to /usr/lib32/fglrx/fglrx-libGL.so.1.2
declare -x LIBGL_DRIVERS_PATH="/usr/lib32/dri:/usr/lib/dri"
[w1]http://wiki.winehq.org/UsefulRegistryKeys
X
xorg.conf
https://www.x.org/archive/X11R6.8.1/doc/xorg.conf.5.html
xorg.conf ├── Section "ServerLayout" (multiple) │ ├── Section "Screen" │ │ │ └── SubSection "Display" │ │ ├── Section "Device" │ │ └── Section "Monitor" │ │ ├── Section "Modes" │ │ └── Section "Vendor" │ └── Section "InputDevice" ├── Section "ServerFlags" (once) ├── Section "Module" (once) ├── Section "Files" (once) └── Section "DRI" (once)
"Hinterkopf"
free -m # actually needed = used - buffers - cache furiusisomount # mehrere Images mounten etc. ltrace # A library call tracer smem xterm -T xs3 -bg black -fg gray80 -fn 10x20 -geometry 101x30+0+0 -e ssh -t xs3 screen -RRD
Shells
chsh # Set default shell