background preloader

Shell Scripting

Facebook Twitter

UsbDriveDoSomethingHowto. Introduction This article describes how to automatically run a script when a USB drive is inserted. 'Hot-plugging' means inserting/removing a drive while a computer is turned on.

UsbDriveDoSomethingHowto

To hotplug, in System/Preferences/Removal Drives and Media, Storage tab must be set to "mount removal drives when hot-plugged". Often, you may want to automate things when connecting a USB drive (USB Stick, external USB harddisk) to your computer. Typical use cases are: you want to copy images from a flash drive to your photo collection, delete them on the usb drive, and show them automatically you connect a USB harddisk to the computer and the computer should backup some data to it you connect an encrypted usb store and want the system to mount the encrypted harddisk This used to be done with hotplug but in Ubuntu 6.06 (Dapper Drake) and later is done using udev and module-init-tools. What you need to do is setup a script that is triggered when the device is plugged in. THIS HOWTO DOES NOT WORK YET. Method Overview. The Ultimate Wget Download Guide With 15 Awesome Examples. Wget utility is the best option to download files from internet. wget can pretty much handle all complex download situations including large file downloads, recursive downloads, non-interactive downloads, multiple file downloads etc., In this article let us review how to use wget for various download scenarios using 15 awesome wget examples. 1.

The Ultimate Wget Download Guide With 15 Awesome Examples

Download Single File with wget The following example downloads a single file from internet and stores in the current directory. $ wget While downloading it will show a progress bar with the following information: %age of download completion (for e.g. 31% as shown below)Total amount of bytes downloaded so far (for e.g. 1,213,592 bytes as shown below)Current download speed (for e.g. 68.2K/s as shown below)Remaining time to download (for e.g. eta 34 seconds as shown below) Download in progress: $ wget Saving to: `strx25-0.9.2.1.tar.bz2.1' 31% [=================> 1,213,592 68.2K/s eta 34s. IFS variable. A complete zenity dialog examples 2. April 22nd, 2007 mysurface Posted in lsof, tee, X11, zenity | Hits: 354724 | 65 Comments » This is a continues post of A complete zenity dialog examples 1, in this post we will covers zenity dialog for progress, question, warning, scale, text info and list.

A complete zenity dialog examples 2

How to create zenity progress dialog? Progress dialog is to track a progression of a routine, it can be anything, let say I want store the results list of open files (lsof) into a file call lsof.txt, and uses zenity progress to track the progression, I do this: gksudo lsof | tee >(zenity --progress --pulsate) >lsof.txt I need to use tee, because without using tee, zenity will strip off my result output. How to create zenity question dialog? Zenity --question --text "Are you sure you want to shutdown? " As echo $? How to create zenity warning dialog?

Zenity --warning --text "This will kill, are you sure? " Zsh Tips, Tricks and Examples by zzapper. Zzappers Tips Home Updated : 29Jun17 *N* Marks New *C* Corrected/Changed > zsh -f # start a "clean" version of zsh (without your startup files) print $ZSH_VERSION Tips Home Daily ZSH Tip on Twitter *N* ZSH TIPS on Twitter Archive Searchable Mailing List Archive ZSH Users Newsgroup Searchable Mailing List Archive *N* Everything?

Zsh Tips, Tricks and Examples by zzapper

*C* Zsh-Reference-Card *C* latest version (Sourceforge) *N* oh my zsh Frameworkzsh IRC Channel: Instant help man zsh man zshall /usr/share/zsh/htmldoc/zsh_toc.html Install on Linux > yum install zsh *N* > yum update zsh *N* # install from source wget --no-check-certificate tar zxvf zsh-5.3.1.tar.gz cd zsh-5.3.1 && . # use tab to complete/display history item before executing !

# substitute previous command r oldstr=newstr !! Everything Linux - A Tutorial on Using Rsync. The UNIX School: awk & sed.