Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar

Pradeep Gowda btbytes

View GitHub Profile
@btbytes
btbytes / aal.css
Created June 14, 2010 13:49
Aardward.legs. Sensible typographical defaults.
/*
aardvark.legs by Anatoli Papirovski - http://fecklessmind.com/
Licensed under the MIT license. http://www.opensource.org/licenses/mit-license.php
URL: http://aardvark.fecklessmind.com/aal.css.txt
*/
/*
Reset first. Modified version of Eric Meyer and Paul Chaplin reset
from http://meyerweb.com/eric/tools/css/reset/
*/
@btbytes
btbytes / gist:440894
Created June 16, 2010 16:11
script to kickstart a new jekyll post.
We couldn’t find that file to show.
@btbytes
btbytes / pandoc_notes.markdown
Created June 18, 2010 21:04
Notes on using pandoc

Notes on using Pandoc

$ pandoc  quickpost.txt -f markdown -t html --no-wrap -o quickpost.html --template=template.html
@btbytes
btbytes / rsync_howto.md
Created June 19, 2010 16:04
Correct way to sync a local dir to remote

Indpy June 2010 meeting notes

Python 3.1 presentation

Guido at OSCON 2002. "python regrets" print, integer division, xrange, raw_input, backticks etc.,

3.1 >> Feature FREEEEEEEZE

top 10 things..

  • Use aticonfig to generate an xorg.conf file.
  • Add fglrx to MODULES list in /etc/rc.conf.
  • add nomodeset to kernel line in /boot/grub/menu.lst ie., kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1aa731c0-f626-4d01-a551-8eed3c2a35f3 ro nomodeset

To get it working with xorg-server >=1.8 you need patched xorg-server. you may get it from [catalyst] repo, more here: http://wiki.archlinux.org/index.php/ATI_Catalyst#Catalyst.27s_repositories

@btbytes
btbytes / memory_monitor.py
Created July 9, 2010 01:59
Simple module for getting amount of memory used by a specified user's processes on a UNIX system.
"""Simple module for getting amount of memory used by a specified user's
processes on a UNIX system.
It uses UNIX ps utility to get the memory usage for a specified username and
pipe it to awk for summing up per application memory usage and return the total.
Python's Popen() from subprocess module is used for spawning ps and awk.
source: http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python
"""
import subprocess
@btbytes
btbytes / get_date_to_set_date.sh
Created August 5, 2010 20:44
get date to set date.
# echoes shell command that can be pasted to set date to UTC.
echo date -s `date -u +"%Y.%m.%d-%H:%M:%S"`
#!/usr/bin/perl -w
# vim:et:sw=4 ts=4
# servermenu_pl - an server menu example client for LCDproc
# Displays some server stats: mem, cpu, local time
# and offers the possibility to shutdown the machine via
# the buttons.
# Copyright GPL 2005, Guido Socher
use IO::Socket;
use Getopt::Std;
use Fcntl;

If this is your first install, automatically load on login with:

cp /usr/local/Cellar/redis/2.0.0/io.redis.redis-server.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist

If this is an upgrade and you already have the io.redis.redis-server.plist loaded:

launchctl unload -w ~/Library/LaunchAgents/io.redis.redis-server.plist
cp /usr/local/Cellar/redis/2.0.0/io.redis.redis-server.plist ~/Library/LaunchAgents

launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist