himdel

Segmentation fault

2009-04-12

Migrating request-tracker (from rt-3.4.5 on mysql to rt-3.8.2 on postgres)

I've recently had the "pleasure" of upgrading our company's request tracker system and migrating it from MySQL to Postgres and I'd like to share what I found out.

The process of installing and configuring the request-tracker-3.8 package from Debian experimental is considered obvious (and user-specific) and won't be covered here.

First of all, all the data had to be migrated, except for the 'sessions' table which should be created empty (what would we need old sessions for).


export LC_ALL=C
TABLES=ACL Attachments Attributes CachedGroupMembers CustomFieldValues CustomFields GroupMembers Groups Links ObjectCustomFieldValues ObjectCustomFields Principals Queues ScripActions ScripConditions Scrips Templates Tickets Transactions Users
for foo in $TABLES; do echo $foo; mysqldump rtdb "$foo" --default-character-set=utf8 --compatible=postgresql --compact -t -u rtuser --password=omitted -r rtdb-"$foo"-`date +%s`.sql; done


I chose to export each table into a different file to ease handling and because vim takes too long on 400MB files.

Mysqldump may have the --compatible=postgresql option, but don't expect the output will be postgresql compatible .. but maybe it used to at some point, nowadays, Postgres won't accept string fields 'like \' \\this', but only 'like '' \this' or you have to explicitly tell it to see escaping .. E'like \' \\this'.

Also, postgres won't handle the quotes in INSERT INTO "Table" .. .


perl -i -npe 's/^INSERT INTO "(\w+)"/INSERT INTO \L$1/; '"s/,'/,E'/g;" rtdb-*.sql


Worked just fine.

Seeing the inserts, I really didn't want to handle transmogrifying the CREATE TABLE statements and such, so I exported a freshly created pg-8.3 database from rt-3.8.2, removed any data from the dump and split it into the HEAD (the part before data) and TAILS (the part after).

The only schema difference that had to be handled was in the table CustomFields, where order of columns was changed.


perl -i -npe 's/INSERT INTO customfields VALUES/INSERT INTO customfields (id,name,type,maxvalues,pattern,repeated,description,sortorder,lookuptype,creator,created,lastupdatedby,lastupdated,disabled) VALUES/' rtdb-CustomFields-*.sql


Explicit insert helped :).

This made the data ready to be loaded to a new, empty database. Almost.

For some reason RT uses text fields for saving mail content so non-utf8 mails couldn't be imported into the UTF-8 database .. after struggling long and hard, I didn't actually find a proper way to convert it so I used a quick and dirty hack and simply stripped all diacritics from the input data .. the language was Czech and cp1250, iso-8859-2 and utf-8 encodings were used .. I wrote a simple diacritics stripper for Czech that doesn't need to know the source encoding (because various were mixed in a single table dump) .. so that's what the zz_subs filter does in the following command.


psql rtdb < ok/HEADS for foo in rtdb-*.sql; do echo $foo; cat "$foo" | ../zz_subs | psql rtdb; done psql rtdb < ok/TAILS


Thus the data was migrated but RT still kept falling when I tried to insert anything new .. the culprit were the postgresql sequences (used to generate ids) - they didn't get updated because all entried were inserted with explicit id .. so all sequences still tried to use 1 as a new id, which didn't work. (rant mode: is it just me or is this behaviour incredibly stupid? should they at least keep incrementing if the next value is already there?).


