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 »
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 »
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 »
13th November 2009
A nice report on the cost of bruteforcing variable-length and variable-complexity passwords using cloud computing services (e.g. Amazon’s EC). There’s a kind of a tutorial in their previous post.
Slow DoS attack with just 1 computer against a number of web servers, including Apache: slowloris. There is a solution for Apache, packaged for RedHat and also available for Debian.
Finally, there’s Go programming language. The most inspiring promise to me personally is the ease of execution parallelization with language’s built-in syntactic constructs. That is something highly desired. Also, I like that it is a compiled language. However, it might be 10%-20% slower than pure C. Let’s see how it grows.
Posted in Links, Misc, Programming, Security, Web | No Comments »
5th November 2009
ocrodjvu = OCRopus (tesseract) + DJVU
It is a small command-line tool to easily convert your image-only DJVU files into image+text DJVU files. In Debian testing, there are language packages for (in no specific order) German, English, French, Spanish, Vietnamese, Brasilian Portuguese, Dutch, and Italian. The original tesseract-ocr software includes training data & code, so it should be (at least in theory) easy to add more recognition languages.
Posted in Links, Software, Technologies | No Comments »
25th October 2009
Production: see http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch – it is for Debian Etch (which is old-stable), but many of the steps apply equally well to Debian Lenny (current-stable). Also, this is a very basic guide, as if you are going to host multiple sites from multiple clients, you most definitely will need some hosting control panel.
Development: see http://www.ruzee.com/blog/2009/01/apache-virtual-hosts-a-clean-setup-for-php-developers. This setup works very well, unless you need to create several virtual hosts every day – in which case necessary actions could be partially scripted.
Posted in Links, Notepad, PHP, Programming, Software | No Comments »
21st October 2009
If you get this message when opening vignettes:
Error in openPDF(vif) :
getOption(‘pdfviewer’) is ”; please use ‘options(pdfviewer=…)’
and you are tired of running this command every time:
> options(pdfviewer=”okular”)
then you should check if your system-wide Renviron file has proper PDF viewer set:
Read the rest of this entry »
Posted in *nix, Notepad, Software, how-to | No Comments »
16th October 2009
PwdHash uses your “single password” to create a site-unique password (by making a one-way hash of your password and the site’s domain).
Although I’m not using “single password for all sites”, PwdHash does look very convenient.
Posted in Links, Software, Web | No Comments »
10th October 2009
Regular expressions (regexps) are powerful indeed. But debugging non-trivial regexps is a burden even if you understand how regexps work, and remember most (if not all) regexp syntax.
Miscellaneous tools exist to ease this task. This post was inspired by redet’s comparison of regexp helper tools – it could be sufficient to read only that, if you’re going to try the mentioned tools yourself. Otherwise, read on.
Read the rest of this entry »
Posted in *nix, Notepad, Programming, Software | No Comments »