Cmd

.bashrc Beispiele

Applying changes To apply changes from this article to your .bashrc (without ending subshells), do: $ source ~/.bashrc oder $ . .bashrc Or, if you want, you can build your prompt using the ✓ unicode symbol for a zero status and the ✗ unicode symbol for a nonzero status: 0 ✓ andy@alba ~ $ true 0 ✓ andy@alba ~ $ false 1 ✗ andy@alba ~ $ I will try to type a wrong command... bash: I will try to type a wrong command...: command not found 127 ✗ andy@alba ~ $ _ # return value visualisation PS1="[33[01;37m]$? $(if [[ $? == 0 ]]; then echo "[33[01;32m]342234223"; else echo "[33[01;31m]342234227"; fi) $(if [[ ${EUID} == 0 ]]; then echo '[33[01;31m]h'; else echo '[33[01;32m]u@h'; fi)[33[01;34m] w $[33[00m] " Alternatively, this can be made more readable with `PROMPT_COMMAND`: set_prompt () { Last_Command=$? # Must come first! Blue='[e[01;34m]' White='[e[01;37m]' Red='[e[01;31m]' Green='[e[01;32m]' Reset='[e[00m]' FancyX='342234227' Checkmark='342234223' ## Add a bright white exit status for the last command PS1="$White$? " # If it was successful, print a green check mark. Otherwise, print # a red X. if [[ $Last_Command == 0 ]]; then PS1+="$Green$Checkmark " else PS1+="$Red$FancyX " fi # If root, just print the host in red.

Continue reading

Adobe Flash Player Linux Install Anleitung

Flash > Adobe Flash Player Adobe Flash Player is a multimedia platform used to add animation, video, and interactivity to Web pages. Flash is frequently used for advertisements and games. This wiki page describes how to install the Adobe Flash Player, formerly known as the Macromedia Flash Player, on Debian systems. This page serves as the homepage of the Debian package flashplugin-nonfree. End User License Agreement of the Adobe Flash Player The newest versions of the Debian package flashplugin-nonfree have this warning in the package description: WARNING: Installing this Debian package causes the Adobe Flash Player to be downloaded from www.adobe.com. The End User License Agreement of the Adobe Flash Player is available at www.adobe.com. Installation Ensure your /etc/apt/sources.list file includes the contrib section ( for more information see sources.list ) Install flashplugin-nonfree (from section contrib): apt-get install flashplugin-nonfree Upgrade How to update the Adobe Flash Player: update-flashplugin-nonfree --install Supported browsers in Debian Arora Galeon Iceweasel Konqueror (if Netscape plugins support is present) Opera >= 9.50 beta 1 … and more. Unsupported browsers Chromium Bug reporting If you find a problem with flashplugin-nonfree, then you are most welcome to report it in the Debian bug tracking system. However, we cannot modify the Adobe Flash Player to fix problems in Debian.

Continue reading

Cheatsheet tmux

Tmux Command line Cheatsheets tmux new -s {session_name} -n {name} - create new session and specify window name tmux {attach|a|at} -t {session_name} - attach to session tmux ls - list sessions tmux kill-session -t {session_name} - kill session Tmux Misc Prefix ? - help Prefix d - detach Prefix t - big clock Tmux Command mode Prefix : - command mode new-window -n {name} {command} - create new window and execute command Tmuix Sessions :new - new session Prefix s - list sessions Prefix $ - name session Prefix ( - previous session Prefix ) - next session Prefix L - last session Tmux Windows Prefix c - create new window Prefix , - rename window Prefix n - next window Prefix p - previous window Prefix {n} - go to window n Prefix f - find window by name Prefix w - list windows Prefix & - kill window Tmux Panes Prefix % split panes by vertical Prefix " split panes by horizontal Prefix o - cycle through the panes Prefix {arrow key} - navigate to specific pane Prefix space - cycle thought layouts Prefix x - close pane Prefix q - show panes numbers Prefix z - switch to whole window mode and back Prefix { - move the current pane left Prefix } - move the current pane right :setw synchronize-panes - toggle panes synchronization Tmux Copy mode (vi mode) Prefix [ - start copy mode Prefix ] - past from copy mode ^ - back to indentation esc - clear selection enter - copy selection j - cursor down h - cursor left l - cursor right k - cursor down L - cursor to bottom line M - cursor to middle line H - cursor to top line d - delete entire line D - delete to end of line $ - end of line : - goto line ⌃-d - half page down ⌃-u - half page up ⌃-f - next page w - next word p - paste buffer ⌃-b - previous page b - previous word q - quit mode ⌃-down, ⌃-j - scroll down ⌃-up, ⌃-k - scroll up n - next search match ?

