Monday, November 24, 2008

prompt as reminder

i have a lot wishes and always working to get them. but it's known the less aims we have the faster we reach it. i use "reminders" for more needed wishes. reminders are notes, posters, pendants, wallpapers everything i see often that remind me about that wish. more thoughts more possible ways to realize.
since i use urxvt without transparency i don't need wallpaper which was good reminder. instead of it i use prompt string.

changing prompt string in bash

i add this string to my ~/.bashrc
PS1='c2d notebook: \w> '

\w escape sequence prints current working directory.
all escape sequences you can find here

i hope i'll buy core2duo notebook this month.

Thursday, November 13, 2008

my first database scaling

after week of learning and experimenting with vary solutions of scaling database we choose to use slony-i to replicate very large and loaded tables. there were a few changes in our application, we just added one more connection (persistent unit) to EJB beans for slave replicated database.
solution was really fast to apply and inexpensive.

Wednesday, November 5, 2008


All today I've tried to make work Slony-I replication.
I installed default slony1-1.2.6 from oss openSUSE repository. PostgreSQL's version is 8.3.1 also from that repository.

But slony1-1.2.6 doesn't support postgresql-8.3.1.
So I downloaded slony-1.2.15. And now everything works fine.

For slony's configuring I use pgAdmin which can't create new replication and shows "Slony-I creation scripts not available; only joining possible" message on status bar.
To solve I set "Slony-I path" to "/usr/share/postgresql" in File --> Options --> "General" tab.

Monday, October 27, 2008

wmii and sound volume

Sound volume can be controlled by this commands:
amixer sset PCM 5%+
amixer sset PCM 5%-

Let's use ModKey+Shift+a keys for decrease and ModKey+Shift+s for increase volume.

So change wmiirc configuration file:
Configuration Variables
# Configuration Variables


WMII_MENU='dmenu -b -fn "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5'"
WMII_9MENU='wmii9menu -font "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
WMII_SOUNDUP="amixer sset PCM 5%+"
WMII_SOUNDDOWN="amixer sset PCM 5%-"

And in Key Binding part:
wmiir xwrite /tag/sel/ctl send sel down
Key $MODKEY-Shift-$UP
wmiir xwrite /tag/sel/ctl send sel up

my wmii configuration

#!/bin/sh -f
# Configure wmii
wmiiscript=wmiirc # For

# Configuration Variables

# Bars

# Colors tuples: " "
WMII_NORMCOLORS='#000000 #c1c48b #81654f'
#WMII_FOCUSCOLORS='#000000 #81654f #000000'
WMII_FOCUSCOLORS='#ffffff #191A1A #000000'


WMII_MENU='dmenu -b -fn "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5'"
WMII_9MENU='wmii9menu -font "$WMII_FONT" -nf '"'$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
WMII_SOUNDUP="amixer sset PCM 5%+"
WMII_SOUNDDOWN="amixer sset PCM 5%-"

# Column Rules
wmiir write /colrules <> 17+83+41
/.*/ -> 62+38 # Golden Ratio

# Tagging Rules
wmiir write /tagrules <> ~

# Status Bar Info
status() {
echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)

echo $WMII_NORMCOLORS | wmiir create $noticebar

