Say you work somewhere where all workstations run Linux, only you have Windows on your laptop, which you basically use all the time. Now as I type this, I am not sure if anyone else shares my fate. Anyway; this does not stop you from running some of the cool Linux tools. Just install <a href="http://x.cygwin.com/" target="_blank">CygwinX</a> (through the regular <a href="http://www.cygwin.com/" target="_blank">Cygwin</a> installer) and start the XServer from the start menu. Icons will appear in your taskbar and you can start an XTerm. Inside that XTerm, type: ```bash rattle@windows.box$ ssh -Y rattle@linux.box Password: Last login: Thu Sep 17 12:43:19 2015 from windows.box rattle@linux.box$ xmaple ``` and there you go! <figure id="attachment_3473" aria-describedby="caption-attachment-3473" style="width: 300px" class="wp-caption aligncenter"><a href="http://blag.nullteilerfrei.de/wp-content/uploads/2015/09/maple.on_.windows.png"><img fetchpriority="high" decoding="async" src="http://blag.nullteilerfrei.de/wp-content/uploads/2015/09/maple.on_.windows-300x188.png" alt="Maple on Windows" width="300" height="188" class="size-medium wp-image-3473" srcset="https://blag.nullteilerfrei.de/wp-content/uploads/2015/09/maple.on_.windows-300x188.png 300w, https://blag.nullteilerfrei.de/wp-content/uploads/2015/09/maple.on_.windows-1024x640.png 1024w, https://blag.nullteilerfrei.de/wp-content/uploads/2015/09/maple.on_.windows.png 1920w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-3473" class="wp-caption-text">Maple on Windows</figcaption></figure> The `-Y` switch is the one that does all the magic, obviously.


Today, <a href="https://www.youtube.com/watch?v=2z-hrtTcMR8" target="_blank">this video tutorial</a> led me to the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=20028" target="_blank">application verifier</a>, which is pure awesome, <a href="http://gusclass.com/blog/2011/10/31/application-verifier-save-your-memory-debug-your-apps-also-hax/" target="_blank">as explained here in part</a>. I had never heard of this thing before, and I am having the time of my life with it. If you like Windows hax, check this out.


Scenario. You have a Windows 7 key and want to farm a Windows 10 key from it, using the automatic upgrade. Of course, you want to do this in a <a href="https://www.virtualbox.org" target="_blank">VirtualBox</a> ((Side note. If you have a <a href="/2012/03/23/windows-customization/">customized Windows</a>, you possibly need to install <a href="https://www.virtualbox.org/wiki/Download_Old_Builds_4_3_pre24">Virtual Box 4.3.12</a> because anything after that will throw <a href="https://www.virtualbox.org/ticket/13504?cversion=1&cnum_hist=1" target="_blank">an error</a>.)). The first thing you do is, set up a VM with at least 30GB of harddrive. Let's assume that this VM is called <b>Nekarat</b>. This is an outdated pop culture reference, <a href="https://www.google.com/search?q=Nekarat" target="_blank">google it</a>. In the host system (not the VM), go to your happy place (i.e. <b>cmd.exe</b>) and do this: ```bash cd c:\Program Files\Oracle\VirtualBox VBoxManage.exe setextradata Nekarat VBoxInternal/CPUM/CMPXCHG16B 1 ``` It will not seem like anything has happened, but trust me, it did. It enables a certain CPU instruction for the virtual machine without whome <a href="http://www.dirkstrauss.com/how-to/virtualbox-compareexchange128-error" target="_blank">the Windows 10 update fails</a>. Boot the VM. Install Windows and update it completely. Do <b>not</b> install the VirtualBox Guest additions: The display driver is incompatible with the Windows 10 update. Now might be a good time to make a snapshot if you want to upgrade more than one key. Activate Windows. Then, in the VM, add this to the registry, <a href="http://www.filecritic.com/how-to-fix-the-something-happened-0x80070002-0x20016-error-and-upgrade-to-windows-10/" target="_blank">courtesy of filecritic.com</a>: ```text Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade] "AllowOSUpgrade"=dword:00000001 ``` Check for updates, it should now download Windows 10. <a href="https://blag.nullteilerfrei.de/2015/08/13/how-to-farm-the-win10-key-from-a-win7-upgrade-in-virtualbox/#more-3446" class="more-link">Wanna know how to extract the key?</a>


