Well. In case you have not stumbled across the corresponding StackOverflow post, and if you have always wondered why vim does not work properly in cygwin, just
[rattle@ALICE:~]$ cat .vimrc
set nocompatible
set backspace=indent,eol,start
and your worries will be over.


A lot of people are in the situation where they want to use more than one Dropbox account on one (windows) machine (for whatever reason). The default way of doing this is the following: * create a new local user account * log in as that user and install Dropbox * log back in as the default user and use something like psexec to execute the installed Dropbox as the other user account while being logged in as default user To automate this process, I wrote the following script that also takes care of cosmetics like "hiding the newly created user from the login screen". Do you want to know more?


Hetzner has a webinterface to manage DNS zonefiles. Since their API does not support the management of zonefiles I decided to write a small python script that does the job ((There actually is a perl script that claims to do the same but it has the (long expired) "session id" hard coded I think.)). You can download it on github (use it at your own risk and read the code if you want to be sure). (more…)


If you run cygwin applications such as [the rsync-backup script](/2014/01/31/incremental-backups-with-rsync-in-windows/), you will sometimes run into trouble with odd NTFS permissions being set by the cygwin application. My tip is to avoid this by making cygwin not set *any* permissions at all. If a cygwin application then creates a file, for instance, this file will only inherit its security settings from the folder it is contained in. This way, you can set access control on the root directory and all the files created by rsync inside that folder will inherit these permissions. How to do it? Open your cygwin shell and edit /etc/fstab which should contain only one non-comment line:
none /cygdrive cygdrive binary,posix=0,user 0 0
Now insert the noacl attribute, see [the cygwin manual](http://www.cygwin.com/cygwin-ug-net/using.html#mount-table):
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
And the next time you run rsync-backup, it will *not* set all kinds of awkward permissions on your files which make them unreadable on a freshly installed computer. Just saying.


Most of you have probably heard of the new technology under the name 'Spritz' that allegedly enables you to read at a multiple of your usual pace. The concept is neither very new nor very complicated: Whenever we read a text, we do not scan every word, letter by letter, from left to right. Instead we focus on a single point for each word (apparently this point is after roughly one third of the word) and scan the whole thing in one go. So when we read text in the usual way, our eyes have to jump all over the place, trying to focus on the right spots and waste an awful lot of time in the process. The concept of Spritz is that you can focus at a single point on your screen and the app feeds you the words, one by one and in the right position. You can relax and let the words spritz into your eyes at high speed (yes, I went there). Since the idea is so simple, many different speed-readers (that's the general term that seems to have established itself) were published during the last few weeks. My goal was to find a nice speed-reader extension for my browser. Eventually I was successful and  learned quite a bit in the process. As requested I'll guide you through it: (more…)


Ich habe endlich herausgefunden, wie man auch die letzten merkwürdigen Autovervollständigungen von TexStudio eliminert. Das Problem ensteht vor allem mit deutschen Tastaturen, da man häufig Ctrl+Alt noch gedrückt hat, wenn man die Leertaste betätigt, etwa nachdem man eine schließende, geschweifte Klammer (Ctrl+Alt+0 liefert }) eingegeben hat. Dies hat in der TexStudio Standardkonfiguration zur Folge, dass ein \begin{ im Text eingefügt wird. Wie schaltet man das aus? So: * TexStudio konfigurieren * Tastenkürzel * Menüs * Idefix * Vervollständige * Den \begin{ Vervollständigungs-Hotkey löschen Es könnte noch andere Ctrl+Alt-Makros dieser Art geben, die man löschen sollte. Ich werde diesen Post updaten, wenn mir weitere unterkommen.


I was pointed to the cool rsync-backup script which uses cygwin's rsync and hardlinks in NTFS to provide a method for incremental backups which is probably the best I have seen so far. Basically, the effect is as follows: Whenever you backup your data to the backup location (which is somewhere on an NTFS drive), the only actual data that will be copied is for the files that have changed since the last backup. Nevertheless, there will be a new folder in your backup location which contains all files and folders you just backed up. Just: Those that did not change have not been copied, they have just been hardlinked to the old files instead. Now here comes the best part: The actual contents of a file with more than one hardlink to it are deleted only after the last link to it has been removed. Thus, you can delete old backups and the only data that will actually be deleted is the old data, the data that changed in later backups. Now, I modified the script slightly to better suit my needs. First of all, I only back up a single folder. If you want to backup multiple folders to a single location, move along. This is not for you. Use the original rsync-backup if you wish. Mine is different. Do you want to know more?


If you want to go from 32 to 64 bit [Cygwin](http://www.cygwin.com) but keep all the packages ((At least those that are available.)), you might find yourself in a spot where you would like to export the list of cygwin packages and also be able to install cygwin with all these packages again. I will tell you how. Open your Cygwin shell and enter
grep " 1$" /etc/setup/installed.db | awk '{print $1}' > packagelist
This will dump a list of all *selected* packages and is the kind contribution of Yamakuzure-san. Earlier, I had proposed the following command:
cygcheck -c -d | sed -e "1,2d" -e 's/ .*$//' > packagelist
which will simply dump a list of *installed* packages, including all the dependencies (possibly cluttering up your cygwin backup file). In the comments below you'll see that my command worked better in one case. If you decide to try both, leave a comment about how they performed for you. To install Cygwin 64 from such a package file, download [setup-x86_64](http://cygwin.com/setup-x86_64.exe). Of course, this will also work with the old [setup-x86.exe](http://cygwin.com/setup-x86.exe) if you are reading this just for the sake backing up your cygwin install configuration. Execute the installer with the command line parameters
./setup-x86_64 -P `awk 'NR==1{printf $1}{printf ",%s", $1}' packagelist`
The **awk** command reads your file and turns it into a comma-separated list, then this string is passed as the argument to the **-P** option of the installer. It may not be documented with great detail in the [Cygwin installer command-line options](http://cygwin.com/faq/faq.html#faq.setup.cli), but CSV is exactly what the **-P** option expects. Since you might want to use **cygcheck** to backup your cygwin-install, you might not have **awk** and a bash shell at your disposal at the time of install. However, you should certainly have some kind of python installed already. Here is a python script that will read your packages correctly and install cygwin with them selected:
from urllib import request
import sys, getopt, subprocess
build = 'x86'
packagefile = 'packagelist'
opts, args = getopt.getopt(sys.argv[1:],'',['64','packages='])
for o,a in opts:
    if o == '--64': build = 'x86_64'
    if o == '--packages':
        packagefile = a
setupfile = "setup-%s.exe" % build
packages = ','.join([ x.strip() for x in open(packagefile).readlines()])
r = request.urlopen("http://cygwin.com/%s" % setupfile)
open(setupfile,'wb').write(r.read())
subprocess.call([setupfile, '-P', packages ])
In fact, it first downloads the current setup executable from the cygwin server and then launches it. It accepts the option --64 to install 64 bit cygwin and the option --packages=packagelist to select a file with a list of packages.


I've had an Android phone for quite some time now. I do not want to give *anyone* my personal contacts. However, I want to synchronize my contacts across devices. So I used the *MyPhoneExplorer* to manually sync my contacts between the phone and all my three clients. Since this is a pain in the ass, I was looking for an alternate solution. Do you want to know how I did it?


I recently bought an Android phone. I do not want to give anyone my calendar data. However, I want to synchronize my calendar across devices. So I did it. Do you want to know how I did it?


I was cleaning up my LaTeX header and re-coded some macros to suit my needs better. I have always had a macro called \of which takes one parameter. It used to be the very simple macro
\newcommand{\of}[1]{\left(#1\right)}
However, I sometimes want to specify the size of the brackets explicitly, so I wanted to add an optional argument to this macro such that \of[big]{\sum} will expand to \bigl(\sum\bigr). Sometimes I even want it not to do any resizing of the brackets at all. The correct way to do this is is \csname and \endcsname which allows you to delay expansion of a macro. Inside a macro definition, the command
\newcommand{\ar}[1]{\csname#1arrow\endcsname}
will be such that \ar{right} is first made into \rightarrow and then expanded. We will use that to make \bigl and \bigr out of the argument big, for instance. Do you want to know more?


Nikolai asked me how to open a Python interpreter prompt from the console with a certain module already imported. For the record, the Python command line switches tell us that python -i -m module is the way to start the prompt and load module.py. That made me wonder whether I can stuff it all into one batch file, and I came up with the following test.bat:
REM = '''
@COPY %0.bat %0.py
@python %0.py
@DEL %0.py 
@goto :eof ::'''
del REM
for k in range(70):
    print(k)
That script will ignore the first line because it is a comment, then copy itself to test.py, then launch python with this argument. Afterwards, test.py is deleted and the script terminates without looking at any of the following lines. Note that :: is yet another way to comment in Batch. Python, however, will see a script where the variable REM is defined as a multi-line string and deleted right after that. After this little stub, you can put any python code you want. Well. I thought it was funky.


I have found and quickly begun to love a wonderful piece of software called TeXStudio. It's an open source LaTeX editor with preview pane and the preview is for the actual PDF document, not yet another buggy DVI viewer that fails to display your TiKzPictures correctly. It's available on all platforms. You have to seriously work through the (advanced) options and set it up to your liking ((This will most likely include shutting off all of the autocomplete features because they might otherwise drive you insane.)) , but I must say that this is probably the best LaTeX editor I have ever seen. Most prominently, it allowed me to switch all my projects to UTF-8 for the first time, because you can set file encoding in a comfortable way. It also does a good job at detecting UTF-8 and if everything fails, you can use the special comment !TeX encoding = UTF-8. Citing french papers has become slightly less of a torment.