psql rtdb <<EOF
select setval('acl_id_seq', (select max(id) from acl));
select setval('attachments_id_seq', (select max(id) from attachments));
select setval('attributes_id_seq', (select max(id) from attributes));
select setval('cachedgroupmembers_id_seq', (select max(id) from cachedgroupmembers));
select setval('customfields_id_seq', (select max(id) from customfields));
select setval('customfieldvalues_id_seq', (select max(id) from customfieldvalues));
select setval('groupmembers_id_seq', (select max(id) from groupmembers));
select setval('groups_id_seq', (select max(id) from groups));
select setval('links_id_seq', (select max(id) from links));
select setval('objectcustomfields_id_s', (select max(id) from objectcustomfields));
select setval('objectcustomfieldvalues_id_s', (select max(id) from objectcustomfieldvalues));
select setval('principals_id_seq', (select max(id) from principals));
select setval('queues_id_seq', (select max(id) from queues));
select setval('scripactions_id_seq', (select max(id) from scripactions));
select setval('scripconditions_id_seq', (select max(id) from scripconditions));
select setval('scrips_id_seq', (select max(id) from scrips));
select setval('templates_id_seq', (select max(id) from templates));
select setval('tickets_id_seq', (select max(id) from tickets));
select setval('transactions_id_seq', (select max(id) from transactions));
select setval('users_id_seq', (select max(id) from users));
EOF


Deep magic, but works.

Now, rt has it's own thingy for upgrading database for rt upgrades, so I wanted to run it so everything is in order. After skimming through, it does seem to do some useful stuff. Unfortunately there's a schema change in 3.7.3 which tried to remove all tables so 3.7.3 has to be skipped.


(echo 3.4.5; echo 3.7.1; echo y) | rt-setup-database --action upgrade --dba-password=omitted
(echo 3.7.3; echo; echo y) | rt-setup-database --action upgrade --dba-password=omitted


And really, that's all you need to do to migrate a rt.

You might also want to put something like this in your crontab:

0 4 * * * postgres /bin/echo "delete from sessions where LastUpdated < (now() - '24 hour'::interval);" | /usr/bin/psql rtdb


Rant mode on:
Except, it didn't really work. And why not, you ask? Because of ****** cpan putting his sleazy libraries where they don't belong. Why, oh why can't you set cpan to install to /usr/local or somewhere that has less priority than /usr/share/ where debian puts them. It didn't work because we had Net::LDAP from 1999 in /usr/lib (and a current version in /usr/share that didn't get used).
Oh well :)

2009-02-15

A weird youtube problem

For about an hour, youtube has been broken, at least for me. For most of the videos, it shows only a "We're sorry, this video is no longer available." notice. That sucks, especialy since it includes videos from recommended, top of search results, etc. Grr., hope they fix it soon.

The problem seems to be with a decoder not recognizing the format. I can download the video (using the DownloadHelper ff addon for example) but I can't play it in mplayer either (using version 2:1.0~rc2-0ubuntu13.1) .. it says

[flv @ 0x8750b74]Unsupported video codec (7)[flv @ 0x8750b74]Unsupported video codec (7)[flv @ 0x8750b74]Unsupported video codec (7)[flv @ 0x8750b74]Could not find codec parameters (Video: 0x0007)[flv @ 0x8750b74]Could not find codec parameters (Audio: 0x000a, 44100 Hz, stereo)
.

I guess the flash part hasn't been updated for some video format changes. Or maybe it's somehow cached on my side? Or could they really have deleted so many videos at a time? ()

Well, it really sucks, I'm on work Eee, with no data and my server disconnected. Fnuk.

P.S. let's see how long it'll take to compile mplayer on Eee :) *CRAZY*

EDIT1: like, 10 minutes, cool
EDIT2: while videos on youtube still don't work, current mplayer plays them just fine :) mplayer FTW

2009-01-19

unix quiz

I just found out about the UNIX quiz [http://spiffy.ci.uiuc.edu/~kline/Stuff/unixquiz.html] .. or "Okay, you degenerates! Let's see how much you really know about the history of Unix. This quiz appeared in ;login: magazine, July 1984. "

So, without much ado, here's my first take on it (without looking up anything .. a know only a few anwsers and even these may not be correct).


1. The source code motel: your source code checks in, but it never checks out. What is it?
SCCS .. the precursor to VCS a CVS

2. Who wrote the first Unix screen editor?

3. Using TSO is like kicking a {what?} down the beach.

4. What is the filename created by the original dsw(1)?

5. Which edition of Unix first had pipes?

6. What is -=O=-?

7. Which Stephen R. Bourne wrote the shell?

8. Adam Buchsbaum's original login was sjb. Who is sjb?

9. What was the original processor in the Teletype DMD-5620?

10. What was the telephone extension of the author of mpx(2)?

11. Which machine resulted in the naming of the "NUXI problem"?
The VAX

12. What customs threat is dangerous only when dropped from an airplane?

13. Who wrote the Bourne Shell?

14. What operator in the Mashey shell was replaced by "here documents"?

15. What names appear on the title page of the 3.0 manual?

16. Sort the following into chronological order: 1) PWB 1.2, b) V7, c) Whirlwind, e) System V, f) 4.2BSD, g) MERT.

17. The CRAY-2 will be so fast it {what?} in 6 seconds.

18. How many lights are there on the front panel of the original 11/70?

19. What does FUBAR mean?
Fucked Up Beyond All Recognition

20. What does "joff" stand for?

21. What is "Blit" an acronym of?

22. Who was rabbit!bimmler?

23. Into how many pieces did Ken Thompson's deer disintegrate?

24. What name is most common at USENIX conferences?

25. What is the US patent number for the setuid bit?

26. What is the patent number that appears in Unix documentation?

27. Who satisfied the patent office of the viability of the setuid bit patent?

28. How many Unix systems existed when the Second Edition manual was printed?

29. Which Bell Labs location is HL?

30. Who mailed out the Sixth Edition tapes?

31. Which University stole Unix by phone?

32. Who received the first rubber chicken award?

33. Name a feature of C not in Kernighan and Ritchie.
Passing struct by value as a function parameter

34. What company did cbosg!ccf work for?

35. What does Bnews do?

36. Who said "Sex, Drugs, and Unix?"

37. What law firm distributed Empire?

38. What computer was requested by Ken Thompson, but refused by management?

39. Who is the most obsessed private pilot in USENIX?

40. What operating system runs on the 3B-20D?

41. Who wrote find(1)?

42. In what year did Bell Labs organization charts become proprietary?

43. What is the Unix epoch in Cleveland?

44. What language preceded C?
BCPL

45. What language preceded B?
assembler?

46. What letter is mispunched by bcd(6)?

47. What terminal does the Blit emulate?

48. What does "trb" stand for (it's Andy Tannenbaum's login)?

49. allegra!honey is no what?

50. What is the one-line description in vs.c?
"You are not expected to understand this"

51. What is the TU10 tape boot for the PDP-11/70 starting at location 100000 octal?

52. What company owns the trademark on Writer's Workbench Software?

53. Who designed Belle?

54. Who coined the name "Unix"?

55. What manual page mentioned Urdu?

56. What politician is mentioned in the Unix documentation?

57. What program was compat(1) written to support?

58. Who is "mctesq"?

59. What was "ubl"?

60. Who bought the first commercial Unix license?

61. Who bought the first Unix license?

62. Who signed the Sixth Edition licenses?

63. What color is the front console on the PDP-11/45 (exactly)?

64. How many different meanings does Unix assign to '.'?

65. Who said "Smooth rotation butters no parsnips?"

66. What was the original name for cd(1)?
chdir

67. Which was the first edition of the manual to be typeset?

68. Which was the first edition of Unix to have standard error/diagnostic output?

69. Who ran the first Unix Support Group?

70. Whose Ph.D. thesis concerned Unix paging?

71. Who (other than the obvious) designed the original Unix file system?

72. Who wrote the PWB shell?

73. Who invented uucp?

74. Who thought of PWB?

75. What does grep stand for?
gREp .. the command in ed(1) that greps .. the RE stands for regular expression

76. What hardware devidce does "dsw" refer to?

77. What was the old name of the "/sys" directory?

78. What was the old name of the "/dev" directory?

79. Who has written many random number generators, but never one that worked?

80. Where was the first Unix system outside 127?

81. What was the first Unix network?

82. What was the original syntax for ls -l | pr -h?
ls -l > pr -h

