Recently I’ve upgraded my A/V storage disk from 1TB to 2TB (size of modern HDDs are amazing…), and I had to transfer data from one disk to another in some way. Easiest was of course to simply use cp to copy the whole directory structure. But as USB interface is slow enough, I wanted to employ any possible method to speed things up.

From the old times as a sysadmin I’ve remembered that copying, doesn’t matter local or over the network, was faster if data was copied in chunks – that was true especially when having a lot of small files.

So, to kill two birds with one stone, I employed… tar. Yeah, it’s a very versatile tool – in some time I’ll describe how to use it as a part of a network encrypted backup solution. But here, I used only two instances of tar. You have to remember that if you specify absolute path to the directory you want to transfer, tar will record all elements of the path, only stripping “/” from the beginning. So there are two ways: either record whole path and strip it when “decompressing”, or not to include it at all.

Lets assume that we’re copying data from /media/external0 to /media/external1.

First option:

cd /media/external1
tar cf - /media/external0 | tar x -f - --strip-components=2

Second option:

cd /media/external0
tar cf - * | tar x -C /media/external1 -f -

The first tar command “compresses” the data (either from given directory or from the current one), sends it to the standard output, which goes into the second tar’s input, which decompresses it into the target directory.

To see the progress, you can put cpipe application in the middle like that:

tar cf - /media/external0 | cpipe -vt | tar x -f - --strip-components=2

One note on an improved performance using this method. I didn’t do any benchmarks, but it shouldn’t be worse than a standard cp. tar will be better if the OS is not using any smart pre-buffering. Also I’ve decided to write this entry as an introduction to a future one about over-the-net backup using tar

If you ever wondered if it’s possible to keep screen from blanking/locking while the device is plugged into a charger, the answer is yes, it is possible, without any additional apps. Only the setting for this is strangely placed. To enable this feature, go into Menu → Settings → Applications → Development and tick “Stay Awake”. That’s it.

Recently I’ve started to embrace PowerShell’s great possibilities, and as a result of that, I’ll post some of my “toys”.

On Unix-like operating system I’m using host command to resolve hostnames into IP’s and the other way. On Windows, there’s a nslookup tool, which works just like the Unix equivalent, but to get accustomed to PowerShell, I’ve decided to write a function, which uses internal command to do NS lookups.

Generally, to resolve a hostname you can use this one-liner:

[System.Net.Dns]::GetHostAddresses("devplant.net")

You can shorten it by declaring a short function.

function resolve( [string] $in ){
   [System.Net.Dns]::GetHostAddresses($in)
}

(Defining functions remember not to collide with pre-existing variable names)

But this is only one-way command – to resolve IP address into a hostname, you have to use other command:

[System.Net.Dns]::GetHostbyAddress("72.21.210.250")

To combine both functionalities, you can extend our function, using regular expression to do a naive recognition of IP addresses.

function resolve( [string] $in ){
	if ($in -match "(\d{1,3}\.){3}(\d{1,3})") {
		[System.Net.Dns]::GetHostbyAddress($in)
	} else {
		[System.Net.Dns]::GetHostAddresses($in)
	}
}

Now here’s how you can use it:

PS C:\Users\leafnode> resolve devplant.net

IPAddressToString : 91.192.224.142
Address           : 2397093979
AddressFamily     : InterNetwork
ScopeId           :
IsIPv6Multicast   : False
IsIPv6LinkLocal   : False
IsIPv6SiteLocal   : False

PS C:\Users\leafnode> resolve 72.21.210.250

HostName                Aliases           AddressList
--------                -------           -----------
210-250.amazon.com      {}                {72.21.210.250}

PS C:\Users\leafnode>

Make compatibleYou want to try Firefox 3.5 but your favourite extensions are not compatible with the new version? There is a possible solution for this problem.

As in case of extension interface nothing much changed between Firefox 3.0.* and 3.5, it is possible that extension compatible with older version will work without any changes – except the maxVersion setting, which prevents Firefox from installing apparently incompatible extension. Manually, you’d have to download XPI file, decompress, edit settings, re-compress, and install from file. Quite cumbersome, but…

Extension MR Tech Toolkit allows you to tweak some of the extensions’ settings, including maxVersion, without any hassle. Just right-click on an incompatible extension, select “Make compatible” from the menu, and that’s it! After Firefox restarts, if extension really is compatible, it will be working fine.

MicroSD cardWindows XP on a netbook works fine with me, but as a person with Linux background it seemed natural to try some distribution on my Wind. As I wanted to try it first, I’ve decided to user some live distribution first. I don’t have an external CD device, but on a previous occasion I’ve managed to cope with bootable USB drives, so it was a natural (and only) choice. I was just about to re-format pendrive I’ve used to boot Linux from, but then I remembered that I have couple of loose 2GB microSD cards I’ve bought just because they were cheap, and an USB card reader. Idea of having an operating system on a so tiny memory card was very appealing!
Continue reading ‘Operating system on a memory card’

