Archive for the 'Tutorials/How-To' Category

Access administrative shares on Server 2008/Vista

Tuesday, August 19th, 2008

Quick windows tip again, if you find yourself unable to access the administrative shares (\\machine\c$, tasks, etc) on a Windows Server 2008 or Vista computer with UAC enabled, using the credentials of a local administrator — don’t panic. This is actually intended.

Turns out local administrators cannot elevate their privileges over the network, with UAC enabled.

Note that this doesn’t affect users in the Domain Admins group!

Now, you could do the dumb “neowin poweruser” thing and turn UAC off, or you could change this particular behavior in the registry. Navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

And add a new DWORD named LocalAccountTokenFilterPolicy with a value of 1, and then reboot. It all should work.

Again, users with Domain Admin privileges are unaffected.

Xapian Python Bindings (Win32) 1.0.6 Released

Tuesday, March 25th, 2008

I have compiled version 1.0.6 of Xapian for Windows, and I have built and packaged the Python Bindings for your convenience.

You can find the new version here.

Questions, comments or Mirrors are welcome, as usual :)

UPDATE: Charlie Hull informs me that he has coerced my hacked-up Distutils file into SVN Head, which means there’s a good chance my packaging environnement will be integrated into mainline Xapian, or into the Lemur Consulting makefiles. Either way, this means one can build binaries a lot faster, which is great. :)

Mounting LVM Volumes inside a VMWare Disk Image

Friday, September 7th, 2007

So, the situation is this. I’m sitting remotely at a client site, and suddendly, due to some sleep-deprived slip-up, ended up erasing part of the configuration for their local server.

Being the kind of guy to plan things through before taking action (usually), I had previously made a test set-up with all the configs in vmware on my local workstation at home, before heading over and installing them. So I pop open my laptop, fire up the Cisco VPN Client, connect over there, leapfrog some routers in between and land on my workstation. Turns out I hadn’t left the vm running, so I can’t access it from the shell by SSH’ing in.

“Hey, no problem!” I thought. “I’ll just mount the disk images with vmware-mount.pl, fetch the configuration files, send them over with a convulted mess of ssh-within-ssh-within-ssh and unix pipes to my laptop! Piece of cake!”

But then something hits me. The Virtual Disk Image (vmdk) file had LVM Volumes as partitions. Which I can’t directly mount from my Ubuntu workstation. Usually, you can get away with issuing the following:

$ sudo /opt/vmware/bin/vmware-mount.pl /path/to/disk-image.vmdk patition_number -t ext3 /mnt/mountpoint

But to much of my dismay, partition 2 on this particular disk image is an LVM Volume, so it can’t be directly mounted. I has to be mapped and a bunch things has to be done before I can get to the data. I’m not even sure I have LVM support on the Ubuntu machine at the moment.

Curses. Unless I fuck around with it to make it work. Which I did. Read on for the details.

Read the rest of this entry »

Courier imap and vpopmail on Debian

Sunday, May 20th, 2007

Hi everyone. Sorry for the lack of updates, I’ve been fairly busy — I’m migrating all of my servers to a single, brand new Dell Poweredge 2900 server. I have a couple of great tutorials regarding Xen coming up soon, I’m sure at least someone will find them useful — I found the Xen documentation to be really scarce.

So, right now, I’m migrating my qmail, vpopmail, courier, clamav and friends set-up from Gentoo to Debian, on a new virtual machine. I followed the basic steps from here:

http://wiki.debian.iuculano.it/quick_howto

This gent was nice enough to provide the required qmail packages and patches. Only problem came when I tried to make courier work with vpopmail — turns out the official debian courier-imap packages don’t support vchkpw, which is the authentication mechanism for vpopmail. Fortunately, I managed to hack it in an almost clean way, that doesn’t involve building it yourself from tarball.

Read on for the jazz.

Read the rest of this entry »

Windows Tip: Remote Console with remote.exe

Wednesday, November 29th, 2006

EDIT – 2008-03-03: Actually, screw this shady use of the remote debugger. Use psexec like a man instead, and enjoy the power of WMI.

This is nifty. Not something to scream about while tearing your clothes off in a moment of raw ardency, but still, I find it relatively useful.

You perhaps already know how Windows Debugging Tools such as WinDbg can output to a serial or network console, but I found out this concept can be extended to basically any console application that doesn’t really mess around with the terminal. See it as a mix between netcat and screen.

You just need “remote.exe” that comes with the Windows Debugging Tools. I personally use it to launch Macromedia JRun4 in a console on a development server at one of my client sites to debug their web application remotely. That way I can see the log in my local console instead of toggling between the server and Terminal Services. Read on for an overview of how it works. Read the rest of this entry »

Quick Windows Tip: Active Directory MMC as Admin

Friday, November 24th, 2006