83. Why is there a comment in the shell source /* Must not be a register variable */?

84. What is it you're not expected to understand?
something to do with VM

2008-12-26

useful greasemonkey scripts list

These are all the greasemonkey scripts I'm currently using. Greasemonkey is a firefox addon that allows you to have custom scripts that change the behaviour of any site. Most of them are rather useful so enjoy! :)


  • Google Reader: Show Feed Favicons - shows favicons of the site the feed comes from instead of the generic rss icon in google reader

  • Convert hCalendar to Google Calendar - does what it says

  • mbank login - the mBank login page has autocomplete=off on the login form fields .. and I hate to have to look up my customer id every time .. so just replace the "foobar" in the script with your number and there you go. (It'd work for password too.)

  • Show Password on Click - shows the password when you click on a password input field

  • YouTube Enhancer - so the videos on youtube don't start playing automatically (which sucks when you open many videos at once) and load the higher quality version by default

useful firefox extensions list

These are all the firefox extensions I'm currently using .. and I'd be lost without many of them.
Enjoy! :)


  • AutoAuth - so you don't have to press enter on sites using HTTP authentication if you've already saved a password

  • Delicious Bookmarks - to synchronize ff bookmarks with my del.icio.us

  • Download Statusbar - so you can see current downloads in the statusbar

  • DownloadHelper - for saving youtube videos and image/video galleries

  • Facebook Toolbar - shows notifications about facebook events

  • Fast Dial - thumbnails on an empty tab .. just like in Opera

  • Firebug - to debug javascript apps and change stuff on loaded sites

  • FireStatus - shows what's new on my twitter + to post new items

  • Flashblock - shows a big play button instead of any flash on the site .. and you can start each flash thingy manually or allow flash for whole site

  • Forecastfox - so you know the weather outside

  • GCal Popup - overlays the current site with a google calendar view

  • Google Gears - for offline apps such as Google Docs, Google Reader and Remember The Milk

  • Google Notebook - shows a small Google Notebook so you can save snippets of a page

  • Google Reader Watcher - to see how many unread posts you have

  • Greasemonkey - to customize various sites (see my next post)

  • gui:config - well, easier than tweaking about:config items

  • Image Zoom - right click + wheel scroll on an image resizes it .. great for viewing comics in Google Reader

  • Open in Browser - adds an option to the open/save dialog so you can view stuff on any mimetype in the browser (great for all those javascripts with Content-Type: application/data)

  • Open IT Online - adds an option to the open/save dialog so you can open documents directly in Google Docs (and others)

  • Operator - shows any microformats on current page

  • Perspectives - to get rid of some of the annoying Invalid SSL Certificate warnings

  • ReloadEvery - to reload the current tab every n seconds/minutes

  • Resizeable Textarea - so you can grab and resize any textareas

  • Snap Links - middleclick and drag to open many links simultaneously

  • Tab History - preserves history of the parent tab in the new tab when you open a link in a new tab

  • Mobile Barcoder - shows the current tab url as QR-Code

2008-11-19

himdel's .bashrc



001 # ~/.bashrc: executed by bash(1) for non-login shells.
002 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
003 # for examples

004 . /etc/profile
005 export PATH=$PATH:/home/him/bin

006 # If not running interactively, don't do anything
007 [ -z "$PS1" ] && return

008 # don't put duplicate lines in the history. See bash(1) for more options
009 export HISTCONTROL=ignoredups

010 # check the window size after each command and, if necessary,
011 # update the values of LINES and COLUMNS.
012 shopt -s checkwinsize

013 # make less more friendly for non-text input files, see lesspipe(1)
014 [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

015 # set variable identifying the chroot you work in (used in the prompt below)
016 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
017 debian_chroot=$(cat /etc/debian_chroot)
018 fi

019 # set a fancy prompt (non-color, unless we know we "want" color)
020 case "$TERM" in
021 xterm-color)
022 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
023 ;;
024 *)
025 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
026 ;;
027 esac

028 # Comment in the above and uncomment this below for a color prompt
029 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

