Rawr!!!

`Punch` a Useful Feature Into todo.txt

November 5th, 2011 by

After using todo.txt for years, I’ve realized that a crucial feature has been missing. I’ve been doing tasks, completing them; and then wondering curiously how much time I spent on something after the fact. Well after a quick googling; I found punch-time-manager, and was rewarded with a punch card style time tracking utility. It has a simple punch in/out feature with a reporting function similar to todo.txt. After using punch-time-management for the past couple weeks, I love it; and hope you’ll come to love it too.

  1. Setup todo.txt & punch-time-tracking
    # Archlinux && yaourt (automagic)
    yaourt -S todotxt punch-time-tracking
    
    # Manual way
    wget http://cloud.github.com/downloads/ginatrapani/todo.txt-cli/todo.txt_cli-2.8.tar.gz
    wget https://punch-time-tracking.googlecode.com/files/punch-time-tracking-1.3.zip
    
    tar xf todo.txt_cli-2.8.tar.gz
    unzip punch-time-tracking-1.3.zip
    
    # read the readme for todo.txt && setup
    
    # You can add the executables (Punch.py & todo.sh) into a PATH dir or add to .bashrc || .zshrc
    # This is what I have in my .zshrc
    alias todo='/usr/bin/todo.sh -n -d ~/Dropbox/Public/todo.txt/todo.cfg'
    
  2. Modify Punch.py with todo.cfg location
    # edit /usr/bin/punch (or Punch.py if you manually setup)
    
    # locate the following && add your config location...
    files = [ "todo.cfg", ".todo.cfg" ]
    
    ## add your specific location if it's different from the predefined defaults
    files = [ "todo.cfg", ".todo.cfg", "Dropbox/Public/todo.txt/todo.cfg" ]
    
  3. After setup, add a task to your todo & punch it:
    [fsk141@Hot ~]$ punch in 21
    Start timer on: todo/punch post
    
    [fsk141@Hot ~]$ punch what
    Active task: todo/punch post (0 minutes)
    
    [fsk141@Hot ~]$ punch out
    Stop timer on: todo/punch post
    
    [fsk141@Hot ~]$ punch report
    2011-10-28 (1 hours 43 minutes):
    	do some domain moving... (12 minutes)
    	mutt (1 hours 31 minutes)
    	zfs (0 minutes)
    2011-10-29 (0 minutes):
    	Transdroid (0 minutes)
    2011-11-05 (0 minutes):
    	todo/punch post (0 minutes)
    

[fix] PTY allocation request failed on channel 0 (Arch Linux VPS)

Another problem with the new glibc & old kernel pair, anywho; this is an easy fix, just remember to do it before you logout, or it’s a little painful (unless you have root privs)

  1. Start with adding the correct entries to /etc/fstab:
    #
    # /etc/fstab: static file system information
    #
    # <file system>    <dir>    <type>    <options>    <dump>    <pass>
    devpts                 /dev/pts      devpts    defaults            0      0
    shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
    
  2. Then add the following to /etc/rc.local
    rm -rf /dev/ptmx
    mknod /dev/ptmx c 5 2
    chmod 666 /dev/ptmx
    umount /dev/pts
    rm -rf /dev/pts
    mkdir /dev/pts
    mount /dev/pts
    
  3. Reboot, and cross your fingers for success; hopefully everything will be okay :)

WAIT, I rebooted, and can’t access my vps, how do I fix this?

Well a couple solutions include you logging into a serial console and running the commands.

Or if you have root access availiable you can login with:


ssh yourserver.com '/bin/bash -i' #Run all the same procedures as above, reboot

Otherwise you’re kinda screwed, and just have to reinstall your VPS, and fix the issue before you reboot…

Standardy CSS

June 26th, 2011 by