Continue reading

DIY high resolution 3D DLP printer (3D SLA printer)

Hello World (skip the first two pages to go directly to the build) Please like my brand new facebook page to stay up to date of my new projects and progress on the 3D printer. **We are now selling Beta tester Kits, PM message me for details!**I have to admit that I have not been active on Instructables for quite a while now, this because we (yes it is we now :D) have been busy developing a 3D printer. A 3D dlp printer to be exact, an open source high resolution 3D DLP printer to be even more exact. We have now finished version 1.0 and now it is time to share our learnings with the rest of the world.Why did we work on a 3D printer? Well as you all know the world needs more 3D printers, more platforms for creation, more freedom. More possible ways to show your epic awesomeness in creation. And most of all the freedom to design and fabricate exactly what you need, when you need it without any barriers. In short 3D printers are awesome, you can never have enough 3D printers.Why did we work on a 3D Direct Light Processing printer (DLP)? 3D printers come in many shapes, sizes and varieties.

Continue reading

DNS-Server deutscher Internetanbieter

DNS-Server: CCC dnscache.berlin.ccc.de: 213.73.91.35 DNS-Server: Kabel Deutschland 83-169-185-161-isp.superkabel.de: 83.169.185.161 83-169-185-225-isp.superkabel.de: 83.169.185.225 83-169-186-161-isp.superkabel.de: 83.169.186.161 83-169-184-33-isp.superkabel.de: 83.169.184.33 83-169-184-97-isp.superkabel.de: 83.169.184.97 DNS-Server: Unitymedia (früher: Kabel BW) ns1.ish.de: 80.69.98.110 ns2.ish.de: 80.69.100.12 1411G-DNS-01.neuss.unity-media.net: 80.69.100.174 1413G-DNS-01.duisburg.unity-media.net: 80.69.100.182 7111A-DNS-01.frankfurt.unity-media.net: 80.69.100.198 1300-DNS-01.kerpen.unity-media.net: 80.69.100.206 1311G-DNS-01.huerth.unity-media.net: 80.69.100.214 1211F-DNS-01.dortmund.unity-media.net: 80.69.100.230 DNS-Server: Arcor dns1.arcor-ip.de: 145.253.2.11 dns2.arcor-ip.de: 145.253.2.75 dns3.arcor-ip.de: 145.253.2.171 dns4.arcor-ip.de: 145.253.2.203 dns5.arcor-ip.de: 195.50.140.114 dns6.arcor-ip.de: 145.253.2.196 dns7.arcor-ip.de: 145.253.2.81 dns8.arcor-ip.de: 145.253.2.174 DNS-Server: HanseNet / Alice ns1.hansenet.de Hamburg: 213.191.73.65 ns2.hansenet.de Hamburg: 213.191.74.20 ns3.hansenet.de Hamburg: 62.109.123.198 name1.hansenet.de Hamburg: 213.191.74.18 DNS-Server: Versatel dns.versatel-west.de: 62.220.18.8 dns.versatel-nord.de: 89.246.64.8 dns.versatel-ost.de: 82.144.41.8 dns.versatel-sued.de: 82.145.9.8 DNS-Server: Deutsche Telekom AG 217.5.100.185 217.5.100.186 DNS-Server: T-Online T-Online Hannover: 217.237.149.161 T-Online Hamburg: 217.237.150.225 T-Online Köln: 217.237.150.97 T-Online Leipzig: 217.237.149.225 T-Online München: 217.237.151.97 T-Online Alb-Donau-Kreis und Ulm: 217.237.150.141 T-Online Stuttgart: 217.237.151.161 T-Online Standort unbekannt: 217.237.150.188 T-Online Dortmund: 217.237.151.205 217.237.148.70 DNS-Server: Bluewin.ch 195.186.4.111 195.186.4.110 DNS-Server: Freenet ns1.freenet.de: 194.97.3.82 ns2.freenet.de: 194.97.109.82 DNS-Server: PowerNS not-updated.hosting-agency.de Frankfurt/Main: 194.145.226.26 not-updated.hosting-agency.de Dresden: 77.220.232.44 DNS-Server: M-Net dns01.mnet-online.de: 212.18.0.5 dns02.mnet-online.de: 212.18.3.5 ns.primary-dns.de: 212.114.152.1 ns.secondary-dns.de: 212.114.153.1 DNS-Server: Google google-public-dns-a.google.com: 8.8.8.8 google-public-dns-b.google.com: 8.8.4.4 DNS-Server: Vodafone DNS-Server 1: 195.50.140.114 DNS-Server 2: 195.50.140.252 DNS-Server: 1&1 217.237.150.188 217.237.150.33 217.237.150.141