# Event processing
wi_events -s ' ' <<'!' # Events Event CreateTag echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@" Event DestroyTag wmiir remove "/lbar/$@" Event FocusTag wmiir xwrite "/lbar/$@" "$WMII_FOCUSCOLORS" "$@" Event UnfocusTag wmiir xwrite "/lbar/$@" "$WMII_NORMCOLORS" "$@" Event UrgentTag shift wmiir xwrite "/lbar/$@" "*$@" Event NotUrgentTag shift wmiir xwrite "/lbar/$@" "$@" Event LeftBarClick LeftBarDND shift wmiir xwrite /ctl view "$@" Event ClientMouseDown client=$1; button=$2 case "$button" in 3) do=$(wi_9menu -initial "$menulast" Nop Delete Fullscreen) case "$do" in Delete) wmiir xwrite /client/$client/ctl kill;; Fullscreen) wmiir xwrite /client/$client/ctl Fullscreen on;; esac menulast=${do:-"$menulast"} esac Event Unresponsive { client=$1; shift msg="The following client is not responding. What would you like to do?$wi_nl" resp=$(wihack -transient $client \ xmessage -nearmouse -buttons Kill,Wait -print \ "$msg $(wmiir read /client/sel/label)") if [ "$resp" = Kill ]; then wmiir xwrite /client/$client/ctl slay & fi }& Event Notice wmiir xwrite $noticebar $wi_arg kill $xpid 2>/dev/null # Let's hope this isn't reused...
{ sleep $noticetimeout; wmiir xwrite $noticebar ' '; }&
xpid = $!
# Actions
Action quit
wmiir xwrite /ctl quit
Action exec
wmiir xwrite /ctl exec "$@"
Action rehash
proglist $PATH >$progsfile
Action status
set +xv
if wmiir remove /rbar/status 2>/dev/null; then
sleep 2
echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
while status | wmiir write /rbar/status; do
sleep 1
# Key Bindings
Key $MODKEY-Control-t
case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
echo -n "$Keys" | wmiir write /keys
wmiir xwrite /ctl grabmod $MODKEY;;
wmiir xwrite /keys $MODKEY-Control-t
wmiir xwrite /ctl grabmod Mod3;;
Key $MODKEY-space
wmiir xwrite /tag/sel/ctl select toggle
wmiir xwrite /tag/sel/ctl colmode sel default
wmiir xwrite /tag/sel/ctl colmode sel stack
wmiir xwrite /tag/sel/ctl colmode sel max
Action $(wi_actions | wi_menu) &
eval wmiir setsid "$(wi_menu <$progsfile)" & Key $MODKEY-t wmiir xwrite /ctl view $(wi_tags | wi_menu) & Key $MODKEY-Return eval $WMII_TERM & Key $MODKEY-Shift-space wmiir xwrite /tag/sel/ctl send sel toggle Key $MODKEY-f wmiir xwrite /client/sel/ctl Fullscreen toggle Key $MODKEY-Shift-c wmiir xwrite /client/sel/ctl kill Key $MODKEY-Shift-t wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" $(wi_tags | wi_menu) & Key $MODKEY-$LEFT wmiir xwrite /tag/sel/ctl select left Key $MODKEY-$RIGHT wmiir xwrite /tag/sel/ctl select right Key $MODKEY-$DOWN wmiir xwrite /tag/sel/ctl select down Key $MODKEY-$UP wmiir xwrite /tag/sel/ctl select up Key $MODKEY-Shift-$LEFT wmiir xwrite /tag/sel/ctl send sel left Key $MODKEY-Shift-$RIGHT wmiir xwrite /tag/sel/ctl send sel right Key $MODKEY-Shift-$DOWN wmiir xwrite /tag/sel/ctl send sel down Key $MODKEY-Shift-$UP wmiir xwrite /tag/sel/ctl send sel up Key $MODKEY-Shift-$SOUNDUPB eval $WMII_SOUNDUP & Key $MODKEY-Shift-$SOUNDDOWNB eval $WMII_SOUNDDOWN & ! for i in 0 1 2 3 4 5 6 7 8 9; do wi_events -s ' ' <>$progsfile &

# Setup Tag Bar
OIFS="$IFS"; IFS="$wi_nl"
wmiir rm $(wmiir ls /lbar | sed 's,^,/lbar/,')
seltag=$(wmiir read /tag/sel/ctl | sed 1q)
wi_tags | while read tag
if [ "$tag" = "$seltag" ]; then
echo "$WMII_FOCUSCOLORS" "$tag"
echo "$WMII_NORMCOLORS" "$tag"
fi | wmiir create "/lbar/$tag"


Wednesday, October 22, 2008