In the general spirit of reset.css (http://meyerweb.com/eric/tools/css/reset), and to help out with some styling for the Fsk141 Framework I’ve pulled together what I call Standardy.css. What it is should help make a standard look across all browsers (well a starting point anyway) For everything that reset.css takes away, this puts it back in a cross browser compliant css method. I just whipped this up last night, and have started testing; everything seems to be alright thus far.
You can view standardy.css below; or download from here: standardy.css

/* Standardy CSS (to use in conjunction with reset.css)
 *
 * License: none (public domain)
 *
 * Pulled together from around the internet &amp; optimized by Jonny Gerold &lt;jonny@fsk141.com&gt;
 *
 */

address,blockquote,body,dd,div,dl,dt,fieldset,form,frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,ol,p,ul,applet,center,dir,hr,menu,pre { display:block; }
li { display:list-item; }
head { display:none; }
table { display:table; }
tr { display:table-row; }
thead { display:table-header-group; }
tbody { display:table-row-group; }
tfoot { display:table-footer-group; }
col { display:table-column; }
colgroup { display:table-column-group; }
td,th { display:table-cell; }
caption { display:table-caption; text-align:center; }
th { font-weight:bolder; text-align:center; }
body { line-height:1.33; padding:8px; }
h1 { font-size:2em; margin:.67em 0; }
h2 { font-size:1.5em; margin:.83em 0; }
h3 { font-size:1.17em; margin:1em 0; }
h4,p,blockquote,ul,fieldset,form,ol,dl,dir,menu { margin:1.33em 0; }
h5 { font-size:.83em; line-height:1.17em; margin:1.67em 0; }
h6 { font-size:.67em; margin:2.33em 0; }
h1,h2,h3,h4,h5,h6,b,strong { font-weight:bolder; }
blockquote { margin-left:40px; margin-right:40px; }
i,cite,em,var,address { font-style:italic; }
pre,tt,code,kbd,samp { font-family:monospace; }
pre { white-space:pre; }
big { font-size:1.17em; }
small,sub,sup { font-size:.83em; }
sub { vertical-align:sub; }
sup { vertical-align:super; }
s,strike,del { text-decoration:line-through; }
hr { border:1px inset; }
ol,ul,dir,menu,dd { margin-left:40px; }
ol { list-style-type:decimal; }
ol ul,ul ol,ul ul,ol ol { margin-bottom:0; margin-top:0; }
u,ins { text-decoration:underline; }
center { text-align:center; }
br:before { content:"\A"; }

Habari on Lighttpd

September 9th, 2009 by

I’ve used apache for the longest time, and it has served me very well. I still use apache to host this site, and many other sites. Yet I’ve grown an itch to try something new, and have ventured to lighttpd. It’s painless to setup, and the config file is one of the simplest around. Anywho after I switched over I tried to setup habari and hit a little snag. Habari uses a .htaccess file with apache to take advantage of mod_rewrite. Well lighttpd doesn’t support .htaccess, or any other directory independent configs :) . Anywho it’s simple enough to setup a rewrite in /etc/lighttpd/lighttpd.conf. Yet if you set the rewrite for the localhost, you are left with the habari site, and then anything else you want to develop has to mangle together. I wanted a simple solution that would allow me to run habari, yet not in the root of my web directory. Also I wanted ‘http://localhost’ to display my webroot contents (who needs an index file?)

Step 1) Edit your /etc/hosts, and add another faux host besides localhost:

#
# /etc/hosts: static lookup table for host names
#

#      
127.0.0.1       localhost.localdomain   localhost Minifsk
127.0.0.1       fsk141.localdomain      localhost Minifsk
# End of file

Step 2) Fire up your editor, and open /etc/lighttpd/lighttpd.conf

#uncomment "mod_rewrite" module

#add index.php to index file names
index-file.names = ( "index.php", "index.html",
                                "index.htm", "default.htm" )

#add a vhost
$HTTP["host"] =~ "^fsk141.localdomain$" {
  server.document-root = "/srv/http/Web/fsk141"
  url.rewrite-once =  (
        "^/(?!scripts/|3rdparty/|system/|doc/)(.*)$" =>  "/index.php"
  )
  server.errorlog = "/var/log/lighttpd/fsk141/error.log"
  accesslog.filename = "/var/log/lighttpd/fsk141/access.log"
}

#enable dir listing
dir-listing.activate       = "enable"

#uncomment fast-cgi stuf:
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" => "/usr/bin/php-cgi"
                                 )
                               )
                            )

Save and Close!

Now all you have to do is go through the standard habari install steps. As per the directory you setup as your vhost. for the example above I must put my habari files in ‘/srv/http/Web/fsk141′, and to start the install process I open ‘http://fsk141.localdomain’ Oh and btw the vhost includes the rewrite!!! Don’t forget about the rewrite rules otherwise habari will bork…

Linux | Firefox 3.5.2 Google Finance Fix

Recently I tried to edit the settings in my google finance portfolio to no avail. I have the newest version of Firefox. Ie. Shiritoko 3.5.2. Come to find out google finance was disabling the features because of the UserAgent that was specified in about:config. To fix, open up about:config and enter the following for the User Agent

Preference Name:
general.useragent.extra.firefox

Value:
Firefox/3.5.3pre

This will make everything work how it should.

Before:

After:

LISP (again), More links

I’ve started up learning LISP once again. I’m going to start from the beginning of SICP (Structure and Interpretation of Computer Programming) I’ve gotten the introduction knocked out. If you would like to follow along check out my notes here. ATM I’m using DrScheme, but am looking for a simpler way of going about things…

——

I’ve added more static links to my array. Over the past couple days I’ve been trying to get my computerspace organized, and in the process I’ve added a lot of content to my blog. I hope it wasn’t all for nothing, and that at least someone reads it :)

Take controll of your keyboard with xbindkeys

July 26th, 2009 by

For avid linux enthusiasts xbindkeys is the ideal program to master your keyboard and assign commands to key combinations. Desktops and laptops alike; xbindkeys helps you use those unmapped keys, and put them to good use. For example, when you install a fresh distro on your shiny new laptop… A lot of new laptops have a bunch of extra keys that don’t always work out of the box. Some Desktop environments such as kde and gnome have gui configuration utilities to help you out. But if your like me and use dwm then gui tools aren’t really for you.