030 # If this is an xterm set the title to user@host:dir
031 case "$TERM" in
032 xterm*|rxvt*)
033 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
034 ;;
035 *)
036 ;;
037 esac

038 # Alias definitions.
039 # You may want to put all your additions into a separate file like
040 # ~/.bash_aliases, instead of adding them here directly.
041 # See /usr/share/doc/bash-doc/examples in the bash-doc package.

042 #if [ -f ~/.bash_aliases ]; then
043 # . ~/.bash_aliases
044 #fi

045 # enable color support of ls and also add handy aliases
046 if [ "$TERM" != "dumb" ]; then
047 eval "`dircolors -b`"
048 alias ls='ls --color=auto'
049 #alias dir='ls --color=auto --format=vertical'
050 #alias vdir='ls --color=auto --format=long'
051 fi

052 # some more ls aliases
053 #alias ll='ls -l'
054 #alias la='ls -A'
055 #alias l='ls -CF'

056 # enable programmable completion features (you don't need to enable
057 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
058 # sources /etc/bash.bashrc).
059 if [ -f /etc/bash_completion ]; then
060 . /etc/bash_completion
061 fi

062 alias apt-get='sudo apt-get'
063 alias aptitude='sudo aptitude'

064 alias sshim='ssh -X himdel.mine.nu'
065 alias aisa='ssh xhrad1@aisa.fi.muni.cz'
066 alias oldtimer='ssh himdel@in.solnet.cz'

067 SSHFS="sudo sshfs -o reconnect -o allow_other -o fsname=sshfs -o transform_symlinks"
068 alias mntpenny="$SSHFS xhrad1@192.168.1.2:/ /media/penny"
069 alias mnthim="$SSHFS xhrad1@himdel.mine.nu:/ /media/penny"
070 alias mntaisa="$SSHFS xhrad1@aisa.fi.muni.cz: /media/aisa"
071 alias mntpb071="$SSHFS xhrad1@aisa.fi.muni.cz:/export/e1/pb071 /media/pb071"

072 function susp {
073 echo Suspend in 4 sec...
074 STATUS=`purple-remote getstatus`
075 purple-remote 'setstatus?status=offline'
076 killall sonata
077 sleep 1
078 killall -9 sonata
079 sleep 2
080 mpc pause
081 sync
082 sudo s2ram -f
083 sleep 0.5
084 purple-remote "setstatus?status=$STATUS"
085 # twitter post 'just started the notebook'
086 mode.rb detect
087 (sonata & exit)
088 }

089 function wifi_school {
090 # sudo ifdown eth0
091 # sudo ifdown eth2
092 # sudo killall wpa_supplicant #should really just send a cmd or sth
093 # sudo iwconfig eth2 essid wlan_fi
094 # sudo iwconfig eth2 txpower auto
095 # sudo ifup eth2
096 firefox https://fadmin.fi.muni.cz/auth/sit/wireless/login.mpl &
097 }

098 function wifi_modules {
099 sudo rmmod b43 b44 ssb
100 sudo modprobe ndiswrapper
101 }

102 function wifi_supp {
103 sudo ifdown eth0
104 sudo ifdown eth2
105 ps -A | grep wpa_supplicant || sudo wpa_supplicant -Dwext -ieth2 -C/var/run/wpa_supplicant &
106 #ps -A | grep wpa_supplicant || sudo wpa_supplicant -Dwext -ieth2 -c/etc/wpa_supplicant/wpa_supplicant.conf &
107 sudo wpa_gui -p/var/run/wpa_supplicant
108 sudo ifup eth2
109 }

110 #function popice {
111 # sudo ifdown eth0
112 # sudo ifdown eth2
113 # sudo ip link set eth0 up
114 # sudo ip addr add 192.168.114.199 dev eth0
115 # sudo ip route add 192.168.114.254/32 dev eth0
116 # sudo ip route add default via 192.168.114.254
117 # sudo sh -c 'echo "nameserver 62.168.35.129" > /etc/resolv.conf'
118 #}