Continue reading

E-mail-Anbieter Liste mit IMAP bzw. POP3- und SMTP-Servern

Freemail Anbieter directBOX Posteingangsserver: pop3.directbox.com Postausgangsserver: smtp.directbox.com Username: [email protected] Sonstiges: Benutzt SMTP-Authentifizierung. GMX Posteingangsserver: POP3: pop.gmx.net (bei SSL Port 995) IMAP: imap.gmx.net (bei SSL Port 993) Postausgangsserver: mail.gmx.net (SSL über Port 25, 587 oder 465) Username: GMX-Kundennummer oder GMX-E-Mail-Adresse Sonstiges: Benutzt SMTP-Authentifizierung oder “POP3 vor SMTP”,je nachdem, wie Sie Ihren Account eingestellt haben.IMAP ist nur in den Tarifen ProMail und TopMail verfügbar. Google Mail Posteingangsserver: POP3: pop.googlemail.com (SSL; Port 995) IMAP: imap.googlemail.com (SSL; Port 993) Postausgangsserver: smtp.googlemail.com (SSL; Port 465 oder 587) Username: [email protected] Sonstiges: Benutzt SMTP-Authentifizierung.Sie müssen in Ihrem Account den POP3- und SMTP-Zugriff zunächst aktivieren.POP3 und SMTP laufen über SSL-Verschlüsselung. Der SMTP-Server läuft auf Port 465 oder 587, der POP3-Server auf Port 995 (Standard-Port für POP3 über SSL), der IMAP-Server auf Port 993 (Standard-Port für IMAP über SSL). Hotmail (kostenlos & kostenpflichtig) Posteingangsserver: pop3.live.com(SSL; Port 995) Postausgangsserver: smtp.live.com (STARTTLS; Port 587) Username: Vollständige Hotmail-E-Mail-Adresse Sonstiges: Benutzt SMTP-Authentifizierung.POP3 und SMTP laufen über TLS- bzw. SSL-Verschlüsselung. mymail.ch Posteingangsserver: mail.mymail.ch (POP3 und IMAP) Postausgangsserver: mail.mymail.ch Username: Username Sonstiges: Benutzt SMTP-Authentifizierung. Oleco Mail Posteingangsserver: mail.oleco.de Postausgangsserver: mail.oleco.de Username: Oleco-E-Mail-Adresse Sonstiges: Benutzt SMTP-Authentifizierung. WEB.DE FreeMail Posteingangsserver: POP3: pop3.web.de IMAP: imap.web.de Postausgangsserver: smtp.web.de Username: Username Sonstiges: Benutzt SMTP-Authentifizierung oder “POP3 vor SMTP”. Yahoo Mail (für Yahoo Deutschland)

