Archive

Archive for the ‘windows’ Category

Changing the font in Windows command prompt

October 13, 2009 Leave a comment

Should be easy but it’s not… like some pretty basic things in windows this one actually requires a registry edit in order to use the fonts that are already installed on your system for your command prompt.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

There you will see a string value (0 => “Lucida Console”) or something similar, to add your own fonts which will show up you have to add a new string value with the name of your required font (00 => “Consolas”). Subsequent fonts can be added at (000 => “someotherfont”) etc. I then had to do some dicking around to get the properties to stick on my command prompt shortcut but eventually I had a nice looking font for my command line hacking. Best of luck to you!

Categories: command prompt, font, windows

RDTSC using GCC

May 26, 2008 1 comment

A lot of the work I do involves making a given piece of code do the same thing it used to do but in less time (some people call it optimisation). The first step in this is to accurately quantify the amount of time taken to perform some piece of work and to that end I have a nifty little piece of code which interogates the processor for the current value of the time stamp counter, this looks something like this.

 inline unsigned __int64 RDTSC(void)
 {
   _asm  _emit 0x0F
   _asm  _emit 0x31
 }

This sends the processor opcode 0F 31 to the processor and returns the result, unfortunately, this doesn’t work so well when you move away from the windows environment due to the use of the non-standard “_emit” statement. Thankfully Chistrian Schueler has a nice way to do this with GCC

inline volatile long long RDTSC() {
   register long long TSC asm("eax");
   asm volatile (".byte 15, 49" : : : "eax", "edx");
   return TSC;
}

VMWare disk mount under ubuntu linux

April 22, 2008 Leave a comment

I’m running ubuntu linux as my main OS with a windows XP VM for all those things I just have to have windows for (like writing plugins for a must have application). The problem I sometimes have with this is that disk accesss can be terrible from inside the VM, like cleaning up 20 odd Gb of data that were cluttering up the disk image – thankfully if you shut down the VM you are able to mount the disk image natively and perform operations on it.

sudo mkdir /mnt/winxp_one
sudo vmware-mount.pl /var/vm/WinXP_One/Windows\ XP\ Professional.vmdk 1 /mnt/winxp_one/

And then suddenly I can navigate my C drive from that mount point and delete that 20Gb of files in 20 seconds instead of 20 minutes like it would have been under windows.

[dev@stoner:/mnt/winxp_one/BDK] ls ../
AUTOEXEC.BAT  CONFIG.SYS              MSDOS.SYS     pagefile.sys   ruby
BDK           Documents and Settings  NTDETECT.COM  PDOXUSRS.NET   System Volume Information
boot.ini      dump.txt                ntldr         Program Files  temp
Config.Msi    IO.SYS                  OT            RECYCLER       WINDOWS
[dev@stoner:/mnt/winxp_one/BDK]

However, I did have to manually kill the process after I had finished in order to release the lock on the vmdk file

[dev@stoner:/mnt] ps -e | grep vm
 6121 ?        00:00:00 vmnet-bridge
 6143 ?        00:00:00 vmnet-netifup
 6144 ?        00:00:00 vmnet-netifup
 6163 ?        00:00:00 vmnet-natd
 6170 ?        00:00:49 vmware-serverd
 6191 ?        00:00:00 vmnet-dhcpd
 6192 ?        00:00:00 vmnet-dhcpd
 8049 pts/2    00:00:00 vmware-mount.pl
 8059 pts/2    00:00:04 vmware-loop
 8060 pts/2    00:00:00 vmware-loop
[dev@stoner:/mnt] sudo kill -9 8049 8059 8060
Categories: linux, mount, ubuntu, VMware, windows

LVM and Windows XP

January 20, 2008 Leave a comment

So I was building a machine for my mother for her medical practice… nothing fancy just a regular sit-out-back headless server that she can have chugging away co-ordinating her office while the prettier looking machines get stuck out front for patients to see. Well while building it I noticed that she didn’t really require 500Gb of hard drive, 320Gb would be fine for her needs and luck just happened to have it that I had a spare 320Gb hanging around and a hankering for a 500Gb drive in my new desktop. A deal was made and my time was given over in return for a hard drive upgrade, I would install ubuntu on the new 500Gb drive, copy data over from the old one and then install windows XP on the 320Gb for her to install her new software packages on.

This all went swimmingly after I realised that the old 320 was formatted with Logical Volume Management (LVM) partitions and that I needed to install the LVM2 tools and then restart my new machine (thanks Fedora).

sudo apt-get install lvm2

So after finally realising that a reboot was required (I guess I’m spoilt by never having to restart normally), I finally managed to get the required data off the HD and onto the new 500. Phew…. problems over right? wrong!! When I built the new system and tried to install windows XP I got a rude shock… the cd-rom didn’t seem to like the boot cd and wouldn’t get any further than

Setup is inspecting your computers hardware... this may take a few minutes

Well I left that thing for hours and no joy it was most definitely hanging and was not about to progress any further, luckily being the technophile that I am I had a spare cd-rom (or 5) lying around and I swapped each and every one of those units in to no effect. Maybe the memory got buggered? memcheck passed! Maybe it’s the cd itself? Got a spare install media from work same edition, still no joy! Hmmm, where to next? Google! Turns out windows XP doesn’t play well LVM and in fact having an LVM partitioned hard drive in there will cause the entire process to summarily seize up!

The solution I ended up going with was to take an Ubuntu 7.10 live CD, start up and then use fdisk to remove all partitions on the disk and then “create a new empty DOS partition table”.

sudo fdisk /dev/sda
d 1 # delete partition 1
d 2 # delete partition 2
o # create a new empty DOS partition table
v # verify the partition table
w #write table to disk and exit

restart with the windows XP cd in the drive and things went perfectly… so kids the moral of the story is that, like gasoline and matches, Windows XP and LVM DO NOT MIX!!!

Categories: fedora, linux, lvm, ubuntu, windows, xp

Installing Windows Vista in 2 minutes

April 13, 2007 Leave a comment
Categories: geek, tech, vista, windows

Cleaning up the desktop

August 10, 2006 Leave a comment

If you are like me and are using firefox you’ll probably have noticed that your desktop has become a bit more cluttered now that all your downloads are being sent there. I’ve recently been cleaning mine up and finding some pretty wallpapers from deviant art to brighten things up a bit. I’ve managed to remove just about everything from there except the bloody recycle bin – thankfully there is help at hand.

Undeletable icons on the desktop are controlled by entries in the registry at :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace
in my case I’m trying to remove the “Recycle Bin” and the “My Bluetooth Places” which can be achieved by deleting the following keys

{645FF040-5081-101B-9F08-00AA002F954E} - Recycle Bin
{6af09ec9-b429-11d4-a1fb-0090960218cb} - Bluetooth Icon

Thanks to Daniel for the info.

Follow

Get every new post delivered to your Inbox.