Check These Out
% acts on every line in the file.
\s matches spaces.
\+ matches one or more occurrences of what's right behind it.
Character '$' matches end-of-line.
Rather than complicated and fragile paths relative to a script like "../../other", this command will retrieve the full path of the file's repository head. Safe with spaces in directory names. Works within a symlinked directory. Broken down:
$cd "$(dirname "${BASH_SOURCE[0]}")"
temporarily changes directories within this expansion. Double quoted "$(dirname" and ")" with unquoted ${BASH_SOURCE[0]} allows spaces in the path.
$git rev-parse --show-toplevel
gets the full path of the repository head of the current working directory, which was temporarily changed by the "cd".
List all process running a specfic port
This uses mpg123 to convert the files to wav before burning, but you can use mplayer or mencoder or ffmpeg or lame with the --decode option, or whatever you like.
Sometimes you only want to linsten the audio while output the video will be a waste of CPU resource and an annoying window. With option -vo null, you will enjoy the audio!
On command mode in Vim you can save parts of the current buffer in another file.
* The 'n' value represents the first line of the new file.
* The 'm' value represents the last line of the new file.
* newfile.txt is the newfile.
The results are similar to this command in perl:
$ perl -ne 'print if n..m' in.sql > out.sql
Adapted from http://stackoverflow.com/questions/1358540/how-to-count-all-the-lines-of-code-in-a-directory-recursively#answer-1359246
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Assumes you have ffmpeg and oggenc.
Similar to other scripts here, but this time outputting to Ogg Vorbis.
I added the variable assignment for a nice output name.
This is part of an interactive bash script I have with a few little multimedia tasks in it.
http://www.dward.us/software/VSAK.sh