Continue reading

Generating a new SSH key and adding it to the ssh-agent

After you have checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent. Thats more comfortable to use. If you don’t already have an SSH key, you must generate a new SSH key. If you’re unsure whether you already have an SSH key, check for existing keys. If you don’t want to re-enter your passphrase every time you use your SSH key, you can add your key to the SSH agent, which manages your SSH keys and remembers your passphrase, or yu generate a key whitch don’t need an Password (but not so much secure) Generating a new SSH key Open Terminal. Paste the text below, substituting in your GitHub email address. ssh-keygen -t rsa -b 4096 -C "[email protected]" This creates a new ssh key, using the provided email as a label. Generating public/private rsa key pair. When you are prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location. Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter] At the prompt, type a secure passphrase. For more information, see: “Working wiht ssh key passphrases”.

Continue reading

Google: Besser suchen mit Operatoren – Liste mit Suchoperatoren

Inhaltsverzeichnis Art Suchoperator Web allinanchor:, allintext:, allintitle:, allinurl:, cache:, define:, filetype:, id:, inanchor:, info:, intext:, intitle:, inurl:, movie:, phonebook:, related:, site: Bildersuche allintitle:, allinurl:, filetype:, inurl:, intitle:, site: Groups allintext:, allintitle:, author:, group:, insubject:, intext:, intitle: Verzeichnis allintext:, allintitle:, allinurl:, ext:, filetype:, intext:, intitle:, inurl: News allintext:, allintitle:, allinurl:, intext:, intitle:, inurl:, location:, source: Shopping allintext:, allintitle: Erklärungen Die Keywords sollten immer direkt hinter dem Doppelpunkt stehen, ohne ein Leerzeichen dazwischen. Außerdem sollte man darauf achten, den Operator immer so weit wie möglich nach Rechts zu stellen, wie möglich. Zwar funktionieren einige Operatoren auch am Anfang des Search-Querys (der Suchanfrage), aber einige nicht. Um sicher zu gehen, sollte der Operator also am Ende stehen. allinanchor: Wenn man den Suchbegriffen den Operator allinanchor: voranstellt, zeigt Google nur diejenigen Seiten an, bei denen die darauf verweisenden Links alle gewünschten Keywords im Linktext enthalten. Beispiel: Die Suche nach “allinanchor: best museums sydney” gibt nur Seiten aus, auf die mit den Wörtern “best”, “museums” und “sydney” verlinkt wird. Beim Benutzen von allinanchor: bitte _keine weitern Operatoren_benutzen. allintext: Mit diesem Operator werden nur Ergebnisse angezeigt, in denen alle angegebenen Keywords im Text der Seite vorkommen. Es müssen alle Begriffe im Seitentext vorkommen, der Seitentitel, die Adresse, etc.

Continue reading

Häufig benutzte UNIX / Linux Befehle (incl. Beispiel)

Dieser Artikel enthält viele praktische Beispiele für die am häufigsten unter Linux / UNIX verwendeten Befehle. 0x01. tar Befehls Beispiele Erstellen eines Tar-Archives tar cvf archive_name.tar dirname/ Dateien aus einem bestehenden Tar-Archiv extrahieren tar xvf archive_name.tar Ein bestehendes Tar-Archiv ansehen tar tvf archive_name.tar 0x02. grep Befehls Beispiele Suche nach einem vorgegebenen String in einer Datei (case in-sensitive search). grep -i "the" demo_file Die gefundene Zeile + 3 Zeilen danach ausgeben grep -A 3 -i "example" demo_text Suche nach einem String in allen Dateien recursive grep -r "ramesh" * 0x03. find Befehls Beispiele Find files using file-name ( case in-sensitve find) find -iname "MyCProgram.c" Execute commands on files found by the find command find -iname "MyCProgramcode.c" -exec md5sum {} ; Find all empty files in home directory find ~ -empty 0x04. ssh Befehls Beispiele Login to remote host ssh -l jsmith remotehost.example.com Debug ssh client ssh -v -l jsmith remotehost.example.com Display ssh client version ssh -V OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 18 2021 0x05. sed Befehls Beispiele When you copy a DOS file to Unix, you could find rn in the end of each line. This example converts the DOS file format to Unix file format using sed command. sed 's/.$//' filename

