Audiobooks have several specific features that differentiate them from bunch of songs and make it hard to listen to them using regular audio player:
* They can have the same title/album/artist headers, with filename the only difference.
* They must be in certain order.
* Once an audio file was listened to, it can be automatically safely deleted, thus freeing up space.
This makes audiobooks fit nicely into podcasts model.
To convert audiobooks into a podcast I wrote a python script that scans given directory of mp3 files and creates RSS feed out of the files. The verion 0.1 of the script can be downloaded from abook2podcast.
Monday, December 7, 2009
Monday, February 16, 2009
bittorrent and VoIP in the same sentence
At my home I have an modest ADSL line with a standard 128kbits upload. The upload is shared between several computers, an bittorrent process and asterisk (VoIP) server. I have looked around for an simple script to balance the upload according to set of very simple rules:
There are only two lines in the script to change. You should be aware of following assumptions in the script however:
You can download my script here.
- VoIP packets go out first, no matter what
- ssh, www, smtp, etc go after
- everything else (including bittorrent) go last
There are only two lines in the script to change. You should be aware of following assumptions in the script however:
- The machine serves as the gateway for your network
- Internet is established using autodialer on interface ppp0
- asterisk runs on the same machine as the shaper
You can download my script here.
Thursday, November 6, 2008
my 45 workplaces
Most windows managers out there are windows oriented, so that you have single desktop and many overlapping windows. This is true for MS Windows, Mac OS, Gnome and KDE. There are ways to set up several more workspaces, but most people would continue to use in windows-oriented style as all running applications would still be represented in task bar.
If you think about it, the windows-oriented workflow has great overhead, in resizing windows, looking for application in the task bar or list of applications and managing misplaced overlapping windows. Working with more than certain number of applications becomes unfeasible, as the overhead of managing so many windows becomes unbearable. There are many band-aids to minimize number of open windows, in form of tabs (especially in firefox or konsole), lame attempts to integrate many application in the same window (as mozilla thunderbird does) or hiding the application and it's interface into tiny icon in the status bar.
Ideally, one needs not to think how to switch to the application he needs to access. It would be even more desirable for the application to launched automatically if it is not running already. The desktop should be organized so, that it would not matter whether you have couple of windows opened or many hundreds (provided you have enough resources).
After experimenting with many approaches, I would like to share with you one that works good enough for me.
The venerable fvwm2 window manager, albeit being very old, remains highly configurable one. The configuration uses text configuration files, that allow user to customize look and feel of the window manager up to the low-level details, such as autofocus of windows or executing a shell script on magic keypress. The features are pretty important for the workflow described.
Easiest, immediate, switching to application of interest is by using dedicated button. Actually there are many keyboards that have additional buttons, just for that purpose. The approach has several issues, such as limited amount of buttons, predetermined functionality (psychologically aggravated by inscribed picture on the button) and dependence on the keyboard in use.
Software buttons, albeit requiring a bit of learning, look much better in this regard. If you use a combination of CTRL, ALT, SHIFT, CTRL+SHIFT, ALT+SHIFT modifier buttons together with the numeric buttons on grey part of the keyboard, you can easily get 45 "hot-keys".
Once you get 45 "hot-keys", you can create 45 workplaces, arranged in blocks of 9. Module of fvwm2 "FvwmButtons" shows them nicely in a corner of the screen:

The bright rectangles are already open windows. You can drag them from one workplace to another using mouse.
Now, as we reached the goal of instant switch to any workplace, each workplace can be dedicated to hold window (in rare cases couple of windows) of an application. For example, you can assign workplace ALT+7 to a internet browser, and workplace Alt+1 to a mail client. After several uses you would learn the hot-keys by heart, like you remember your password (which you can always type but not always remember).
The above scenario assumes that you launch the application in the dedicated workplace manually. Flexibility of the fvwm2 window manager allows to make each switching keypress to run a shell script, that would check whether the workplace already runs the application it was dedicated for, and, if not - automatically launch it.
This is exactly what I did as you can see in the configuration files over here.
As a added bonus, my auto-execution script checks hostname of the computer I am working on, and takes it into account when populating the workplace. For example, one of my workplaces is automatic ssh to the firewall, which is only accessible from inside of the corporate network. On my home computer, switch to the workplace would not launch anything, as it would be pointless.
If you think about it, the windows-oriented workflow has great overhead, in resizing windows, looking for application in the task bar or list of applications and managing misplaced overlapping windows. Working with more than certain number of applications becomes unfeasible, as the overhead of managing so many windows becomes unbearable. There are many band-aids to minimize number of open windows, in form of tabs (especially in firefox or konsole), lame attempts to integrate many application in the same window (as mozilla thunderbird does) or hiding the application and it's interface into tiny icon in the status bar.
Ideally, one needs not to think how to switch to the application he needs to access. It would be even more desirable for the application to launched automatically if it is not running already. The desktop should be organized so, that it would not matter whether you have couple of windows opened or many hundreds (provided you have enough resources).
After experimenting with many approaches, I would like to share with you one that works good enough for me.
The venerable fvwm2 window manager, albeit being very old, remains highly configurable one. The configuration uses text configuration files, that allow user to customize look and feel of the window manager up to the low-level details, such as autofocus of windows or executing a shell script on magic keypress. The features are pretty important for the workflow described.
Easiest, immediate, switching to application of interest is by using dedicated button. Actually there are many keyboards that have additional buttons, just for that purpose. The approach has several issues, such as limited amount of buttons, predetermined functionality (psychologically aggravated by inscribed picture on the button) and dependence on the keyboard in use.
Software buttons, albeit requiring a bit of learning, look much better in this regard. If you use a combination of CTRL, ALT, SHIFT, CTRL+SHIFT, ALT+SHIFT modifier buttons together with the numeric buttons on grey part of the keyboard, you can easily get 45 "hot-keys".
Once you get 45 "hot-keys", you can create 45 workplaces, arranged in blocks of 9. Module of fvwm2 "FvwmButtons" shows them nicely in a corner of the screen:

The bright rectangles are already open windows. You can drag them from one workplace to another using mouse.
Now, as we reached the goal of instant switch to any workplace, each workplace can be dedicated to hold window (in rare cases couple of windows) of an application. For example, you can assign workplace ALT+7 to a internet browser, and workplace Alt+1 to a mail client. After several uses you would learn the hot-keys by heart, like you remember your password (which you can always type but not always remember).
The above scenario assumes that you launch the application in the dedicated workplace manually. Flexibility of the fvwm2 window manager allows to make each switching keypress to run a shell script, that would check whether the workplace already runs the application it was dedicated for, and, if not - automatically launch it.
This is exactly what I did as you can see in the configuration files over here.
As a added bonus, my auto-execution script checks hostname of the computer I am working on, and takes it into account when populating the workplace. For example, one of my workplaces is automatic ssh to the firewall, which is only accessible from inside of the corporate network. On my home computer, switch to the workplace would not launch anything, as it would be pointless.
Tuesday, September 2, 2008
Back to my linux
Recently I had to set up linux for my niece, which is eight years old. Besides making the system obscenely simple (that would be subject for a separate post), I was challenged to find a way to get back to her computer, should the need arise.
As the computer will be behind a NATing router, simply opening the ports was not sufficient. There had to be a way for me to connect to her computer. Here is what I have done:
I placed on her desktop icon of rescue buoy that was launching following shell script:
#!/bin/sh
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true &&
xterm -e ssh -R 2000:127.0.0.1:5900 feshuk-amalia@callback.mycompany.com
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled false
To make the gnome's builtin VNC server vino to accept incoming connections, I set up it's preferences and password using following commands:
vino-preferences
vino-passwd
I chose vino over x11vnc server, as it has intrinsic awareness about the windows and background (which it can effectively hide) thus being more traffc-effective, whereas x11vnc treats the whole screen as an image.
Update 20090704: Users with NVidia card might have problems with vino (#353126). One of the workarounds is to use x1vnc server using following command:
x11vnc -display :0.0
The script would make vino to accept VNC connections and execute ssh port forwarding feature, that essentially logins into the feshuk-amalia@callback.mycompany.com, starts listening on port 2000 and redirects the port to 127.0.0.1:5900 on her's local machine.
To allow password-less logon, ssh keypair was created, and the public key was copied to /home/feshuk-amalia/.ssh/authorized_keys on the computer callback.mycompany.com.
This way, should she need my help, all she needs to do is to call me by phone, double click on the "Help me" icon and wait for me. Then all I need is to connect to the port 2000 on the callback.mycompany.com machine using following command:
xvncviewer -via root@callback.mycompany.com 127.0.0.1::2000
Once I enter VNC password, I have full access to display, mouse and keyboard of her computer, to install new game or explain how to play in already installed ones.
As the computer will be behind a NATing router, simply opening the ports was not sufficient. There had to be a way for me to connect to her computer. Here is what I have done:
I placed on her desktop icon of rescue buoy that was launching following shell script:
#!/bin/sh
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true &&
xterm -e ssh -R 2000:127.0.0.1:5900 feshuk-amalia@callback.mycompany.com
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled false
To make the gnome's builtin VNC server vino to accept incoming connections, I set up it's preferences and password using following commands:
vino-preferences
vino-passwd
I chose vino over x11vnc server, as it has intrinsic awareness about the windows and background (which it can effectively hide) thus being more traffc-effective, whereas x11vnc treats the whole screen as an image.
Update 20090704: Users with NVidia card might have problems with vino (#353126). One of the workarounds is to use x1vnc server using following command:
x11vnc -display :0.0
The script would make vino to accept VNC connections and execute ssh port forwarding feature, that essentially logins into the feshuk-amalia@callback.mycompany.com, starts listening on port 2000 and redirects the port to 127.0.0.1:5900 on her's local machine.
To allow password-less logon, ssh keypair was created, and the public key was copied to /home/feshuk-amalia/.ssh/authorized_keys on the computer callback.mycompany.com.
This way, should she need my help, all she needs to do is to call me by phone, double click on the "Help me" icon and wait for me. Then all I need is to connect to the port 2000 on the callback.mycompany.com machine using following command:
xvncviewer -via root@callback.mycompany.com 127.0.0.1::2000
Once I enter VNC password, I have full access to display, mouse and keyboard of her computer, to install new game or explain how to play in already installed ones.
Subscribe to:
Posts (Atom)