Virtual Desktops rock and you should read <a href="https://blogs.windows.com/bloggingwindows/2014/10/03/keyboard-shortcuts-in-the-windows-10-technical-preview/" target="_blank">this list of new shortcuts</a> before complaining that there are none, like I did. Important ones: * <b>WIN + TAB</b>, new task view opens up and stays open. * <b>WIN + CTRL + D</b>, create new virtual desktop. * <b>WIN + CTRL + F4</b>, close current virtual desktop. * <b>WIN + CTRL + LEFT/RIGHT</b>, switch virtual desktop. Unfortunately, the new start menu doesn't really rock. I suggest you have a look at my suggestion about the <a href="https://windows.uservoice.com/forums/265757-windows-feature-suggestions/suggestions/9252939-search-everywhere-interface" target="_blank">Search Everywhere Interface</a> and maybe vote on it.


When students write exams, they want to know their score as fast as possible. However, the system that is supposed to deliver this information to the students is usually slow, for a lot of reasons that I will not go into. Where I work, it has become quite usual to publish a pdf on the course website that lists the student ID together with the number of points they scored. Since student IDs are usually anonymous, most people don't see it as a problem. However, the more this practice is used, the less anonymous a student ID actually is: Once there are enough of these lists public, this data might theoretically be used to connect a student to his or her student ID only by knowing which courses he or she attended. I propose a much better solution. I did not come up with this myself by the way, this is due to a brillian colleague of mine, but I still wanted to share it with the world. <a href="https://blag.nullteilerfrei.de/2015/07/24/the-exam-polynomial/#more-3398" class="more-link"><span aria-label="Continue reading The Exam Polynomial">(more&hellip;)</span></a>


I recently broke the display of my smartphone and wanted to sell it on eBay. However, I am paranoid about my data. So this is what I did: * Get a new phone and set it up. * Encrypt the Phone with Android's builtin encryption feature: * Set a lock screen <i>password</i> (not a PIN) with a random 16 letter string (at the time of writing, Android won't let you choose longer passwords). * Go to <b>security</b> in your settings and find the option to encrypt the phone, confirming your password. * After this is done, <a href="/2015/07/05/where-to-get-adb-and-fastboot/">open an ADB shell on your phone</a>. Because the phone's internal memory is flash, there might still be areas that contain sensible and unencrypted information. We will overwrite them with random data. ```bash cat /dev/random > /data/junkfile ``` * If you have a stock Android installed, perform a factory reset. If you do not have a stock Android installed: * Go to the <a href="https://developers.google.com/android/nexus/images" target="_blank">Google Developers' Factory Images for Nexus Devices</a> page and grab your image. * Extract that file and find a batch file that will flash this stock distribution on your phone automatically. <b>Warning.</b> You might <b>really</b> have to try several different USB cables and several different USB ports on your computer before fastboot succeeds. For me it worked on the 3rd port and the 2nd cable, that's 7 failed attempts. * Take pictures of your old phone with your new phone and make sure to remove all the metadata from those pictures: ```bash for img in $(ls *.jpg); do mogrify -strip $img; done ``` * Now you're good to go, put that old heap of junk up for sale! If you have any comments, go ahead.


So you want to have some more control over your android phone? Sure you do. For any, just slightly above userlevel stuff you might want to do with it, you require the tools <b>ADB</b> (the <b>A</b>ndroid <b>D</b>eveloper <b>B</b>ridge) and Fastboot (<b>Fast</b> <b>boot</b>). Since I am still quite ignorant to all of this, I decided to write a small reminder blagpost for myself on how to get those tools. Oh yea, this is all on Windows. Linux users have package managers and stuff like this just works. You will need the <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank">Java Development Kit</a>. After you got that, you need to get the <a href="https://developer.android.com/sdk/index.html#Other" target="_blank">Android SDK Tools</a>. Download <b>"SDK Tools Only"</b>. Once you have installed it, open the <b>SDK Manager</b>. It will want to install a lot of stuff, but unless you actually want to do development, you might not even have to install anything. I installed the following only: * Android SDK Tools * Android SDK Platform-tools * Google USB Drivers Assuming that `%GSDK%` is the path where you installed the SDK tools, you will find the applications `adb.exe` and `fastboot.exe` in ```text %GSDK%\Android\android-sdk\platform-tools ``` You might want to add that to your path, or not. Fun fact. If you use <a href="https://www.cygwin.com/" target="_blank">cygwin</a>, you can call `adb shell` from a cygwin terminal and then invoke `bash` on the phone, and the cygwin terminal will interpret all the color codes sent back from the phone's bash correctly, so you can have a really comfortable shell open on your phone: <figure id="attachment_3364" aria-describedby="caption-attachment-3364" style="width: 300px" class="wp-caption aligncenter"><a href="http://blag.nullteilerfrei.de/wp-content/uploads/2015/07/shell-on-nexus.png"><img decoding="async" src="http://blag.nullteilerfrei.de/wp-content/uploads/2015/07/shell-on-nexus-300x161.png" alt="Shell from Cygwin on LG G3" width="300" height="161" class="size-medium wp-image-3364" srcset="https://blag.nullteilerfrei.de/wp-content/uploads/2015/07/shell-on-nexus-300x161.png 300w, https://blag.nullteilerfrei.de/wp-content/uploads/2015/07/shell-on-nexus.png 1007w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-3364" class="wp-caption-text">MinTTY on LG G3 sporting <a href="http://www.cyanogenmod.org/" target="_blank">CM12</a></figcaption></figure>


