thefekete.net

$> :(){ :|:& };:

Quickly check line character maximums from the command line

If you want to make sure you didn’t go over 79 or 80 characters in a file you can simply run:

#!/bin/bash
grep -Pn '.{80,}' file-to-check

This uses grep’s perl regex option (-P) so we can use the expression .{80,} to find any lines that have >= 80 characters. The -n option prints the line numbers in the output so you can find them easily.

Change volume from command line

To change the system volume from bash (on ubuntu) do the following:

#!/bin/bash

# To raise the volume by 3%:
amixer -c 0 set Master 3+

# To lower the volume by 3%:
amixer -c 0 set Master 3-

EncFS Encrypted Folder Video Tutorial / HowTo

This is from datastorageunit.com’s support section. They provide data storage services over ssh/rsync. There’s no audio, but the author comments in the terminal and has an overview text to the left.

I know its a windows computer in the screen, but its all done on a linux server through ssh.

Enjoy…

Word wrap as you type in vim (with newlines inserted)

To enable word wrap in vim with automatic newlines:

enter command mode (ESC) and type :set textwidth=70 or add it to your ~/.vimrc

Just be careful when editing files that care about newlines!

git auto-readme hook script

Here’s a handy little script for your .git/hooks folder…

I’ve been getting into git and along with that, I’ve been trying to be more standards minded. Part of that entails including a LICENSE and README file. The LICENSE file is as ease as:

wget -q -O - http://www.gnu.org/licenses/gpl.txt > LICENSE

Its the README that can be a real pain. But, I found a way to make it a little easier.

Read the rest of this entry »