sudo apt-get install mp3gain dir=/music/EckhartTolle-StillnessSpeaks # fix replay gain for all songs in $dir for i in `ls -1 $dir`; do mp3gain -r -k $i; done
where:
-r: radio mode: apply track gain automatically
-k: prevent audio clipping
petrichor (/'pe - tri - kor'/) is the familiar scent of rain on dry earth
this tech blog is the wafting fragrance of my geeky outpourings, one post at a time
sudo apt-get install mp3gain dir=/music/EckhartTolle-StillnessSpeaks # fix replay gain for all songs in $dir for i in `ls -1 $dir`; do mp3gain -r -k $i; done
vnstat is a superb tool to monitor monthly bandwidth usage.
I get notified by my ISP when I hit my monthly download quota (25 GB) that my speed will now be reduced to 256 kbps. Sometimes I'm left wondering how the heck I hit 25 gigs of downloading. So I started looking for a tool on Ubuntu that would monitor my bandwidth usage and show me daily/weekly/monthly download totals.
Requirements: It should work silently and unobtrusively in the background, and it should start automatically on reboot like a daemon. It would be nice to have it display graphical graphs. Also nice to have it display realtime stats (e.g. current rx and tx speeds).
There are quite a few tools that I found: bandwidthd, bwmon, bwbar etc (complete list here: http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-ubuntu-users.html).
I didn't try all of them, but the most popular (or the one that appears at the top of the google search results for "bandwidth monitor tool ubuntu") is bandwidthd, and I just didn't have the patience to get it to work. There's no user manual, no real how-to and I gave up quickly on it.
vnstat saved the day. It exactly meets my requirements. You don't need to install it from the tarball either (in fact, that didn't work too well for me, I kept getting post-install configuration errors), and if you're on ubuntu, vnstat is in the standard apt repositories.
vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources.
[08:17:59] ~ $ vnstat -d
eth1 / dailyday rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
08/24/11 134.81 MiB | 7.24 MiB | 142.05 MiB | 13.47 kbit/s
08/25/11 84.21 MiB | 5.63 MiB | 89.85 MiB | 24.82 kbit/s
------------------------+-------------+-------------+---------------
estimated 244 MiB | 14 MiB | 258 MiB |[08:18:04] ~ $ vnstat -s
rx / tx / total / estimated
eth1:
Aug '11 219.02 MiB / 12.88 MiB / 231.90 MiB / 293.00 MiB
yesterday 134.81 MiB / 7.24 MiB / 142.05 MiB
today 84.21 MiB / 5.63 MiB / 89.85 MiB / 258 MiB
Here’s my typical prompt in mintty/cygwin:
[ambars@mintty 11:54:28 ~] $
And here’s the code: simply append to ~/.bashrc:
export PS1="[\u@mintty \e[0;33m\t\e[m \w] \$ "
Source:
Bash Shell PS1: 10 Examples to Make Your Linux Prompt like Angelina Jolie
alias diskhoggers='rpm -qa --qf "%10{SIZE}\t%{NAME}\n" | sort -n'
[root@noumPC ~]# diskhoggers | tail -n 30 15370931 bcel 15585349 gutenprint 15615584 gnome-applets 16021416 gcc 16574947 webkitgtk 16742780 nautilus 17773959 vim-common 18113087 firefox 18147692 libgweather 19693980 libicu 20174285 python 20250203 ghostscript 22082141 fedora-release-notes 22312309 kernel-devel 22371021 python-lxml 24697430 xulrunner 25032963 foomatic-db-ppds 25455524 libpurple 26376798 eclipse-jdt 29624088 perl 32984533 eclipse-platform 46820396 qt-x11 49233851 google-chrome-beta 49484310 valgrind 50371329 libgcj 80240654 kernel 84381565 kernel 85572888 java-1.6.0-openjdk 111799012 glibc-common 246952321 java-1.5.0-gcj-javadoc
rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1 -nFINALLY!
# safely add key to ssh-agent on login test=`ps -ef | grep ssh-agent | grep -v grep | awk '{print $2}' | xargs` if [ "$test" = "" ] then # there is no agent running if [ -e "$HOME/agent.sh" ] then # remove the old file rm -f $HOME/agent.sh fi # start a new agent ssh-agent | grep -v echo &> $HOME/agent.sh ssh-add /root/.ssh/id_rsa fi test -e $HOME/agent.sh && source $HOME/agent.sh
echo | mutt -s interesting_logs_please_check -a syslogs.tar.gz admin@domain.org, user1@domain.org, user2@domain.org
schtasks /create /sc hourly /mo 2 /tn "autoupdatesourcecode" /tr c:\tools\autoupdatesourcecode.bat
cd d:\Codebase\trunk\pi\ d: svn up
net stop winmgmt pause c: cd c:\windows\system32\wbem rd /S /Q repository regsvr32 /s %systemroot%\system32\scecli.dll regsvr32 /s %systemroot%\system32\userenv.dll mofcomp cimwin32.mof mofcomp cimwin32.mfl mofcomp rsop.mof mofcomp rsop.mfl for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s for /f %%s in ('dir /b *.mof') do mofcomp %%s for /f %%s in ('dir /b *.mfl') do mofcomp %%s mofcomp exwmi.mof mofcomp -n:root\cimv2\applications\exchange wbemcons.mof mofcomp -n:root\cimv2\applications\exchange smtpcons.mof mofcomp exmgmt.mof
[root@domain /root]# free -m
total used free shared buffers cached
Mem: 251 242 8 22 11 32
-/+ buffers/cache: 198 52
Swap: 133 133 0
[root@domain /root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda9 132207 33429 91952 27% /
/dev/hda1 15522 2537 12184 17% /boot
/dev/hda6 6143236 739000 5092176 13% /opt
/dev/hda7 1035660 836204 146848 85% /usr
/dev/hda5 2071384 344048 1622112 17% /usr/local
/dev/hda8 303344 14439 273244 5% /var
[root@domain /opt]# dd if=/dev/zero of=swapfile bs=1024 count=132207
132207+0 records in
132207+0 records out
[root@domain /opt]# ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw-r--r-- 1 root root 135379968 May 29 11:52 swapfile
[root@domain /opt]# chmod 600 swapfile
[root@domain /opt]# ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw------- 1 root root 135379968 May 29 11:52 swapfile
[root@domain /opt]# mkswap swapfile
Setting up swapspace version 1, size = 135372800 bytes
[root@domain /opt]# swapon swapfile
[root@domain /opt]# free
total used free shared buffers cached
Mem: 257632 254632 3000 2512 36172 15096
-/+ buffers/cache: 203364 54268
Swap: 268708 136512 132196
/opt/swapfile swap swap defaults 0 0
Set SRP = GetObject( "winmgmts:\\.\root\default:Systemrestore" ) CSRP = SRP.CreateRestorePoint( "Before Changes", 0, 100 )
for i in *.avi do j=`echo $i | sed 's/mymovies/myflicks/g'` mv "$i" "$j" done
for i in *.avi; do j=`echo $i | sed 's/find/replace/g'`; mv "$i" "$j"; done
control userpasswords2
net user "%UserName%" ""{Enter}
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
I'll start by setting up a conditional format for the first data cell.
Later, I'll copy that conditional format for the whole range.
In my example, cell A1 contains
a
column heading (Invoice), so I will select cell A2, and then click Conditional Formatting
on the Format
menu. The Conditional Formatting dialog box opens.
The first box contains the text,
Cell Value Is. If you click the arrow next to this box, you can choose Formula Is.
After you click
Formula Is, the dialog box changes appearance. Instead of boxes for between x and y,
there is now a single formula box. This formula box is incredibly
powerful. You can use it to enter any formula that you can dream up, as
long as that formula will evaluate to TRUE or FALSE.
In this case, we need to use a COUNTIF formula. The formula to type in the box is:
=COUNTIF(A:A,A2)>1
This formula says: Look through the entire
range of column A. Count how many cells in that range have the same
value as cell A2. Then, compare to see if that count is greater than 1.
When there are no duplicates, the count will always be 1; because
cell A2 is in the range, we should find exactly one cell in column A
that contains the same value as A2.
Note In this formula, A2 represents the current
cell — that is, the cell for which you are setting up the conditional
format. So, if your data is in column E and you are setting up the
first conditional format in cell E5, the formula would be =COUNTIF(E:E,E5)>1
.
Now it is time to select an obnoxious (that is, obvious) format to identify any duplicates that are found. In the Conditional Formatting dialog box, click the Format button.
Click the Patterns tab and click a bright color swatch, like red or yellow. Then click OK to close the Format Cells dialog box.
You will see the selected format in the preview box. Click OK to close the Conditional Formatting dialog box, and…
Nothing happens. Wow. If this is your first time setting up
conditional formatting, it would be really nice to get some feedback
here that it worked. But, unless you are lucky enough that the data in
cell A2 is a duplicate of the data in some other cell, the condition is
FALSE and no formatting is applied.
You need to copy the conditional formatting from cell A2 down to the
other cells in your range. With the cursor sill in A2, click Copy on the Edit menu. Press CTRL+Spacebar to select the entire column. Then click
Paste Special on the Edit menu. In the Paste Special dialog, click Formats, and then click OK.
This will copy the conditional formatting to all cells in the column.
Now — finally — you may see some cells with the colored fill
formatting, indicating that you have a duplicate.
It is informative to go to cell A3 and look at the conditional formula
(after you've copied it from A2). Select cell A3 and click
Conditional Formatting
on the Format menu. The formula in the Formula Is box has changed to count how many times the data in cell A3 appears in column A.
You can have up to 65536 cells with conditional formatting, each
cell comparing the current cell to 65535 other cells. Technically, the
formula in the first step could have been =COUNTIF($A$2:$A$1751,A2)>1
.
Also, when copying the conditional format to the entire column, you could have selected just the cells
that contained data before using the Paste Special command.