Wednesday, February 22, 2012

"Unblock" files recursively with Streams from Sysinternals

If you're moving files (i.e. a asp.net website) from another computer to a server running Windows 2008 Server (or similarly new version) you'll risk having to unblock all the files one-by-one as they are deemed "not safe". I'm guessing this can be rectified by the network/domain/whatever-admins by defining what parts of the network is considered safe to copy files from.

But if they aren't doing it you can use Streams to recursively unblock an entire directory and it's very easy to use.

Monday, February 20, 2012

tmux - Resize pane to specific width and height

Quick post on how to resize a tmux-pane to a specific width and height.
I'm presuming you only have one session and that you've changed base-index to 1 and your prefix key combo to ctrl+a (ctrl+b is silly).

Sunday, February 19, 2012

CRON - cause I always forget

The cron format.
# .---------------- minute (0 - 59)
# |    .------------- hour (0 - 23)
# |    |    .---------- day of month (1 - 31)
# |    |    |    .------- month (1 - 12) OR jan,feb,mar,apr ...
# |    |    |    |    .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat
# |    |    |    |    |
# *    *    *    *    *    [command to be executed]
I addition to the above syntax you can use the following, more easily remembered, special words.
@yearly, @monthly, @daily, @hourly, @reboot (at startup)
These are however not available in every cron daemon.

Every minute
* * * * * /miff/moff/meff.sh
Every five minutes
*/5 * * * * /miff/moff/meff.sh
Every two minutes the first half hour of every hour
0-30/2 * * * * /miff/moff/meff.sh

More examples can be found here.

Saturday, February 04, 2012

Openbox - Simple application-rule example in rc.xml

Update: Or you could use Obapps (and while you're at it try Obthemes) to set these rules up in a GUI. ;)

In openbox, the only wm you'll ever need (imho(tm)), you can set up rules for application windows. You can define where the window will appear, whether it should be decorated, shades or minimized (iconic). These rules are pretty simple to understand, but examples are always helpful so here goes.