Continue reading

How to - Email von der Linux cmd versenden

The Linux command line can be very powerful once you know how to use it. You can parse data, monitor processes, automate backups and do a lot of other useful and cool things using it. There often comes a need to generate a report and mail it out. It could be as simple a requirement as a notification that the day’s backup went through fine, or did not. I’ll help you get started with sending mails from the Linux command line and in shell scripts. We will also cover sending attachments from the command line. We will begin with the “mail” command. MAIL First run a quick test to make sure the “sendmail” application is installed and working correctly. Execute the following command, replacing “[email protected]” with your e-mail address. [root@php-faq]# mail -s "Hello world" [email protected] Hit the return key and you will come to a new line. Enter the text “This is a test from my server”. Follow up the text by hitting the return key again. Then hit the key combination of Control+D to continue. The command prompt will ask you if you want to mark a copy of the mail to any other address, hit Control+D again. Check your mailbox.

Continue reading

HowTo - Bilder zu einem Video machen - shellscript

Aufgabe: you have 90 pictures of various sizes, taken in different formats and shapes. Using all sorts strange file names. Make a movie out of all of them, with the images using the correct aspect ratio. And add music. Use only command line tools on Linux. Lösung: this is a solution, you can most likely solve this in 50 other ways as well. And by posting it here, I can find it myself if I ever want to do the same stunt again… #!/bin/sh j=0 # convert options pic="-resize 1920x1280 -background black -gravity center -extent 1920x1080" # loop over the images for i in `ls *jpg | sort -R`; do echo "Convert $i" convert $pic $i "pic-$j.jpg" j=`expr $j + 1` done # now generate the movie mp3="file.mp3" echo "make movie" ffmpeg -framerate 3 -i pic-%d.jpg -i $mp3 -acodec copy -c:v libx264 -r 30 -pix_fmt yuv420p -s 1920x1280 -shortest out.mp4 Erklärung Dies ist ein Shellscript The ‘pic’ variable holds command line options for the ImageMagick ‘convert‘ tool. It resizes each picture to 1920×1280 while maintaining aspect ratio and if the pic gets smaller, it is centered and gets a black border. The loop goes through all files matching *,jpg, randomizes the order with ‘sort’ and then runs ‘convert’ on them one by one and calls the output files pic-[number].

Continue reading

SED Onliner

ZEILEN-ABSTÄNDE: # Doppelter Zeilenvorschub sed G # Doppelter Zeilenabstand für Dateien, die Leerzeilen enthalten. # Die Ausgabe sollte keine zwei aufeinander folgenden Leerzeilen enthalten. sed '/^$/d;G' # Dreifacher Zeilenvorschub sed 'G;G' # Doppelter Zeilenvorschub rückgängig machen # (Annahme: jede zweite Zeile ist leer) sed 'n;d' # Füge eine Leerzeile über jeder Zeile ein, die "regex" enthält sed '/regex/{x;p;x;}' # Füge eine Leerzeile unter jeder Zeile ein, die "regex" enthält sed '/regex/G' # Füge eine Leerzeile über und unter jeder Zeile ein, die "regex" enthält sed '/regex/{x;p;x;G;}' Nummerierung # Nummeriere alle Zeilen (linksbündig). Der Tabulator anstelle von Leerzeichen # erhält den Rand. (siehe auch die Bemerkung zu '\\t' am Ende dieser Datei) sed = filename | sed 'N;s/\\n/\\t/' # Nummeriere alle Zeilen (Zahl rechtsbündig in linker Spalte) sed = filename | sed 'N; s/^/ /; s/ \*\\(.\\{6,\\}\\)\\n/\\1 /' # Nummeriere alle Zeilen, aber die Nummern von Leerzeilen werden nicht ausgegeben. sed '/./=' filename | sed '/./N; s/\\n/ /' # Zeilen zählen (Nachahmung von "wc -l") sed -n '$=' TEXT UMWANDLUNG UND ERSETZUNG: # IN EINER UNIX UMGEBUNG: Wandle DOS Zeilenvorschübe (CR/LF) in das Unix-Format. sed 's/.$//' # Annahme: Alle Zeilen enden mit CR/LF sed 's/^M$//' # Bei bash/tcsh: Ctrl-V dann Ctrl-M sed 's/\\x0D$//' # für ssed, gsed 3.

