Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Monday, May 19, 2014

Make Windows use a realtime clock

First off: Markus Kuhn's classic rant about windows storing the time in local time instead of UTC and why it's dangerous and downright moronic.

Solution:
Create a DWord called RealTimeIsUniversal under
HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
and set it to 1.
Beware that there are issues which Markus Kuhn details and that you should be aware of.
  

Friday, January 24, 2014

make Windows IME sane

Ok I have peculiar tastes, I want a US altgr intl no-dead-keys layout with Escape instead of Capslock. Windows already ships a US intl but it has dead keys which is really not only annoying but kills productivity, but some person, that just gained a lot of karma with me, has made one. You can find it here . For the Capslock remap install sharpkeys . Additionally I use autohotkeys for the xmodmap fix and I'm almost happy.

Saturday, November 16, 2013

X paste buffer analogue in Windows

There is a very great app over at http://12bytes.org/software/autoclipx that actually makes X style select paste possible. The most annoying thing is, that it only works in focused input windows. I have also played with http://fy.chalmers.se/~appro/nt/TXMouse/ which is actually even better but this unfortunately has the same problems as the non delaying focus switch. If it weren't for the wireless lan I'd even be willing to accept that.

Thursday, November 7, 2013

Focus follows mouse under Windows

Back to Windows, many more tweaks coming I fear. Let's start with Focus follows mouse. There is an accessibility setting in the control panel but it also raises the window. If you don't want this, use regedit, navigate to HKEY_CURRENT_USER\Control Panel\Desktop and add 0x1 to the key UserPreferencesMask (0x41 would be FFM with raising). Documentation can be found at technet. In order to be able to use this (yes it's unusable that way), add another dword-key called ActiveWndTrkTimeout that has the timeout in miliseconds. There are a lot of guides that call it ActiveWndTrackTimeout or ActiveWindowTrackTimeout, both of which don't do anything!

Saturday, December 8, 2012

How Windows development works

Or doesn't at times.
Former Windows Developer
I hope this is somewhat overstated (I am not going to push the disgruntled employee cliche), although I am inclined to believe it simply on the grounds of how the development in large projects works.
Quite sad.

Sunday, September 16, 2012

mswin.vim and ctrl-v

I started using vim under windows and the remapping of some keys, most importantly ctrl-v doing pasting instead of vertical selection had me going up the wall.

If you, like me, think the default is moronic, do
:e $MYVIMRC
and comment out the line that reads
source $VIMRUNTIME/mswin.vim

Tuesday, September 11, 2012

Always on Top

Always on Top was always something i missed under windows. There are a couple of dedicated tools for this, some of which sport a weird interface. Turns out you can get the same result with autohotkey (beginning to love this tool, even though the configuration is a little clumsy).
Anyway the snippet to make it work with ctrl-alt-t is
^!t::
WinGet, currentWindow, ID, A
WinSet, AlwaysOnTop, Toggle, ahk_id %currentWindow%

Sunday, September 9, 2012

Diagnosing BSODs

I had to investigate a series of Bluescreens and tried a lot of the usual stuff, i would do with common sense and my unixy background. In the end the best tool i found was the NirSoft Bluescreen Analyzer. It helped me understand the frequency of my problem and gave me rudimentary stack traces. So it seems my Page Fault in Non Paged Area BSOD was caused by some interaction of my AVG Virus scanner and the ntfs driver. Good riddance piece of crap.

Saturday, September 8, 2012

En-/Disabling the Windows+L-Locking shortcut

Upon pressing Windows + L Windows will lock your session. I for one am trained to switch terminal emulator tabs with that key combination and am greatly hindered by this.
So i created
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableLockWorkstation
as a DWord (i had to create the System key as well) and set it to 1 for Disabling (0 would be for Enabling it again). Works instantly.

Changing the Windows keyboard layout *permanently*

I involuntarily spend a lot of time in windows at the moment and one of the things that drives me nuts, is the inability to use different keyboard layouts permanently, globally without uninstalling the alternatives. Having to change it for every window, and redoing it after closing one just doesn't cut it. So i now use autohotkey  as an xmodmap and xbindkeys replacement and combine it with kbswitch. In order to get us altgr-intl (the parts that interest me) and make capslock another escape i switch the language to english and use the following autohotkey script:
CapsLock::Escape
>!y::SendInput ü
>!p::SendInput ö
>!q::SendInput ä
>!s::SendInput ß
+>!y::SendInput Ü
+>!p::SendInput Ö
+>!q::SendInput Ä

This appears to satisify my most basic needs for now. Now if there was something that would make this insanity of a vfs less messy i'd be almost content.

Why something hailing itself an international, multiuser OS doesn't have that is beyond me. I would love to force the responsible people to use amharric, japanese and russian in random succession and see if they volunteer to implement it afterwards.

<edit>I forgot to mention, that you should realy turn off the global hotkeys for switching the ime, or you'll likely hit alt shift sometimes and be confused why your layout changes by itself.</edit>

Friday, January 6, 2012

Saving a Windows partition with dd and getting it to work again.

Situation: I had a failing hdd recently and thus tried to create a backup. There were four partitions, mostly sparse and an already existing secondary partition on the new drive that couldn't be resized. So I didn't have enough space to backup the disk as a whole, and I didn't have enough partitions to copy them one by one and resize them all (gparted). Long story short i ended up doing a
dd if=/dev/sda2 of=/dev/sdb2
mount /dev/sdb2 /mnt
dd if=/dev/sda3 of=/mnt/sda3
dd if=/dev/sda1 of=/mnt/sda1
For two partitions, most importantly the system partition. Now i had a really hard time getting it to boot. Fix: After lots (and lots) of trial and error this is what got me to the finish line:
  • I installed a Windows Vista
  • mounted this installation in gparted (/media/sdb1), rm -rf everything except files that looked boot related, most importantly /BOOT  (WINDOWS/Boot doesn't seem to be relevant)
  • mv  /media/sdb1/BOOT /media/sdb1/BOOT.bak
  • mount -o loop /mnt/sda1 /media/sda1 and cp -r /media/sda1/* /media/sdb1/
  • rm -rf /media/sdb1/BOOT/; mv /media/sdb1/BOOT.bak /media/sdb1/BOOT 
  • reboot into the Windows Vista installation cd and used the fix boot option
  • Boot into Windows again and fix drive letters (before you start up the SQLServer!)
  • Voila
Overall i was reminded of what a pain Windows can be. If the Fix boot doesn't help try this thread.
If you have the luxury of enough space just do a dd if=/dev/sda /dev/sdb!

What doesn't work:
  • dd of the disk image to the disk (blank cursor)
  • dd of the disk image to a new partition (blank cursor on boot)
  • Creating a partition and installing into it (wrong disk offset => blank cursor)
  • Installing Vista and overwriting the partition with a dd (blank cursor)
  • Deleting the partition, installing Vista and copying everything into it (Missing winload.exe)
  • Installing Vista and copying everything safe for WINDOWS/BOOT (MIssing winload.exe)
It's save to assume I tried a couple  more combinations and that every one of them took 4h's -> annoying holiday. Fuck you Windows!