119 #function eth {
120 # sudo ifup eth0
121 #}

122 alias xs='sleep 4 ; xset dpms force off'
123 alias ct1='mplayer http://cdn4.nacevi.cz/CT1-High'
124 alias ct2='mplayer http://cdn4.nacevi.cz/CT2-High'
125 alias wcat='wget -qO-'

126 function status {
127 if [ "$#" -eq 0 ]; then
128 msg='getstatus'
129 else
130 msg='setstatus'
131 fi
132 if [ "$#" -ge 1 ]; then
133 msg="$msg?status=$1"
134 fi
135 msg="$msg&message="
136 if [ "$#" -ge 2 ]; then
137 msg="$msg$2"
138 fi
139 purple-remote "$msg"
140 }

141 alias q3a=quake3

142 function umri_pak_sys {
143 echo umri_pak_sys
144 cd /sys/class/power_supply/C1BC
145 while [ $(cat charge_now) -gt 320000 ]; do
146 sleep 1m
147 done
148 cd -
149 }

150 function umri_pak_proc {
151 echo umri_pak_proc
152 cd /proc/acpi/battery/C1BC
153 while [ $(grep ^rema state | awk '{ print $3 }') -gt 320 ]; do
154 sleep 1m
155 done
156 cd -
157 }

158 function pak_umri {
159 if [ -d /proc/acpi/battery/C1BC ]; then
160 umri_pak_proc
161 else
162 umri_pak_sys
163 fi
164 susp
165 }

166 alias scrim='sshim -t screen'
167 alias xss='for foo in {1..8}; do sleep=$((2 ** $foo)); echo "foo=$foo; sleep=$sleep"; sleep $sleep; xs; done'

168 # scrim in detached screen
169 function blaf { screen -d -m ssh himdel.mine.nu -t screen "$@"\; echo -paused-\; read ;}

170 # blaf for all scrim -ls
171 function blorg { for foo in `scrim -ls | awk '{ print $1 }' | grep penny`; do blaf $foo; done; screen -r ;}

172 alias Ap='apt-cache policy'
173 alias As='apt-cache search'
174 alias Ai='apt-get install'
175 alias Ar='apt-get remove'
176 alias As='apt-get source'


Just thought I should share this :).



EDIT @ 21.11.2008: added lines [172-176]

2008-11-08

fbxkb flags patch

My primary keyboard layout is US (qwerty), but from time to time, one needs a different one (usually cz_qwerty or hu for me). So I have this handy line in my ~/.xinitrc that let's me switch to the alternate layout by using Right Alt:
setxkbmap -option grp:switch,grp:alts_toggle,grp_led:scroll us,cz_qwerty

And I use fbxkb to see the current layout in the tray. The only problem is, it doesn't work .. instead of the us flag, it shows question marks and when i switch to the us,hu layout combo, it shows question marks for both layouts.

Well, no more. It turns out, it was quite an easy bug to fix so here's a patch against fbxkb-0.6.

---Show the patch---

2008-10-24

pose (Palm Emulator) for amd64 debian / ubuntu

Some time ago, I moved from 32bit debian to 64bit debian on my notebook. So far, having configured flash and installed firefox from ubuntu, I haven't run into any problems. Until I tried to run Padict (Japanese dictionary for palms) under pose .. there is no pose package for amd64! And it's not so easy to compile either.

