Linux – Cedric's Cruft http://www.ce3c.be Yet another blog about ... stuff. Fri, 04 Jul 2014 23:13:03 +0000 en-US hourly 1 https://wordpress.org/?v=5.1.12 Colored vhosts in UnrealIRCd http://www.ce3c.be/199-colored-vhosts-in-unrealircd/ http://www.ce3c.be/199-colored-vhosts-in-unrealircd/#comments Mon, 07 Mar 2011 10:24:32 +0000 http://www.ce3c.be/?p=199 If you don't care that it is violating the RFC (like me),
you can easily modify the unreal source-code so it will take colored vhosts.

In src/s_misc.c, find the valid_host function, and change:

if (!isalnum(*p) && (*p != '_') && (*p != '-') && (*p != '.') && (*p != ':'))

to:

if (!isalnum(*p) && (*p != '_') && (*p != '-') && (*p != '.') && (*p != ':') && (*p != '\x03') && (*p != '\x0f'))

Recompile.
Now the /chghost function will not complain when changing someone's virtual host to something colorful 🙂
This also supports the 'off' character (CTRL+O in mIRC). I encourage you to always use this at the end of your colored vhost to prevent bleeding.

This will only allow foreground colors.
If you want background colors, you will have to add (*p != ',').
If you want bolds, you will have to add (*p != '\x02').

]]>
http://www.ce3c.be/199-colored-vhosts-in-unrealircd/feed/ 1
Running Windows 7 natively and in a virtual machine (VirtualBox) http://www.ce3c.be/164-running-windows-7-natively-and-in-a-virtual-machine-virtualbox/ http://www.ce3c.be/164-running-windows-7-natively-and-in-a-virtual-machine-virtualbox/#comments Sat, 19 Jun 2010 15:47:42 +0000 http://www.ce3c.be/?p=164 Frankly I got tired of switching back and forth between Windows and Linux.

You need to have VirtualBox to get this working:

My current setup:
Host OS: Linux Mint 9 Isadora x64
VM OS: Windows 7 x64
Using Oracle VM VirtualBox 3.2.4 (hey! Sun has been taken over!)

! You need to have installed both your OS'es in dualboot already.
! You best know what you're doing, and know that what you're doing may have fatal consequences which I will not be held responsible for 😛
! This is hardly a tutorial. These are roughly the steps I followed when setting up the box. Getting the required packages etc is your responsibility.
! You will need your Windows 7 CD (altho ISO will do fine too).

First, add yourself to the "disk" and "vboxusers" group. This will allow you to access the other partitions without needing root permissions.
This may be considered dangerous for some reason 🙂 Also logout and back in after doing this. In the examples, I'm the user "cedric".

$ sudo usermod -a -G disk,vboxusers cedric

Now backup your MBR (Master Boot Record):

$ sudo dd if=/dev/sda of=bootrec.mbr bs=512 count=1

Now find out which partitions you have installed Windows on.
Usually you will see a 100MB sized boot partition and your NTFS partition with Windows 7 on. You need both for the next step!

$ fdisk -l
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
/dev/sda2 13 22557 181082112 7 HPFS/NTFS
/dev/sda3 22557 60802 307200001 5 Extended
/dev/sda5 22557 59334 295409664 83 Linux
/dev/sda6 59334 59595 2099589+ 82 Linux swap / Solaris
/dev/sda7 59596 60801 9687163+ b W95 FAT32

We'll now create a Virtual Machine Disk (VMDK) of the partitions we want to use in the VM.
Sometimes you may also want to add extra partitions to have them shared between Linux & the VM.
In my case, the required partitions are sda1 and sda2. I also choose to add sda7.
Note: It's useless to add linux partitions to the VMDK. Windows can not read them anyway, and you don't want to raise the chance of fucking up Linux as well 🙂


$ sudo VBoxManage internalcommands createrawvmdk -filename win7.vmdk -rawdisk /dev/sda -partitions 1,2,7 -relative -mbr bootrec.mbr

Now go in VirtualBox and add a new VM for Windows 7 x64. Load win7.vmdk which you created earlier.
In my case I got to deal with permissions problems. Make sure you are the owner of win7.vmdk files and bootrec.mbr.

$ sudo chown cedric:cedric win7* bootrec.mbr
$ sudo chmod 777 win7* bootrec.mbr

If that still doesn't solve the issue, you may have not logged out and logged in again after the first step.
Otherwise, do for all partitions you need:

$ sudo chmod 666 /dev/sda[127]

You may have to repeat this on every boot of the VM.

Now go in the settings for the VM. In the System tab, enable I/O APIC.
When you have done that, it's time to boot up your VM. Startup will most likely fail.
Mount the Windows 7 CD and let it launch startup repair. "Repair installation", not "Install now" 😛
The VM may restart and hopefully you will be able to get to your login screen.

Well done!
My congratulations also come directly with a warning. Do not attempt to install the VirtualBox tools. In v3.2.4 they make integration work perfectly in the VM, but when running natively, your mouse and keyboard will go loco.
There are also drivers available to get your audio working (make sure to select AC97 as your audio driver in the VBox settings), get them here and install them on your VM.

Troubleshooting:

If you can't use the first option after "Repair installation" (screeny), then click the second one "Restore your computer using a system image you've created earlier". An alert will popup, but cancel/ignore/kill it.
Cancel this dialog too, and you will get to a screen that will give you a couple of options (screeny).
Open the command prompt and type
$ bootrec.exe /fixmbr
Hopefully that fixed a couple of things. Reboot.

Kudos:

http://forums.virtualbox.org/viewtopic.php?f=2&t=31759
http://www.rajatarya.com/website/taming-windows-virtualbox-vm

]]>
http://www.ce3c.be/164-running-windows-7-natively-and-in-a-virtual-machine-virtualbox/feed/ 2