TrueCrypt <a href="http://www.truecrypt.org/" target="_blank">is pretty dead</a>. We need some options here, and as far as I can see, there are only <strike>two</strike> three: * <a href="https://ciphershed.org/" target="_blank">CipherShed</a>. Currently a vanilla fork of TrueCrypt. * <a href="https://veracrypt.codeplex.com/" target="_blank">VeraCrypt</a>. A fork of TrueCrypt with some fixes and improvements. * Keep using <a href="https://truecrypt.ch/" target="_blank">TrueCrypt</a>. Neither of the two alternatives has had an official source code audit or anything. They are both open source. I will give a quick summary of the facts on both forks, concluding that I have no clue and will probably <strike>flip a coin</strike> roll a D3. Whether these facts are pro or con is up to your discretion. <div style="width:56%;float:left"> <h3>CipherShed Facts</h3> <ul> <li> They are on <a href="https://github.com/CipherShed/CipherShed/" target="_blank">github</a>. <li> They seem <i>dedicated</i>. Meaning, the information on their homepage sounds like they thought this through. <li> Not much has happened yet, they only forked TrueCrypt. <li> There is only a <a href="https://ciphershed.org/pre-alpha-testing-started/" target="_blank">pre-alpha version available</a>, which I won't touch. <li> They do not have any licensing information at all. <li> Longterm Plans are a bit fuzzy, according to <a href="https://wiki.ciphershed.org/" target="_blank">their wiki</a> they want to <ul> <li> Secure the code through audits, simplification, and a secure architecture. <li> Migrate towards a OSI-approved licensed codebase <li> Work closely with existing efforts such as <a href="https://opencryptoaudit.org/">OpenCryptoAuditProject</a>, <a href="https://code.google.com/p/cryptsetup/">LUKS</a>, <a href="https://en.wikipedia.org/wiki/Geli_(software)">GELI</a>, and <a href="https://github.com/bwalex/tc-play">tc-play</a>. </ul></ul></div> <div style="width:40%;float:left"> <h3>VeraCrypt Facts</h3> <ul> <li> According to the author in <a href="https://forum.truecrypt.ch/t/why-not-veracrypt/133" target="_blank">this thread</a>, VeraCrypt was first published on June 22nd 2013, so it has already aged a bit. <li> In fixing some of the security flaws in TC, they break backwards-compatibility. There is a conversion tool available. <li> They are on <a href="https://www.codeplex.com/" target="_blank">CodePlex</a> and the software is under Microsoft Public License. <li> Binaries are available for download, cross-platform. <li> Most relevant <a href="https://veracrypt.codeplex.com/wikipage?title=Future%20Development" target="_blank">longterm plan</a> is the ability to encrypt Windows system partitions/drives on UEFI-based computers (GPT). </ul></div> <p style="clear:both">So. If you have additional information, let me know in comments or by eMail. I am rattled beyond my usual level of confusion as to what I should do. Currently, I will probably give the VeraCrypt binaries a test ride on some machine.</p>


I was promised (and am paying for) a certain bandwidth $X$. But sites like http://www.speedtest.net/ indicated a bandwidth $Y$ (much smaller than $X$). To gather more empirical data over time and to make sure, that I am not hallucinating, I installed a Zabbix server on a Raspberry Pi ((https://www.zabbix.org/wiki/Zabbix_on_the_Raspberry_Pi_%28OS_Raspbian%29)) and set up a monitoring for my Fritz!Box ((http://znil.net/index.php?title=FritzBox_mit_Zabbix_%C3%BCberwachen_HowTo_mit_Template)). The data for the item "Fritz!Box DSL-Downstream" clearly indicated that $Y$ was around 6 Mbps. So I called my ISP and they ultimately sent the tech-guy to the rescue: He was at my home around <strong>8:30</strong> in the morning and measured the bandwidth with a small magical device. First at the basement where the cable enters the house and then at my office on the first floor. To my surprise, <em>both</em> measurements indicated a much bigger number $Y'$ (which was bigger than $Y$ and looks much more like $X$). He also left me under the impression, that everything was fine with my internet connection the whole time, which I might have believed. <em>But:</em> <a href="http://blag.nullteilerfrei.de/wp-content/uploads/2015/03/netcologne-zabbix-bandwidth.jpg"><img decoding="async" src="http://blag.nullteilerfrei.de/wp-content/uploads/2015/03/netcologne-zabbix-bandwidth-1024x210.jpg" alt="netcologne-zabbix-bandwidth" width="1024" height="210" class="aligncenter size-large wp-image-3271" srcset="https://blag.nullteilerfrei.de/wp-content/uploads/2015/03/netcologne-zabbix-bandwidth-1024x210.jpg 1024w, https://blag.nullteilerfrei.de/wp-content/uploads/2015/03/netcologne-zabbix-bandwidth-300x61.jpg 300w, https://blag.nullteilerfrei.de/wp-content/uploads/2015/03/netcologne-zabbix-bandwidth.jpg 1520w" sizes="(max-width: 1024px) 100vw, 1024px" /></a> Note the time, when <em>something</em> changed! I rest my case. He doesn't have magic hands. He cheated!