If you get error messages like “svn: OPTIONS of ‘http://svn.example.com/svn/module’: could not connect to server (http://svn.example.com)” in Debian Squeeze/testing, you probably have the same problem as I. It appears that recently a broken neon library was transferred to debian/testing repository, what broke subversion client functionality. There are few options.
Continue reading ‘SVN problems in Debian Squeeze/testing’

As I have spent some time resolving the problem, I’ve decided to share the solution with you.

I have bought my MSI Wind as soon as they were available in Poland, in July last year. It was quite some time ago, so I decided to update BIOS. I downloaded it from MSI official page, prepared bootable pendrive using HP USB Storage Disk Format Tool (downloadable from here) and Windows 98 boot files from my own archives (you can find some boot disk images at bootdisk.com). After extracting BIOS files to the pendrive, I’ve booted system from it.
Continue reading ‘MSI Wind system booting problems after BIOS update’

Recently Brian Aker announced that he will develop RDBMS trimmed especially to use with web-apps. It will be named Drizzle.

Features of Drizzle

What will be changed in Drizzle in comparison to MySQL? First of all, whole architecture will be changed. Drizzle will be not monolithic chunk of software like its predecessor, but it will be based on microkernel idea. Most features will be moved from core to optional modules. Those features, like triggers, views, or even query cache, are standard for modern database servers, but are very rarely used in webapps (which is very strange for me, but I’ll come back to this later). One of these modules will be InnoDB engine (owned by Oracle, double licensed), which would make upgrading to newest version of that engine easier. UTF-8 will be standard. Generally – looks nice.

On the other hand, Windows users will be sad, because probably (but not for sure), Drizzle will be available only for Linux and MacOS X. Maybe it’s not such a big deal, because most of production servers are working under non-windows OS’, but for development it would be nice to have a possibility to test-install this RDBMS on Windows.
Continue reading ‘Where are you going, MySQL?’

I’ve “always” wanted to have a very small notebook, to use it as a replacement for a PDA, but with more traditional keyboard and possibility to run normal applications. It was difficult, because until few months ago small notebooks were very expensive. The only affordable ones were 3 years old x-series ThinkPads, but it was hard to find a decent battery for it. But in 2007 Asus announced its plans to release cheap, small notebooks named Eee PC (Eee stands for Easy to learn, Easy to work, Easy to play). First version, with 7″ screen, used 900 MHz Celeron-M processor, which was not that well suited for this job, as it ate quite a lot of “juice” from battery. Year later, 9″ screen 900 series came to the public, 900 still having Celeron processor, and, later, 901, having the new Intel child – Atom. Atom was specifically designed for this purpose – ultra-mobile computers, with not so great performance, but with low energy consumption.

But Asus’ competition did not sleep. First HP, then other companies prepared their own cheap notebooks. HP MiniNote 2133 looked great, but included poor Via processor. MSI announced their UMPC to be released in July 2008, but had problems with their battery factory burning down, so they had to reschedule a bit – instead of the beginning, Wind was released in the end of that month, and only with 3-cell battery, 80GB HDD and Windows XP operating system, with other configuration options coming in august. Acer Aspire One, on the other hand, started with lo-fi version – 512 MB RAM (half of that installed in Wind), 8GB SSD “hard disk” and Linpus Linux. More manufacturers announced their plans to release such notebooks, including Dell.

I had to choose something. First criterion was availability. I live in Poland, and the problem is that distributors ignore our market. For instance, first versions of Eee PC are still not officially available here. Of course, I could take advantage of private importers, or even friends abroad, but I would do this only as a last resort. Last week, when I was still deliberating “what to buy”, I could choose from old Eee’s (701 etc), Eee PC 900, MSI Wind (official distributor, yay!), or ask friend to buy and send me Acer Aspire One. I’ve decided that I want large HDD, as I wanted to use Windows and 8GB is not enough, so Acer was not an option. Eee PC 900’s processor was energy-consuming, so I’ve decided to go for a notebook with Intel’s Atom, and 901 was unavailable even on Polish internet auctions. 901 had advantage of being smaller that Wind, but I’ve compared sizes on paper and Wind was only 2.5 cm wider, negligibly deeper, and a bit thinner, so size wasn’t a key feature in this comparison. Other thing was that I couldn’t wait too long – I have a moving planned soon, so it was possible that in a month I’d be without any spare money. And then, I went on and bought MSI Wind. I’ve ordered one from MSI’s official distributor, with doubled RAM (without any price increase, compared to the price Wind was being sold from other retailers).
Continue reading ‘MSI Wind – here it comes!’

I wanted to share few files from my home server computer, so I’ve decided to run FTP server on that box. I’ve chosen not to use SFTP/SCP because I don’t like the way progress reporting is handled – progress bars are updated only after quite large chunk of data are transferred, otherwise dialogs are frozen. FTP is quite robust, and there is plenty of client software. I myself use built-in FTP feature of Total Commander.
Continue reading ‘Private FTP server’


About

Late-night coder, early morning server administrator, afternoon photographer. On this blog, I'll share my thoughts on first two of these.


About

Late-night coder, early morning server administrator, afternoon photographer. On this blog, I'll share my thoughts on first two of these.