Good online Python book with code examples
1st March 2010
Building Skills in Python: A Programmer’s Introduction to Python by Steven F. Lott (© 2002, 2005, 2007, 2008 Steven F. Lott).
Posted in Links | No Comments »
1st March 2010
Building Skills in Python: A Programmer’s Introduction to Python by Steven F. Lott (© 2002, 2005, 2007, 2008 Steven F. Lott).
Posted in Links | No Comments »
1st March 2010
screen is a must-use for anyone familiar with SSH sessions; it saves your time by keeping your console apps running even after (an unexpected) disconnect from the remote session.
The easiest way to start with screen is screenie – an interface to screen. To use it, you only need to memorize a single keyboard shortcut: C-a d (Ctrl+a, d). This shortcut detaches (hides) your current screen session, allowing to resume later – either with the help of screenie, or by issuing screen -r command.
After a while, with increased screen (and screenie) usage, you will find it inconvenient detaching every time you need a new screen session. Here comes the second keyboard shortcut: C-a c (Ctrl+a, c), which creates a new window within a current screen session, and switches to it.
Finally, you will find it tiresome detaching to then re-attach to a different screen. C-a “ (Ctrl+a, Shift+’) will display a list of screen windows for you to select and switch to.
Screenie, an excellent beginner’s interface to screen, is no longer needed after you memorize these 3 keyboard shortcuts.
Many will say that this is a bare minimum, and also there is much more to screen than what you present here, and that will be true. However, these 3 shortcuts are sufficient for simple but convenient everyday screen sessions management.
Posted in *nix, Software | No Comments »
1st March 2010
There is an excellent step-by-step instruction on resetting the bad clusters counter of an NTFS partition with linux-ntfs tools. I’ve checked – it works as expected:
- Back up important data from partition just in case
- Find out size of ‘$Bad’ attribute in $Badclus using ntfsinfo -i 8 partition (partition is for example /dev/sda1). It will be the “Allocated size” value in the “Dumping attribute $DATA (0×80)” (there will be two 0×80 attributes. Only one has an “Allocated size” line). Let us write down (remember) this size as ntfs_size.
- Use ntfstruncate partition 8 0×80 ‘$Bad’ 0 to set $Bad’s attribute length to zero.
- Use ntfstruncate partition 8 0×80 ‘$Bad’ ntfs_size to set $Bad’s attribute length back to proper value ntfs_size which was recorded in step 2.
- Boot into Windows and run chkdsk -f diskname. It will find errors and should fix them.
However, Debian’s ntfsprogs package does not have the ntfstruncate binary.
Here’s how you can easily build one yourself (you may need a few extra packages with build tools for that):
Read the rest of this entry »
Posted in *nix, Software, how-to | No Comments »
16th February 2010
“We only value what we loose”, they say.
Fortunately, I haven’t lost anything valuable, and don’t plan to. However, I did come to realize that false leads may and actually do obscure some simple happiness bits we fail to notice in our everyday life. Especially when that happiness comes from someone close, someone you literally got used to as to something inseparable from your life – but still fail to give value to.
Take care of your happiness and inner peace – do stop sometimes to thank and praise and value the oh-so-inseparable people around you.
Copyrights note: this is not my image, and I do not know who is the proper copyrights holder. It is used here for illustrative non-profit purposes, with a proper disclaimer. Contact me if you own the copyright and wish this image removed.
Posted in Personal, Society, Welfare | No Comments »
27th January 2010
Sometimes there is a need to remove all the probesets, which have expression values below the minimal spike-in intensity on the Affymetrix microarray. The reasoning behind this procedure is simple: minimal-expression spike-ins represent the bottom margin of microarray sensitivity, and anything below that margin cannot be reliably quantified – which also means that both fold-change and p-value of expression variance will be unreliable for these probesets.
Here’s a simple R script to do just that. It is abundantly commented, and also contains an optional (commented out) fragment which allows the removal of more low-variance, low-intensity probesets.
Posted in Bioinformatics, Programming, Science | No Comments »
25th January 2010
Recently, I have come across the Chandler project. Chandler is a sophisticated organizer, including tasks, calendar, appointments, invitations, and many more.
The project does provide a 64-bit package for Ubuntu 8.10 “Intrepid Ibex”, but it has a dependency on python-zope-interface – which in Debian testing is a virtual package, currently provided by python-zope.interface. That single dependency made my aptitude complain all the time, so I edited the .deb-file, renaming depends/python-zope-interface to depends/python-zope.interface (following nice and simple instructions). After that – no more aptitude complaints, and Chandler works fine.
Download the modified Chandler 1.0.3 Debian testing amd64 package (md5: 239071715977bea2eb75f3bb54491a02).
Posted in *nix, Software | 1 Comment »
24th January 2010
MathIsFun offers nicely illustrated pages on math, algebra, geometry and maybe more.
For example, there is a step-by-step instruction on calculating variance and standard deviation for a set of measured dog heights, with a final picture (below) illustrating one-sigma distance from the mean. Unfortunately, concepts of normal distribution and %% of data points within each sigma range are not discussed, but that might as well be too much for a nice explanation. There are also animations, like this mean machine. Overall, MathIsFun is a nice resource for younglings.

Posted in Links | No Comments »
3rd January 2010
Just a quick note: upgrading Drupal using a patch file is a really efficient and fast method, especially because diff/patch files are available for different Drupal version combinations.
Posted in Drupal, Links, Notepad, Web | No Comments »
5th December 2009

For about 2 weeks now, I am every day alerted of the suspicious behavior of some computer/server from the Google’s IP range:
Read the rest of this entry »
Posted in Misc, Web | No Comments »
14th November 2009
fail2ban has a php-url-fopen rule.
WordPress has a Global Translator plugin, which – among others – uses Google Translate service.
If someone uses Google Translate (e.g. using Global Translate’s mini-language-flags), and goes back to your blog – that someone might get banned by fail2ban (especially if you have set maxretry to 1), as the referrer will contain the php-URL-fopen attack signature. The bad thing is that you will not realize that until after you check one or several translations yourself, as a random site visitor experiencing the problem is highly unlikely to bother reporting this problem – especially when your blog’s Contact page is also inaccessible.
Clearly, Google Translate is not the only legitimate service which will trigger that rule.
Solution: The only solution I have found is to specify the whitelist regex for the php-URL-fopen rule.
Posted in *nix, Software, Web, WordPress PlugIns | No Comments »