So now there is. The creation was relatively straightforward, first I downloaded i386 versions of pose and recursively all its dependencies that aren't architecture-independent from packages.debian.org. That's: pose (3.5-9.1), libdrm2 (2.3.1-1), libexpat1 (2.0.1-4), libfltk1.1 (1.1.9-6), libfontconfig1 (2.6.0-1), libfreetype6 (2.3.7-2), libgcc1 (1:4.3.2-1), libgl1-mesa-glx (7.0.3-6), libjpeg62 (6b-14), libpng12-0 (1.2.27-2), libstdc++6 (4.3.2-1), libx11-6 (2:1.1.5-2), libxau6 (1:1.0.3-3), libxcb-xlib0 (1.1-1.1), libxcb1 (1.1-1.1), libxdamage1 (1:1.1.1-4), libxdmcp6 (1:1.0.2-3), libxext6 (2:1.0.4-1), libxfixes3 (1:4.0.3-2), libxft2 (2.1.12-3), libxinerama1 (2:1.0.3-2), libxrender1 (1:0.9.4-2), libxxf86vm1 (1:1.0.2-1), zlib1g (1:1.2.3.3.dfsg-12).
And then I only extracted them (for foo in *deb; do dpkg-deb -X $foo .; done), renamed lib and usr/lib to lib32 and usr/lib32 respectively, removed crud from usr/share, renamed the binary, manpage and menu entry to pose32, created a Makefile, ran dh_make -n -c artistic -s -p pose32, edited debian/control a bit and finaly typed debuild and waited :).

You still need pose-skins and a rom image.
No, this version works, I see no reason to continually update it.

2007-08-08

claws-mail trayicon patch