To better understand Xbindkeys I’ll plot up my laptop scenario… I have an IBM X61 that has a few keys that don’t work quite how I would like them to work. These include my volume up & down, menu, page left & right.

There a couple ways that one can create an ~/.xbindkeysrc file. The manual and automatic way…

Automatic: (Creates lot of comment flac :( )


1. Download xbindkeys & xbindkeys_config for your distro (included in most distros these days)
2.
$touch ~/.xbindkeysrc

3. Click new at the bottom, add a name, get the key combo, and set the command.
4. Either hit File > Save, or Edit > View generated rc & copy to .xbindkeysrc

Manual: (My choice)


1. Download xbindkeys
2. Fire up your editor of choice and make a new file in your /home/ directory named .xbindkeysrc (Don’t forget the ‘.’ at the beginning)
3. Fire up a terminal and execute ‘xev’

——

xev is the only tool that I know that gives you all the information you need easily. Lets start with the Volume Down key, and add it to the ~/.xbindkeysrc file:

KeyPress event, serial 27, synthetic NO, window 0xa00001,
root 0x10b, subw 0xa00002, time 192787373, (40,35), root:(41,51),
state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

This might look just like a jumble of letters and numbers, but it’s easy to find what we need and adapt it to a simple template for the config.

# Template

# Key/Action Label
"command"
m: state (aka modifier key) + keycode # (in our case m: 0x0)
keycode_name (optional in some cases, sometimes won't work without)

So if we add everything up we get something like the following:

#~/.xbindkeysrc

#Volume Down
"amixer set PCM 1+"
m:0x0 + c:122
XF86AudioRaiseVolume

5. Finish by typing the other keys into xev, and add them to your ~/.xbindkeysrc

——

If you would like to take a look at my X61 xbindkeysrc please check it out in my git backup On Github

Happy Launching…

Dotfiles, sort, for, idea!,

July 25th, 2009 by

First, I would like to introduce a new link to the right (the hard links) labeled “Dotfiles” This will include all the dot configuration files for my misc computers.

——

I messed up a little bit with renaming some files and renamed some .avi files to .jpg. To sort the problem out I needed to figure out what the bigger files were to easily determine which were movies, and which were not. An easy way to achieve a size sort is this:

du -h * ## basic size of files in a directory
---
du -h * | sort -n  ## Size Ascending (Smallest to Largest)
---
du -h * | sort -n -r ## Size Descending (Largest to Smallest)
[fsk141@Minifsk ~/2009-Black_Mountain]$ du -h *
---
1.9M	210.jpg
6.2M	211.avi
16M	212.avi
15M	213.avi
3.4M	214.jpg
50M	215.avi
14M	216.avi
3.4M	217.jpg
2.2M	218.jpg
36M	219.avi
5.3M	220.avi
[fsk141@Minifsk ~/2009-Black_Mountain]$ du -h * | sort -n
---
5.0M	029.jpg
5.3M	220.avi
5.7M	209.avi
6.2M	211.avi
13M	208.avi
14M	216.avi
15M	213.avi
16M	212.avi
36M	219.avi
50M	215.avi

——

I’ve been using for statements recently, and got some help from: http://www.freeos.com/guides/lsst/ch03sec06.html. I might write a little statement writeup (for, while, if, etc) But in the meantime I would like to share a couple that came in handy with some renames & fixes.

for i in 1 2 3 4
do mv $i.jpg $.avi
done
---
for ((  i = 0 ;  i < 20;  i++  ))
do mv $i.JPG $i.jpg
done

I love 'for' and 'if' statements, and need to get more into my "programming" mindset, and not waste so much time typing repetitive tasks.

------

IDEA!!!

So I love flickr, and backup all my images to my flickr account. (I need to make more public, but most are private) And I've printed pictures from snapfish in the past, but it's a little pain to upload to flickr and snapfish. So I'm thinking up a way to upload to both at the same time. I believe that both flickr and snapfish allow you to upload .zip files, yet I'm unsure if you can email them .zip archives and they will extract and everything for you? If that's possible then I will probably write up a script that zips up a directory and sends it to the respectable services. I'll post once I get something up.

The Outdoorist | Angeles National Forest

The Outdoorist was born a couple days ago. My friend Christian and I went camping to Black Mountain and talked about how we have enough outdoor gear to review for a while. So we thought of a name on the drive back, and we’ve started up the site… I’m working on a review for Black Diamond Orbit. I will post here when it’s completed.

——

I plan on posting some pictures soon from my adventure. One thing I really wish I really had was a working GPS while I was hiking :( . I brought my car gps, and it started working once I got up really high. This is where I stopped (In the shade). I took a brake, noticed I ran out of water, and then marched right down the mountain. I didn’t want to get stuck without water. Check out where I ended up here:


View Larger Map

Scripts

I’ve been lazy for a lil while, but I’ve gotten some motivation and setup a git repo for my scripts. Some of them I use on a day to day basis, and others I’ll use once a year ;) I’ve added a couple so far, and will add more soon…

Check out the Scripts link to the top right of the page.

Enjoy, Fsk141