That title is way longer than it should be. Anyways, I just like to administer Active Directory Users and Computers from my workstation, on which I am logged on as a plain user.

To run the Active Directory Users and Computers with Administrator rights, you can use some runas.exe magic. Just create a shortcut to the following target:

C:\WINDOWS\system32\runas.exe /USER:DOMAIN\adminuser "mmc dsa.msc"

Of course, just change DOMAIN\adminuser to whatever applies.

It works fine for my purposes. The trick is just knowing the name of that particular mmc snap-in. That’s pretty basic knowledge, but I’ve been asked three times this week about it.

Bypass WGA for downloads (From Mac and Linux too!)

Wednesday, September 6th, 2006

Some clever folks over at ghacks.net found a neat way to download to your heart’s content from microsoft while bypassing the silly WGA (Windows Genuine Advantage) check.

Simply put, all you need is the mgadiag.exe tool and the URL you wish to download from.

I tested it and it does work. It goes something like this:

  • Run mgadiag.exe
  • Look for the Download Center Code, and write it down (ex: 8KLVDJ6)
  • Go to the URL you want to download from
  • append &Hash=8KLVDJ6 to the URL (replace the value with your own)
  • Enjoy your download.

The important part is that it works in Wine. And in the recently released CrossOver Office for Mac OS. See screenshot below.

WGA on OS X

Sharing, Syncing and editing iCal over WebDAV

Wednesday, August 16th, 2006

iCal. Such a nice calendering application that is, and a pioneer in the vastly used ics calendar format. Is it the ultimate calendar ever? Well, almost.

What drove me insane was that, while you can publish your calendars to a WebDAV server for others to see and subscribe to, you cannot edit the calendars that are published — unless you have a .mac account. While I sincerly hope this will be in Leopard, I’m not holding my breath.

You see, I run Linux on my desktop at home, and Mac OS X on my laptop, for work. I just wanted to find a simple way to share my calendar between the two machines, and to be able to edit them on any machine.

And it just so happens I just have the solution. Read the rest of this entry »

Apache hangs on Digest Secret generation

Friday, August 11th, 2006

I have a machine on my network that is very special. It’s a rather old Quad Xeon, an HP LH4 that I scavenged out of the proverbial dumpster of a buisness that didn’t want it anymore. In fact, they were about to trash six of them.

I decided it was a crime to shitcan such beautiful machines, so with the help of my friend Mike “I mangle french words” Le Blanc, we drove there, armed with a large truck and patience. Carrying them down the three stories with no elevator was an interesting experience. I scavenged lots and lots of interesting hardware there.

But i’m getting ahead of myself here. The point is, lots of screwy things start occuring when you have a Quad SMP machine, such a timers and clock drift. I started having a lot of problems with Apache recently… once in a blue moon, on restart, it would spawn a single process with no PID file, and hang there. Checking out error_log pointed out that apache would apparently hang while generating the Secret seed for Digest authentication (mod_digest). Disabling mod_digest would have worked, but sadly, I use it. This could be found in error_log:


[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[notice] Apache configured -- resuming normal operations
[notice] caught SIGTERM, shutting down
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[notice] Digest: generating secret for digest authentication ...

Fortunately, I cobbled up a fix. Updated! Read on for a more elegant fix. Read the rest of this entry »

Subversion: On fixing “can’t recode string”…

Wednesday, November 16th, 2005

Well, I recently set up a subversion system where I work, on Windows. Clients are using Tortoise SVN, and everything works beautifully. However this morning, I checked out the trunk on my Mac OS X powered Powerbook, and the lawnmower hit a brick the split second svn tried to checkout a folder with accented characters (In french, for instance. Could have been german umlauts).

svn: Can’t recode string

Well, this was a matter of changing the encoding used by my system locale to match the one of the repository, which was done by editing the file .profile in my home directory (I use bash as a default shell, which is the default on OS X 10.3 and above, as opposed to csh) and added the following:


export LC_CTYPE="en_US.UTF-8"
export LANG="en_US.UTF-8"

This basically had the effect of setting up the locale to UTF8, which swallowed the file without problems. I just though I’d post it there because it was useful — I didn’t really google around to check out if that solution was already out there, but I will mirror it on underwares.org anyways.

Hope this helps someone, somehow. :)

Bettering the Windows Command Prompt Part 1

Saturday, September 17th, 2005

Well, the current job I have landed at requires me to work with Windows alot. Perhaps a bit more than I’d like, but still, I get to appreciate some things in windows-land and also despise alot of small things that make my daily life hell.

But apart from that, I stick to my true Unix roots and try to do as much as possible with the command prompt — not out of pride, or some other political reasons, but rather because I like command prompts. They indeed make me all mushy inside and moist down the pants for a very sadistic and wrong reason. I just find that I am more efficient with them.

So, I stumbled across a few things that made my daily journey into text input land alot more pleasant, and I will share them with you. Read the rest of this entry »