Continue reading

Überprüfen ob ein Prozess aktiv ist

Das Standard-Tool zur Anzeige laufender Prozesse ist ja eigentlich ps. Um damit aber schnell zu erkennen, ob ein Prozess mit einem bestimmten Namen läuft und wie die Prozess-ID (PID) lautet, müssen Sie ps schon mit grep verketten, das alle nicht zutreffenden Prozesse aus der Antwort ausfiltert. Mit pgrep ist das dagegen ganz leicht: Einfach den Prozessnamen als Parameter angeben und es liefert die PIDs aller Prozesse zurück, bei denen die angegebene Zeichenfolge im Namen vorkommt. Es gibt noch zwei interessante Zusatzparameter für pgrep. So finden Sie zum Beispiel heraus, ob der Beagle-Dämon für den User “uwe” läuft: pgrep -u uwe beagled Um statt der Prozess-ID den Namen als Antwort zu erhalten, verwenden Sie den Parameter -l. So erhalten Sie zum Beispiel die Namen aller aktiver Prozesse, die mit top zu tun haben: pgrep -l top

Continue reading

Unix Sed Tutorial: Advanced Sed Substitution Examples

Sed Substitution Delimiter As we discussed in our previous post, we can use the different delimiters such as @ % | ; : in sed substitute command. Let us first create path.txt file that will be used in all the Beispielen mentioned below. cat path.txt /usr/kbos/bin:/usr/local/bin:/usr/jbin:/usr/bin:/usr/sas/bin /usr/local/sbin:/sbin:/bin/:/usr/sbin:/usr/bin:/opt/omni/bin: /opt/omni/lbin:/opt/omni/sbin:/root/bin Beispiel 1 sed @ delimiter: Substitute /opt/omni/lbin to /opt/tools/bin When you substitute a path name which has ‘/’, you can use @ as a delimiter instead of ‘/’. In the sed Beispiel below, in the last line of the input file, /opt/omni/lbin was changed to /opt/tools/bin. sed 's@/opt/omni/lbin@/opt/tools/bin@g' path.txt /usr/kbos/bin:/usr/local/bin:/usr/jbin/:/usr/bin:/usr/sas/bin /usr/local/sbin:/sbin:/bin/:/usr/sbin:/usr/bin:/opt/omni/bin: /opt/tools/bin:/opt/omni/sbin:/root/bin Beispiel 2 sed / delimiter: Substitute /opt/omni/lbin to /opt/tools/bin When you should use ‘/’ in path name related substitution, you have to escape ‘/’ in the substitution data as shown below. In this sed Beispiel, the delimiter ‘/’ was escaped in the REGEXP and REPLACEMENT part. sed 's/\\/opt\\/omni\\/lbin/\\/opt\\/tools\\/bin/g' path.txt /usr/kbos/bin:/usr/local/bin:/usr/jbin/:/usr/bin:/usr/sas/bin /usr/local/sbin:/sbin:/bin/:/usr/sbin:/usr/bin:/opt/omni/bin: /opt/tools/bin:/opt/omni/sbin:/root/bin Sed ‘&’ Get Matched String The precise part of an input line on which the Regular Expression matches is represented by &, which can then be used in the replacement part. Beispiel 1 sed & Usage: Substitute /usr/bin/ to /usr/bin/local sed 's@/usr/bin@&/local@g' path.txt /usr/kbos/bin:/usr/local/bin:/usr/jbin/:/usr/bin/local:/usr/sas/bin /usr/local/sbin:/sbin:/bin/:/usr/sbin:/usr/bin/local:/opt/omni/bin: /opt/omni/lbin:/opt/omni/sbin:/root/bin In the above Beispiel ‘&’ in the replacement part will replace with /usr/bin which is matched pattern and add it with /local.