Sitting on the ICE to Munich, I'm using my Nexus 5 to open a WiFi Hotspot for my laptop. However, I'd like to use USB tethering instead; my mobile is plugged in to charge anyway, and it would also allow me to buy Telekom WiFi for my phone for a day and use it for my laptop, too. Sadly, it didn't work so easily, and I had to write a small patch for my kernel. <a href="https://blag.nullteilerfrei.de/2015/01/31/usb-tethering-with-a-nexus-5-on-linux/#more-3217" class="more-link"><span aria-label="Continue reading USB tethering with a Nexus 5 on Linux">(more&hellip;)</span></a>


My good friend and colleague Christian Ikenmeyer and I <a href="http://arxiv.org/abs/1410.8202" target="_blank">wrote this cute preprint</a> about polynomials and how they can be written as the determinant of a matrix with entries equal to zero, one and indeterminantes. Go ahead and read it if you know even just a little math, it's quite straightforward. The algorithm described in section 3 has been implemented and you can download the code <a href="http://page.math.tu-berlin.de/~jesko/code/ptest.zip" target="_blank">from my website at the TU Berlin</a>. Compilation instructions are in `ptest.c`, but you will need to get <a href="http://cs.anu.edu.au/~bdm/nauty/" target="_blank">nauty</a> to perform the entire computerized proof.


I recently <a href="/2014/08/25/switching-end-and-insert-key-on-the-lenovo-yoga/">lamented about switching two keys on my new Lenovo Yoga</a>. Big problem: In my office, I attach that notebook to a docking station and to that docking station I attach a <a href="http://www.daskeyboard.com/" target="_blank">keyboard</a>. On that keyboard, all keys are precisely the way I want them to be. Therefore, I do <i>not</i> want to switch the <b>Insert</b> and <b>End</b> keys when I am docked. I ended up writing a little batch script based on <a href="https://code.google.com/p/killkeys/wiki/ScancodeMap" target="_blank">this nice google code wiki entry</a> for the registry update and <a href="http://stackoverflow.com/a/24665214/1578458" target="_blank">this stackexchange answer to elevate the batch script</a>: ```bash @ECHO OFF NET FILE 1>NUL 2>NUL if '%ERRORLEVEL%' == '0' goto run powershell "saps -filepath %0 -verb runas" >nul 2>&1 goto eof :run REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" ^ /v "Scancode Map" >nul 2>&1 IF '%ERRORLEVEL%' == '0' goto remove <nul set /p ="> adding scancode map " REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" ^ /v "Scancode Map" /t REG_BINARY /f ^ /d 00000000000000000300000052E04FE04FE052E000000000 >nul 2>&1 IF '%ERRORLEVEL%' == '0' goto success goto fail :remove <nul set /p ="> removing scancode map " REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" ^ /v "Scancode Map" /f >nul 2>&1 IF '%ERRORLEVEL%' == '0' goto success goto fail :fail echo failed. pause goto eof :success echo succeeded. pause ``` Sadly, it always requires a reboot for the changes to take effect.


I recently implemented an algorithm that has to perform checks on all subsets of some large set. A subset of an $n$-sized set can be understood as a binary string of length $n$ where bit $i$ is set if and only if the $i$-th element is in the subset. During my search for code to enumerate such bitstrings, I found <a href="http://graphics.stanford.edu/~seander/bithacks.html" target="_blank">the greatest page in the entire internet</a>. If anyone can explain to me how <a href="http://graphics.stanford.edu/~seander/bithacks.html#NextBitPermutation" target="_blank">computing the next bit permutation</a> (the last version) works, please do.