yury’s posterous

 

JKScroller on linux

For convenient using of pointing stick on windows I wrote JKScroller. I missed it on my ubuntu. So here is solution:
1. sudo apt-get install xbindkeys xbindkeys-config xmacro
2. xbindkeys --defaults > ~/.xbindkeysrc
3. edit your xbindkeysrc for your needs. Use xbindkeys-config for easy key binding.

my file looks like this:


"echo 'ButtonPress 4 ButtonRelease 4' | xmacroplay :0"
Mod4 + q | m:0x40 + c:24

"echo 'ButtonPress 5 ButtonRelease 5' | xmacroplay :0"
Mod4 + a | m:0x40 + c:38

"echo 'ButtonPress 2 ButtonRelease 2' | xmacroplay :0"
Mod4 + h | m:0x40 + c:43

"nautilus ~"
Mod4 + e | m:0x40 + c:26



ps. don't forget to put xbindkeys to session

Comments [0]

Move mysql databases on Ubuntu

Вот тут рабочий рецепт.

Comments [0]

AnjLab.SyncIt v0.4.65.92 is out

This release includes:
* many bug fixes
* two way synchronization with 1c and dotProject
* missing libraries added to archive

So feel free to test it yourself. Grab it from here.

Comments [0]

copy files to pocket pc from ubuntu through usb

I like to listen Radio-T, to watch RailsCasts and Google Video on my way to work. I use my pocket pc (Glofiish x600) for that.
I didn't find any way to copy files to my pocket pc with default ubuntu utilities. Yesterday I found wm5storage. It turns my phone into a flash drive so ubuntu easily mounts it. Now I don't need to boot in windows to copy new casts.

Comments [0]

database.yml, mysql and ubuntu

If you don't want to specify 'socket' entry in rails database.yml simply create link for it:


sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

Now you database.yml may look like this:

defaults: &defaults
adapter: mysql
encoding: utf8
username: user
password: secret
host: localhost

development:
database: somedb

test:
database: somedb_test

production:
database: somedb_production

Comments [0]

ruby web stack on Ubuntu 8.04

Working installation instruction.

Comments [0]

change font size in skype 2.0 in ubuntu 8.04

Default font size in skype is very small for me. Here what I did to increase it:
sudo apt-get install qt4-qtconfig
then in System->Preferencies->Qt 4 settings in font tab set desired font size

Comments [0]

Приятности Ruby

Вот сидел я тут и разбирался с zentest и в его коде я узнал (я конечно, мало чего еще знаю про ruby) прикольную штуку. Если записать команду между ``, то запустится процесс и вернет весь output. Например:


irb(main):001:0> volume_info = `vol`
=> " Volume in drive C is vista\n Volume Serial Number is E486-92B6\n"
irb(main):002:0>

Даже не хочется приводить пример сколько строк кода это займет, например на C#. (Против C# я ничего не имею %).

Comments [0]

Ruby zentest autotest and Netbeans 6.1

In netbeans auto test feature works well with rails projects but fails with simple ruby projects.
ZenTest has very strange heuristics for non rails projects:

  • Test files must be stored in the test directory
  • Implementation files must be stored in the lib directory
  • Test files names must start with test_
  • Test class names must start with Test
  • Test files corresponding to a specific implementation file must be named test_name of implementation file>.rb
Active* libraries and many others have different convention for naming test files and classes:
  • Test files must be stored in the test directory
  • Implementation files must be stored in the lib directory
  • Test files names must end with _test
  • Test class names must end with Test
  • Test files corresponding to a specific implementation file must be named name of implementation file>_test.rb
Moreover netbeans use this convention to find testing file and test for specific file (rclick->navigate->go to test/go to tested file).

So if I have project with following layout:
lib
--example
----some_class.rb
test
--example
----some_class_test.rb

Autotest gives me:
Dunno! nbproject/private/rake-t.txt
Dunno! lib/example/some_class.rb
Dunno! README
Dunno! lib/main.rb
Dunno! Rakefile
Dunno! nbproject/project.xml
Dunno! nbproject/project.properties
Dunno! test/example/some_class_test.rb

So autotest simply doesn't work with this test naming convention by default.
Lucky for us ZenTest have hooks mechanism that allows to change default behavior.

So I wrote .autotest file and put it in project directory:
lib
--example
----some_class.rb
test
--example
----some_class_test.rb
.autotest

.autotest contents:

Autotest.add_hook :initialize do |at|
at.clear_mappings
at.add_mapping(/^lib\/(.*)\.rb$/) do |f, m|
at.files_matching(/^test\/#{m[1]}_test\.rb$/)
end

at.add_mapping(/^test\/(.*)_test\.rb$/) do |f, m|
at.files_matching(/^test\/#{m[1]}_test\.rb$/)
end
end

class Autotest

def path_to_classname(s)
sep = File::SEPARATOR
f = s.sub(/^test#{sep}((unit|functional|\
integration|views|\
controllers|helpers)\
#{sep})?/, '').sub(/\.rb$/, '').split(sep)
f = f.map { |path| path.split(/_/).map { |seg|
seg.capitalize }.join }
res = f.join('::')
res
end
end
Теперь это выглядит так:



So I edit any class and autotest it! It very cool feature to have. Thanks for zentest authors.
I hope this post will help anyone.

Comments [0]

Our new product - AnjLab.SyncIT

- Do you have a lot of projects?
- Are you using code.google.com hosing?
- Are you using trac?
- Or may be you are using dotproject?
- Or may be you are using all above?

We use all of them, and we develop small utility to stay tuned with all our projects - AnjLab.SyncIT.

Just try it! It's absolutely free, moreover it is open source.

Comments [0]