My mailer is claws-mail (formerly known as sylpheed-claws, a fork of sylpheed) and I love it.
But there's one thing I miss: I can't make the trayicon plugin count only messages in the folders I want instead of all folders. (So it'd tell me about new messages in inbox + important but not in newsgroups and spam.)

Well, here's a quick and dirty proto patch for 2.10.0. The folder names are hardcoded into trayicon.c and necesary changes were made to folder.c . It works for me but of course I should pass a list of folders including paths instead of just a string like "folder1 folder2 ...folderN" and there should be a way to change the folders in the GUI. I'll do it later.

-- see claws-mail-2.10.0.trayicon.patch --

EDIT: As of claws-3.something, vanilla claws has this option in the menu, so the patch is no longer needed.

bSPLORKT

Uh, long time no C. Sorry.
So what happened, I passed most of my exams (except for PV168:the Java seminar (I didn't have time to do the project) and MB001:Analysis 2 (all of the slot collided with IB005 which I had to pass (and did))), then went to a family holiday (or "holiday"?) on Elba.
So, if you want to check out the photos, see himdel's picasaweb gallery.
And when I got back, I started to work, in soLNet. So far, I like it a lot.

And about all my other little projects, well, tell ya later.

But there's something you SHOULD see:
*TADA*
mpl, a mplayer wrapper .. written in Ruby, needs just mplayer in PATH

What's so cool about it?
* mpl without params does "mplayer *"
* mpl 1x01 does really "mplayer 1x01-TheFirstEpisode.ext" when 1x01 doesn't exist
* mpl folder/1x01 works too, folder must exist
* mpl folder doesn't work yet
* for a list of existing files, the behaviour is identical to mplayer's, mpl -fs *.avi does "mplayer -fs *.avi"
* mpl -R sorts the files randomly (all other -options are passed to mplayer)
* mpl first separates options and files, checks all the files to perform aforementioned substitutions, then runs "mplayer @options @files"

-- see mpl.rb --


EDIT: dirs work, does locate on still not found anything

2007-06-05

Sonata

Sonata (http://sonata.berlios.de/) is a gui mpd client. It's GTK, starts and closes to tray, shows notify on new song, downloading album art from the web, wheel on trayicon controls volume, and the opened interface is great too, much better than gmpc grids. In short, it's great!

2007-05-25

bib2xml progress

Allright, there's this course in my school, PB138 Moderní značkovací jazyky a jejich aplikace which basically deals with XML and the surrouning technologies. And it has team projects.

Our team's project is called bib2xml, it's really something akin to http://bibtexml.sourceforge.net/ , that is, it's supposed to parse a BibTeX file and output a XML file with the same info. The next stage is to XSTL the XML into a XHTML output.

Now I'm developing the first stage, the BibTeX to XML one and I'm proud to announce I hate Java. Oh, that and also that I'm almost done, just going to upload it to the repository!

The BibTeX parser is easy enough, just a bunch of regular expressions really. The only ugly part in this version is that it reads the whole file into memory which is kinda evil, I should probably fix it sooner or later.
The XML output is DOMmed :).

As for the other parts, a XSD file to check the XML output against is currently being worked on, someone should also be working on the GUI a and the XML 2 XHTML transform (XSLT or XQuery).

So, if you wanna check it out,
svn co https://kore.fi.muni.cz:5443/repos/fi/pb138/2007/bib2xml
Share and enjoy! :)
(Well, actually, it's a school project so I have no idea whether we can actually choose the license. But you can definitely share the link ;).)

2007-05-14

TODO

Sorry for the delay, I'm too busy with school now to properly write anything. In fact, right now, I should be studying for my MB001 test this evening.

check out changing date message headers in claws
import himdel's log, unix time 1157500800 to 1158537600
blog comixy
gdeskcal + google cal
pv168
books

2007-05-09

Google Reader

Google reader is a RSS feed aggregator, google style. That means it's AJAX, the UI is rather gmailish. Intuitive to use, easily integrated with Firefox and highly addictive. You can star messages, tag feeds into folders, share messages or tags, import lists of feeds, cool stuff. And best of all, I don't have to visit slashdot, root.cz, lwn, kerneltrap, comixes, blogs, etc. every day.
Well, second best. I forgot about it automatically showing a play button (flash) for any podcasts, great way to listen to BBC.

The UI for advanced stuff like maximizing the messages part of window is rather keyboard-centric ('u') but there is a greasemonkey script that adds a mouse button too if you prefer that. And this maximization is extremely useful for viewing wide webcomicses on a 1024x768 display.

Now if I can only find a way to integrate gdeskcal with Google calendar.

trida - rss

K tridnimu foru ktere jsem napsal nekdy kolem maturity (v jednoduchem PHP, nad MySQL) a ktere tak nejak prubezne dotvoruji (umi odpovidani, oznacovani novych zprav, ruznobarevne designy, smajliky, vytvareni linku a mozna jeste neco; backup skript jiz ulozil 74MB dat, 1 denne od 2005-10-10), dnes jsem pridal RSS feed. Je to RSS 2.0, generovana php skriptem, zadne fancy funkce, proste cte z db a generuje rucne to xml. A guess what, funguje celkem pekne. Konecne mam nove zpravy v Google Readeru.

Snad se nekdy dokopu i k narozkam, syntaxi pro formatovani, volitelnemu poctu zprav na stranku, ajaxu, smiley themes, loginu a tak.

picasaweb and f-spot

I've tried out Picasa some time ago, I found it enjoyable but rather impractical, I usually know where my pictures are, not when. One feature that's great is that you can upload albums to Picasa Web Albums (http://picasaweb.google.com). I'd use Flickr (http://www.flickr.com) but hey, Yahoo things feel uncomfortable.
I've just come from a trip to Italy so I wanted to upload some photos. Unfortunately, the current linux version of Picasa doesn't support this feature yet. After some googling I found F-Spot (http://www.f-spot.org) does. I've been meaing to give it a try anyway so I installed it.
Now, I should mention I'm using fvwm-crystal as my window manager, no desktop manager, no gnome or kde stuff. Well, F-Spot crashed some time befor I installed all the necessary stuff like gnome keyring a dbus and figured out I have to run it with 'dbus-launch f-spot'. That way, it starts just fine. I used the --view interface since it's simpler and more closer to what I like, unfortunately it doesn't have any way to sort the files (I've found no such way in the non-view interface either) and because it runs the images through a filter (convert to jpg, resize), it uploaded the files with a randomish filename. No sorting on PicasaWeb either, then. (Before I got even there, I had to install the SVN version instead of the stable one since there was a change of protocol.)
Being curious about C#, the language f-spot is written in, I decided to write a patch. Took a relatively short time, you can find the results at http://bugzilla.gnome.org/show_bug.cgi?id=437044 . I think I'm definitely going to play more with it. I should probably add a way to sort in the --view UI.

Labels

himdel's shared items