parsed.org
Search:

Popular tags

aliases analysis apache apt-get array authentication autocomplete awk background backup bash boot broken browser bsd buffer c capture characters cisco cmd commands compilation configuration connections conversion convert copy data database debian debugging diagnostic diff directory dns document dos dot-emacs download editors elisp emacs encryption enumeration escape ethereal ethernet extras filesystem filter find firefox firewall freebsd functions gnu gotcha headers highlighting html http image imagemagick import indentation internals javascript key keystrokes languages latex line-endings loop lsof mail mailbox messages metadata microsoft modules monitoring mta mua mutt mysql neat network newline obscure oracle os output packet parsing password path performance perl permissions php pipe postgresql process programming psql python queries recovery redirect restore root router ruby schema screen screenrc security sed server session shell solaris sort split sql ssh startup subversion svn symlinks syntax system tagging tail tcpdump template terminal tex tips tunnel typesetting ui unix utilities vi vim vimrc virtualhost windows wireshark x11 xargs xml zsh

» Show all tags...

Most recent tips:

Dynamic Docstrings by Hawk-McKain on May 05, 2008 12:02 AM

Apparently Python only recognizes a doc string a litteral string placed after a function definition, meaning it won't accept an interpolated string, or even 'a'+'b', for whatever reason. For example:

>>> def doc():
...     '''Useful info. Note: %s''' % 'You'll never see this.'
...     print doc.__doc__
>>> doc()
None

To work around this you must explicitly set __doc__. Example:

>>> def doc():
...     doc.__doc__ = '''Useful info. Note: %s''' % 'Bacon is yummy!'
...     print doc.__doc__
>>> doc()
Useful info. Note: Bacon is yummy!
docstringpythonsemanticsstringssyntax
PostgreSQL Authentication by xinu on Apr 29, 2008 08:28 PM

If you intend to use passwords for local database authentication, you'll need to make an adjustment to the pg_hba.conf file:

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK        METHOD

#local   all         all                                          ident sameuser
local   all         all                                          password
authenticationidentlocalpasswordpostgresqlpsql
Display files by size by http://felicity.me.uk/ on Apr 28, 2008 02:08 PM

For example, to display the 20 largest files owned by joe:

find / -printf "%k\t%p\n" -user joe | sort -n | tail -20
commandsfilesfindpermissionsprintfsorttailusers
Useful Exim commands by http://felicity.me.uk/ on Apr 28, 2008 02:00 PM

display the route from your server to any email address:

exim -bt email@domain.com

send an email using exim:

exim -v email@domain.com

show the number of emails in the queue:

exim -bpc

display the mail queue:

exim -bp

flush queue:

exim -qff &

view a particular mail in the queue:

exim -Mvh msgid (for headers)
exim -Mvb msgid (for body)
commandseximmailmta
Gvim Configuration by xinu on Apr 23, 2008 07:52 AM

On a new windows install I'll always drop in these entries for startup configuration:

" general settings
set sw=4
set ts=4
set et
set nohls

" lhs comments
map ,# :s/^/#/<CR>
map ,/ :s/^/\/\//<CR>
map ,> :s/^/> /<CR>
map ," :s/^/\"/<CR>
map ,% :s/^/%/<CR>
map ,! :s/^/!/<CR>
map ,; :s/^/;/<CR>
map ,- :s/^/--/<CR>
map ,c :s/^\/\/\\|^--\\|^> \\|^[#"%!;]//<CR>

" wrapping comments
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR>
map ,( :s/^\(.*\)$/\(\* \1 \*\)/<CR>
map ,< :s/^\(.*\)$/<!-- \1 -->/<CR>
map ,d :s/^#//<CR>

" screen location & dimensions
winpos 50 50
set lines=30
set columns=120

" squirrel away backup files
set bdir=c:/backups
set directory=c:/backups

Note: You'll need to create the backup folder before you can use it.

gvimvimvimrc
RSS