Continue reading

10 nützliche Console Tools für Linux User

In diesem Tutorial habe ich 10 sehr nützliche Linux Konsolen Programme zum Thema Monitoring zusammengefasst: atop ccze dstat findmnt ncdu nmon saidar slurm ss w xkill Table of Contents w nmon ncdu slurm findmnt dstat ss ccze ranwhen more w Zeigt wer gerade am System angemeldet ist und welche Prozesse er ausführt. w Für Hilfe: w -hn Für den aktuellen Benutzer: w <username> nmon Nmon oder Nigel’s monitor ist ein Tool welches die Performance Informationen des Systems darstellt. apt-get install nmon nmon nmon kann Infos Dumps vom Netzwerk, CPU, Speicher oder Festplatten Auslastung erstellen. nmon cpu info (drücke c-Taste) nmon network info (drücke n-Taste) nman disk info (drücke d-Taste) ncdu Das Command Line Werkzeug nsdu ist eine Cursor basierte Version von du. Dieses Kommando wird verwenden um die Festplatten Nutzung der Verzeichnisse darzustellen. apt-get install ncdu ncdu / Ausgabe: Das Drücken der Taste n sortiert nach Name - das Drücken der Taste s sortiert nach Dateigröße (size = default) slurm Ein Konsolen Tool zum Bandweiten Monitoring von Netzwerk Interfaces. Die Darstellung erfolgt in ASCII basierenden Grafiken. apt-get install slurm Beispiele: slurm -i <interface> slurm -i eth1 Optionen Press l to display lx/tx led. press c to switch to classic mode.

Continue reading

150+ Vim Befehle die jeder Vim Coder kennen sollte

Seit etwa den 70er Jahren ist vi und vim zu den beliebtersten Text Editoren. Die folgende Sammlung enthält eine Liste von mehr als Hundert teils sehr nützlichen vim Kommandos. Allgemein :e filename Öffnet eine neue Datei. Sie können die Tab-Taste für die automatische Dateinamensvervollständigung genauso wie an der Shell-Eingabeaufforderung.nutzen. :w Speichern Sie die Änderungen in einer Datei. Wenn Sie keinen Dateinamen angeben, speichert Vim als Dateiname Sie. Für die Speicherung der Datei unter einem anderen Namen, geben Sie den Dateinamen ein. :q Wenn nicht gespeicherte Änderungen haben, weigert sich Vim vor der Beendigung. :q! Beenden ohne zu speichern :x Fast das gleiche wie :wq - die Datei speichern und verlassen, falls Sie Änderungen an der Datei vorgenommen haben. Wenn Sie keine Änderungen an der Datei vorgenommen haben, beendet sich Vim ohne die Datei zu schreiben. :sav filename Speichert die Datei als Dateinamen . Wiederholt die letzte Änderung die im Normal Mode gemacht wurde Wiederholt 5 mal die letzte Änderung im Normal Mode Shift+ZZ Alternative Art und Weise um zu speichern und Vim zu beenden :wq Schreiben der Datei und Exit Bewegung in Dateien k or Up Arrow move the cursor up one line j or Down Arrow move the cursor down one line

Continue reading

20 interessante Sysstat Befehle zum Performance Monitoring

