Useful stuff about dealing with partitions etc. on these new-fangled 4096-byte-sectored hard disks:
http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
Useful stuff about dealing with partitions etc. on these new-fangled 4096-byte-sectored hard disks:
http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
I usually run chkdsk from a bootable CD such as Hiren’s, but today I had a Vista machine with a disk fault, and chkdsk from the CD kept hanging at 1% of phase 4: it got completely stuck, and I had to force the computer to power off.
I thought that the disk must be completely borked, but in fact it did boot into Windows — but very slowly. And when I set Vista’s chkdsk to run on restart, it worked perfectly: it just found bad sectors in one file.
So, the moral is: don’t dismiss the idea of running chkdsk from the faulty disk, even with Vista.
(Originally posted on the offlineimap mailing list on 15 Jan 2012)
I’ve finally got offlineimap’s ‘nametrans’ feature to do what I want.
Part of the problem was that I found the documentation and examples to be somewhat ambiguous in terms of which direction the translation would happen.
Anyway, I’ve got it working, so here are my notes which will hopefully be helpful to others.
The ‘nametrans’ configuration option allows conversion between different folder names on the local and remote repositories.
nametrans specifies a Python expression which, given each folder name from the repository in turn, returns the equivalent name on the other repository.
In the configuration of the local repository, the nametrans code receives each local folder name, and returns the name of the equivalent remote folder.
In the remote repository configuration, the nametrans code gets the remote folder names, one at a time, and returns the equivalent local names.
Here’s a real example. My remote repository is on my ISP’s server. The ISP’s spam filter puts spam emails into a folder called ‘Spam’, and deleted emails into ‘Trash’. The local repository, on a Debian server running Dovecot IMAP, is accessed by users via Outlook, which likes to use the folder name ‘Junk E-mail’ for spam and ‘Deleted Items’ for deleted emails.
So to avoid confusion, I’ve set up name translations:
<code>[Repository LocalIMAP]
type = IMAP
remotehost = localhost
...
nametrans = lambda foldername: re.sub ('^Junk E-mail$', 'Spam',
re.sub ('^Deleted Items$', 'Trash',
foldername))
[Repository RemoteIMAP]
type = IMAP
remotehost = isp.example.com
...
nametrans = lambda foldername: re.sub ('^Spam$', 'Junk E-mail',
re.sub ('^Trash$', 'Deleted Items',
foldername))</code>
I won’t explain Python lambdas and regular expressions here. But beginners should note
With this configuration, offlineimap will synchronise the local ‘Junk E-mail’ folder with the remote ‘Spam’ folder, and local ‘Deleted Items’ with remote ‘Trash’ in both directions.
Problems will occur if the ‘foreign’ name exists as a folder. For example, if ‘Trash’ exists on the local repository, you’ll get this error message:
<code>ERROR: INFINITE FOLDER CREATION DETECTED! Folder 'Trash' (repository 'LocalIMAP') would be created as folder 'Trash' (repository 'RemoteIMAP'). The latter becomes 'Deleted Items' in return, leading to infinite folder creation cycles. SOLUTION: 1) Do set your nametrans rules on both repositories so they lead to identical names if applied back and forth. 2) Use folderfilter settings on a repository to prevent some folders from being created on the other side.</code>
I found that message only partially helpful: does it mean use both solutions 1) and 2), or either?
Solution 3) would be “Remove folder ‘Trash’ from the local repository”, but if you don’t want to do that, then solution 2) is required: add a folderfilter to stop the local ‘Trash’ from being copied to the remote side, like this (in the local repository configuration):
<code>folderfilter = lambda foldername: foldername not in ['Trash']</code>
That folderfilter is only required, in this example, if ‘Trash’ already exists locally, or if there is any danger of it being created in the future. It’s always possible that a translated folder name could be created by the user, so it’s safest to add folderfilters for any translated folder names. To complete my real-world example from above, I need:
<code>[Repository LocalIMAP]
# Has folders: Inbox, Junk E-mail, Deleted Items, etc.
type = IMAP
remotehost = localhost
...
nametrans = lambda foldername: re.sub ('^Junk E-mail$', 'Spam',
re.sub ('^Deleted Items$', 'Trash',
foldername))
folderfilter = lambda foldername: foldername not in ['Spam', 'Trash']
[Repository RemoteIMAP]
# Has folders: Inbox, Spam, Trash, etc.
type = IMAP
remotehost = isp.example.com
...
nametrans = lambda foldername: re.sub ('^Spam$', 'Junk E-mail',
re.sub ('^Trash$', 'Deleted Items',
foldername))
folderfilter = lambda foldername: foldername not in ['Junk E-mail',
'Deleted Items']
</code>
I hope that’s clear, and that it’s helpful to people. Perhaps some of it could be included in the offlineimap documentation.
Good instructions are here: http://egressive.com/tutorial/creating-a-multi-resolution-favicon-including-transparency-with-the-gimp
The version of GnuCash in Arch Linux, although up-to-date, is not compiled to use the webkit library, so formatting of reports such the tax invoice is very basic: it doesn't use the fonts that can be selected in the report options.
It's easily fixed though:
I've just set up a Windows 7 PC, and it helpfully asked if I wanted to create one big partition on the (1TB) disk, or to create a separate partition for 'data'. It offered a default size of 50GB for the 'system', but I chose 100GB, with all the rest for 'data'. And then it completely failed to put the users' 'My Documents' etc. onto the data partition. In my experience, very few ordinary Windows users make use of space that isn't in the default location, i.e. My Documents, My Music, or My Videos.
So there must be an easy way to get Windows to put My Documents somewhere else mustn't there? Well, sort of. Right-click on My Documents, select Properties, and change the location. Fine. But you have to do it for each category, and each user. And it still doesn't move the application data, registry stuff, or the temporary files etc.
On the other hand, with Windows 7 it's also possible to include arbirtrary directories into the 'library', so that could work for you.
I found a good set of instructions on SevenForums that actually does what I want. It's a bit fiddly, and I found those instructions incomplete.
So this is my solution. Ideally do this when setting up the computer from new — otherwise, there will be a lot of registry editing at least, and quite possibly some applications that lose track of their files.
Notes:
The approach is to use an administrator account to move each of the other accounts (which may themselves be administrators). If you've got two admin accounts, they can move each other. Or you can create a temporary administrator account just for this manouevre. It should also be possible to do this from a bootable CD such as Hiren's, although I haven't tried that yet.
[Copied from http://jlcoady.net/windows/how-to-resolve-mount-error12-cannot-allocate-memory-windows-share because it's so useful.]
If you mount a Windows 7 share using Samba/CIFS you may run into “mount error(12): Cannot allocate memory” if you are using very large files on the Windows machine. Looks like in certain situations Windows needs to be told to run as a file server and to expect large files. You can read more details at Large Files are locking up Windows 7 32 bit and 64 bit, but the solution is to make two registry edits and then restart a service:
Once you have done that you should be able to mount the share using a command like “sudo mount -a” or just reboot the Linux machine.
Dial-up modems have always been a pain on Linux. I got this one working though.
System: old PC running Ubuntu 10.10 (yes, still).
Modem: PCI card with Agere DSP chipset — i.e. a 'winmodem'.
Scanmodem reveals that it will work with the 'martian' driver, which is available on Ubuntu as packages 'martian' and 'martian-source'.
Having installed the packages, there is still some work to do which has to be repeated every time the Linux kernel gets updated:
As root:
cd /usr/src/modules/martian-modem/source
make
make install
depmod -a
modprobe martian-dev
(Those instructions are fairly minimal, but you should get the idea.)
I know Arch Linux doesn't hold your hand like other distros do, but I think it could make setting the keyboard layout easier.
Firstly, set the locale in rc.conf:
...
KEYMAP="uk"
LOCALE="en_GB.UTF-8"
...
and then reboot. Reboot? Surely there's a better way, but I don't know what it is.
Edit /etc/locale.gen to uncomment the ones you want to use — en_GB.UTF-8 and en_GB in my case.
Then you can run
# locale > /etc/locale.conf
For 'normal' sorting of ls listings etc., edit /etc/locale.conf and set
LC_COLLATE="C"
That should sort things out on the console.
For XFCE, it's tricky because the Applications Menu / Settings / Keyboard seems to be ignored. So refer to https://wiki.archlinux.org/index.php/Xorg#Setting_Keyboard_Layout_With_Hot-Plugging and add this to /etc/X11/xorg.conf:
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbLayout" "gb"
EndSection
and restart X.