I am Deborah.
Check out my work
or read my blog.

Linux Console Snippets

Absolutely random compilation of things I need to remember. Might grow.

How to mount USB stick [source]

  1. Find the drive identifier after plugging the USB stick in (something like /dev/sdc1) sudo fdisk -l
  2. Create folder to mount the drive and mount it there sudo mkdir /media/usb-stick
    sudo mount /dev/sdc1 /media/usb-stick

How to find files in packages

  • .. How to find files in installed packages, e.g. if you are looking for a source file called xyz.h: dpkg --search xyz.h
  • .. How to find files in available packages that might be not installed:sudo apt-get install apt-file
    apt-file update
    apt-file search xyz.h

Backup and restore GPG keys [source]

  1. List public GPG keys: gpg --list-keysThe key_id is the part after something like “pub 1024D/”.
  2. Export public GPG key: gpg -ao xyz-public.key --export key_id
  3. List secret GPG keys: gpg --list-secret-keysThe key_id is the part after something like “sec 1024D/”.
  4. Export secret GPG key: gpg -ao xyz-private.key --export-secret-keys key_id
  5. Restore GPG keys: gpg --import xyz-public.key
    gpg --import xyz-private.key

Backup and restore installed packages

  1. Save installed packages as list in file:dpkg --get-selections > selections.txt
  2. Install package list from file:
    dpkg --set-selections < selections.txt
    sudo apt-get update
    sudo apt-get dselect-upgrade
    sudo apt-get dist-upgrade
    sudo apt-get upgrade

Network usage

  • Bandwidth usage by program How much bandwith is used by running programs:
    sudo nethogs wlan0
  • Traffic in local network
    sudo iftop -i wlan0
  • Port usage by program
    sudo netstat -taupen

Say something

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Posts from "Blog":

Quick, Draw! Generic drawings part 2The Art of CodingImperfect MandalasAutumn LeafsColor Explosion #25 years of KAZOOSH!Color explosionUbuntu 15.10, MongoDB and node.jsKaleidoscope of Fencinggit cheat sheetFractalsofxSortableListCrocket: hairband with jeans buttonWall painting for Marias birthdayLinux / Ubuntu + Serato Vinyl Control System + Pure DataWicket-Bootstrap – Navbar and Pageparameters – setting the active itemLinux Console SnippetsCrawling Traces @German award for multimedia mb21Crawling Traces History ViewerStreaming new.livestream.com with VLC and UbuntuCrawling Traces at Hechtfest / hechtgruenLinks: Data Security, Social Networks and Secure MailingFix: VMware Player crash on Ubuntu 13.04Xubuntu: Fix for Dockbarx bug not starting Thunar or TerminalUbuntu 12.10, libwebsockets and OFSetting up Meteor with Ubuntu 12.10 on an NTFS share partitionWebsite: KAZOOSH!Intermediate IsolinesThe barn door gets coloredSkype on Ubuntu 10.10 or 11.04 64bitElitebook 8440p vs UbuntuKryptografie & Datensicherheit – NotizenRandom Compilation IIRandom Compilation IAll You Can Eat in DresdenWebauftritt: ESE 2010