Heute werden ich ein paar praktisch interessante Beispiele zu den Linux Tools mpstat, pidstat, iostat und sar zeigen, welche einem z.B. helfen können einen Fehler zu finden. Es gibt verschiedene Optionen um diese Werkzeuge zu verwenden. Damit will ich sagen, das man Kommandos manuell mit verschiedenen Optionen für viele verschiedene Tätigkeiten verwenden kann. Oder man baut sich je nach Anforderungen ein angepasstes shell script. Es ist ja bekannt, dass Sysadmins meist ein wenig faul sind, weswegen Sie ständig nach einfacheren Wegen suchen um die Dinge möglichst einfach und unkompliziert zu lösen. 1.) mpstat – Processor Statistiken Verwendet man den mpstat Befehl ohne Option, so wird der globale Durchschnitt aller CPU Aktivitäten angezeigt. root@linux~ $ mpstat Linux 3.12.0-25-generic (lxu.io) Monday 01 September 2015 _i686_ (4 CPU) 12:23:57 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:23:57 IST all 37.35 0.01 4.72 2.96 0.00 0.07 0.00 0.00 0.00 54.88 2.) Verwendet man mpstat mit der Option "-P" (Prozessornummer) und “ALL” so werden Statistiken über alle CPUs angezeigt. Die Anzeige startet dabei bei 0. 0 Ist damit der erste Wert root@linux~ $ mpstat -P ALL Linux 3.12.0-25-generic (lxu.io) Monday 01 September 2015 _i686_ (4 CPU) 12:29:26 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 12:29:26 IST all 37.

Continue reading

20 Linux CLI Tips

You making most out of the Linux? There are lots of helpful features which appears to be Tips and Tricks for many of Linux Users. Sometimes Tips and Tricks become the need. It helps you get productive with the same set of commands yet with enhanced functionality. Here we are starting a new series, where we will be writing some tips and tricks and will try to yield as more as we can in small time. 0x01. history To audit the commands we’d run in past, we use history command. Here is a sample output of history command. # history Obvious from output, the history command do not output the time stamp with the log of last executed commands. Any solution for this? Yeah! Run the below command. HISTTIMEFORMAT="%d/%m/%y %T " # history If you want to permanently append this change, add the below line to ~/.bashrc. export HISTTIMEFORMAT="%d/%m/%y %T " and then, from terminal run, source ~/.bashrc Explanation of commands and switches. history – GNU History Library HISTIMEFORMAT – Environmental Variable %d – Day %m – Month %y – Year %T – Time Stamp source – in short send the contents of file to shell .bashrc – is a shell script that BASH runs whenever it is started interactively.

Continue reading

20 Linux System Monitoring Tools Every SysAdmin Should Know

[] Need to monitor Linux server performance? Try these built-in commands and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as: Finding out bottlenecks. Disk (storage) bottlenecks. CPU and memory bottlenecks. Network bottlenecks. #1: top - Process Activity Command The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. [] Commonly Used Hot Keys The top command provides several useful hot keys: Hot Key Usage ​ t Displays summary information off and on. ​ m Displays memory information off and on. ​ A Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system. ​ f Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.

Continue reading

30 du/df Linux-CMD Beispiele

In this post, we will be discuss the command “du” or disk usage. The du command is a handy command to check folder/file sizes in Linux. This command comes with lots of options which when combining them together can give you a very powerful way to check file/folder size usage of your disk. Syntax for Linux du command du [OPTION]… [FILE]… Basic du command usage Beispiels Beispiel 0x001: Execute du command with no options. As you can see in this Beispiel, using du without any option will list folders recursively by default the size of each file under the directory you chose. The file size here is shown in KB by default. It will show the hidden files and the size of the parent directory as an entry, and the child directories as separate entries. However it will go up to the last directory [root@lxu mnt /]# du /opt 5 /opt/rh 7 /opt Beispiel 0x002: If you dont want to see output in KB’s, use the -h option for a human readable output. Adding the -h option will give you the output in a more readable file size format, with base 1024, it will show the 1024 KB file as 1M which is more easier to read.

Continue reading