my vim configuration

I don't like project plugin of vim. For me more convinient to use sessions. I bind F5 to save session.
nmap  :mksession! ~/eps.project
imap :mksession! ~/eps.project

And F6 to load from session.
nmap  :source ~/eps.project
imap :source ~/eps.project

F7, F8 are used for navigate previous and next tab.
nmap  gT
imap gT

nmap gt
imap gt

And coloscheme is ir_black. Really cool scheme for dark background terminal.

syntax enable
filetype indent on
filetype plugin on
set et
set sw=4
set smarttab
set fencs=utf-8
set foldmethod=marker
set autoindent
set number

set backspace=indent,eol,start

nmap :mksession! ~/eps.project
imap :mksession! ~/eps.project

nmap :source ~/eps.project
imap :source ~/eps.project

nmap gT
imap gT

nmap gt
imap gt

nmap :!upd

colorscheme ir_black

Easy deploying web files to

I'm developing UI on javascript for project with Glassfish (sjsas). Application server works on local machine. It's tiring to copy changes to glassfish's web dir after editing in workcopy dir. I can edit js files in glassfish dir but several times I forgot to copy changes to workcopy dir. First I want to change docroot or alternative docroot option to my workdir copy but some reason I can't change it. After this I create symlink in web dir to workcopy dir but glassfish doesn't understand symlinks.

So I choose the most simple way by copying with cp.
cp -Ru _workcopy_/_web_files_dir_ _glassfish_domain_dir_/ 

I create shell script with this command in my home bin dir and bind to F9 functional key in vim editor.

Tuesday, October 21, 2008

Friday, October 17, 2008

Dark GTK2 theme

I found cool dark theme for GTK2. Pidgin looks cool.

Thursday, October 16, 2008

my urxvt configuration

My conf for urxvt

URxvt*geometry:          80x25
URxvt*background: #000000
URxvt*foreground: #ffffff
URxvt*inheritPixmap: false
URxvt*reverseVideo: false
URxvt*tintColor: #dfdfdf
!URxvt*font: -lfp-terminus-medium-r-normal-*-*-90-*-*-c-*-iso8859-5
URxvt*font: -*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*
!URxvt*font xft:Monospace:pixelsize=21
!URxvt*font: xft:matto:antialias=true:size=8
!URxvt*font: xft:Bitstream Vera Sans mono:size=9
URxvt*scrollBar: true
URxvt*scrollBar_floating: true
URxvt*scrollBar_right: false
URxvt*scrollColor: #000000
URxvt*saveLines: 5500
!URxvt*termName: URxvt
URxvt*cursorColor: #d8d8d8
URxvt*colorBD: lightyellow
URxvt*colorUL: yellow

URxvt*color0: #676767
URxvt*color8: #757575
URxvt*color1: #EA6868
URxvt*color9: #FF7272
URxvt*color2: #ABCB8D
URxvt*color10: #AFD78A
URxvt*color3: #E8AE5B
URxvt*color11: #FFA75D
URxvt*color4: #71C5F4
URxvt*color12: #67CDE9
URxvt*color5: #E2BAF1
URxvt*color13: #ECAEE9
URxvt*color6: #21F1EA
URxvt*color14: #36FFFC
URxvt*color7: #F1F1F1
URxvt*color15: #FFFFFF

Monday, October 6, 2008

offsets vs. pages

Last days I work a lot with javascript grids for jQuery and wonder:
1) why developers of these grids use pages in requests for data from server. When using offset gives more clean code on server side.
2) of using page number from response. So server has to send that what it receives. It's weird and useless.

So I rewrite some code in grid.

Thursday, September 18, 2008

Query restriction in Goolge App Engine

Inequality Filters Are Allowed On One Property Only
I have an idea of web site that'll use plane with coordinates. So restriction above don't allow to query with two different param "between" conditions.

It's so pity. :(

Sunday, August 24, 2008

Saturday, August 23, 2008

Powered by Blogger.