Computing
Install Windows 7 from USB Pen Drive Using Grub2 and Grub4Dos
by Jiang on Jul.19, 2010, under Computing, Hacks
I wanted to install Windows 7 on my netbook, but I didn’t have access to a Windows environment from which I could run bootsect.exe or install Grub4Dos; so I figured I’d install Grub2 on my USB disk using Ubuntu, have Grub2 chainload Grub4Dos, and finally let Grub4Dos chainload the Windows installer. This worked for me:
- Prepare a fresh NTFS partition on the USB disk /dev/sdX and mount it at /mntX1, then copy all files from the Windows installer disc or image into /mntX1
- Install Grub2:
cd /mntX1; sudo grub-install --no-floppy --root-directory=/mntX1 /dev/sdX; sync - Download the latest Grub4Dos, and unpack grub.exe into /mntX1
- Create /mntX1/boot/grub/grub.cfg:
set timeout=0
set default=0
menuentry “Install Windows” {
linux16 /grub.exe --config-file=”root (hd0,0); chainloader (hd0,0)/bootmgr”
}
I was surprised that such a complicated setup actually worked. Be sure to substitute your own values for /mntX1 and /dev/sdX. In the Grub4Dos config, (hd0,0) refers to the first partition on the boot disk; you’d need to change that if you want to boot the installer from a different partition.
Popularity: 5%
Installing Chameleon Using Linux
by Jiang on Jul.18, 2010, under Computing, Hacks
So you want to experiment with the Chameleon boot manager, but you don’t have a Mac or Windows environment handy? Here’s how you could prepare a Chameleon-bootable USB key (or any other kind of disk, for that matter). Be warned that the following procedure would overwrite the target disk’s MBR, effectively wiping all data on said disk. Make sure that you do not target the wrong disk. Naturally, what you do with this information is your responsibility ![]()
- Install hfsprogs (available in the Ubuntu repositories, if you use Ubuntu).
- Get the Chameleon binary package from <http://chameleon.osx86.hu/> and untar it, then navigate to the i386 directory in your terminal.
- Type `sudo dd if=boot0 of=/dev/sdX`, where /dev/sdX is the target disk; this is the step that cleans up the disk and loads a fresh MBR containing the stage-0 boot code.
- Make a new HFS+ partition (type AF) using fdisk. Let me know if you need help with this.
- Format the partition by doing `sudo mkfs.hfsplus /dev/sdX1`.
- Type `sudo dd if=boot1h of=/dev/sdX1` to install the stage-1 boot code to the bootsector of the new HFS+ partition.
- Now, type `sudo mount /dev/sdX1 /mnt` to mount the partition, where /mnt is your mount point of choice.
- Type `sudo cp boot /mnt/` to copy the final piece of Chameleon over.
- Unmount the partition using `sudo umount /dev/sdX1`.
Now you should have a shiny new Chameleon boot disk. I hope this helps.
Popularity: 5%
Removing Ubuntu One Client in Ubuntu
by Jiang on Jun.27, 2010, under Computing
I installed an early development release of Ubuntu Netbook Edition 10.10 on my new Lenovo IdeaPad S10-3t. While the interface is rather smooth, and more usable than Windows, I found the Ubuntu One feature slow and wasteful. I don’t use Ubuntu One because of its lack of cross-platform compatibility options, and it takes up a nice chunk of screen real-estate in Nautilus just to remind me that “Ubuntu One [is] disabled.” It also tends to slow down the file manager.
To remove it, I simply issued
sudo apt-get autoremove ubuntuone* python-ubuntuone* --purge
… and it stopped bothering me after I logged out and logged back in. Launchpad has a page on this as well.
Popularity: 3%
Kindle Firmware 2.5 With Root
by Jiang on Jun.15, 2010, under Computing, Hacks
The new Kindle firmware seems to be all the rage these days, though the manual installation package for early adopters had been quite elusive until now. While the new features are quite neat, early adopters found themselves unable to apply any of the previously-established hacks. Firmware hacking is popular because it enables extensive customization options. I was impatient to install the new firmware, but I didn’t want to lock down my Kindle or wait for new hacks. What now?
Why, I simply installed the usbNetwork hack before upgrading to 2.5.2. The usbNetwork hack installs a Telnet daemon and a SSH server on the Kindle, while allowing the Kindle to be controlled over USB. It is a simple way to gain a root terminal, and it still works after the new firmware is installed. Hopefully, this paves the way for further hackery.
It should be noted that users who already have the new firmware cannot apply the usbNetwork hack (the process terminates with error code U004). If you’re interested in using it, install it while you still have the 2.3.* firmware.
So how exactly do you get a root console on the Kindle, with the usbNetwork hack? First, you put the Kindle into debug mode (in general, to issue any command, just follow these five steps and change what you type during the fourth step):
- press [Home] to go to the home screen
- type any key on the keyboard to enter search mode
- press [←] to blank the line
- type ;debugOn (the ; character, and many others, is available in the [SYM] menu)
- press [↵] to issue the command
Next, issue the `usbNetwork command on the Kindle, and plug it in. It should appear as a “RNDIS/Ethernet Gadget” rather than the usual mass storage device. By default, the interface should be configured with IP address 192.168.2.1, and the Kindle could be accessed at 192.168.2.2. How you go about setting up the interface depends on the operating system on your desktop. Telnet and SSH should be running at this point, either of which would give you a root shell.
Users have reported the interface dying after a couple of minutes. Through the console, it is possible to disable the daemon that periodically resets network connections as the Kindle goes to sleep:
/etc/init.d/netwatchd stop
Popularity: 10%
Open Source Record Keeping and Practice Management for Physicians
by Jiang on Jun.04, 2010, under Computing, Healthcare
Healthcare professionals have traditionally kept records in paper charts. As a clinic expanded, so did its patient base, and record-keeping rapidly became a bottleneck hindering further development. Hospitals had entire rooms and stacks dedicated to archiving old records. Clearly, the healthcare system needs to take advantage of electronic mechanisms that have already been demonstrated to be useful in other fields. A number of companies provide electronic health record and practice management functionality to help doctors switch to computer systems, and the United States government even offers incentives for meaningful use of such mechanisms. A number of obstacles remain, however.
Popularity: 4%
On Facebook, the Spam Never Ends
by Jiang on May.09, 2010, under Computing, Hacks
This morning I woke up to an inbox full of suggestions to “like” a certain page on Facebook. Curious, I decided to have a look. It turned out to be a service promising to show you who views your profile (which, of course, is absolutely absurd), and all you had to do was press ctrl+c, alt+d, ctrl+v, and enter. Apparently, a lot of people did this and found themselves wondering how their browsers got hijacked.
Popularity: 10%
Slash OpenVZ Memory Usage by Shrinking Thread Stack
by Jiang on Mar.23, 2010, under Computing, Hacks
I recently bought a small virtual server (OpenVZ, 128mb memory, 256mb burstable) for web hosting. I knew that it would be a challenge to work with limited memory, especially since OpenVZ doesn’t swap like Xen. For starters, I went with a 32-bit minimal Debian setup, because 64-bit pointers use twice as much memory as 32-bit pointers. Apache was also out of the picture, but Lighttpd easily filled the role. MySQL was also heavily tweaked to limit resource usage. All in all, I had a happy little system that used 60mb-100mb of memory.
Popularity: 18%
The Omeglean Society
by Jiang on Feb.21, 2010, under Computing, Hacks
Almost every conversation on Omegle contains the ubiquitous “ASL” (age/sex/location) query. You might be asked if you were American (“STAR”) or if you live near the city of St Albans (“STA?”). More recently, a band of Twitter users have set out to find each other on the Web service for strangers. An instant messaging service that pairs random strangers anonymously, Omegle attracts a variety of users.
The majority of users behave as expected. Anonymity leads to abusive language and general silliness online. Advertisers have taken advantage of the unfiltered and unmoderated service using robotic and human zombies alike. Still others engage in cybersex. In a world where identity does not matter, sophomoric behavior is the norm and civility has no bearing.
Popularity: 8%
Omegle Group Chat, Revisited
by Jiang on Dec.10, 2009, under Computing, Hacks
Since the introduction of Omegle Group Chat, a netizen by the name of OmLeif (presumably Leif K-Brooks of Omegle) joined my IRC channel and expressed his dissatisfaction with both the spam bots and my solution. Although he declined to discuss his plans for improving Omegle, he did promise to work on the problems. We knew that change was afoot.
When I checked my chat bot this morning, I discovered that it was being subjected to reCAPTCHA challenges. This welcome change has drastically cut down the amount of spam seen on Omegle. While it appeared that Group Chat was no longer necessary (its original purpose was to create an oasis amidst the spam) or viable, those in my IRC channel asked for more. Knowing that Group Chat still had a place, I set out to rewrite the entire framework.
The fundamental changes are:
- the bot no longer needs to maintain tens of simultaneous connections, since the spam rate is much lower
- IRC support sits at the core of the system instead of having been added on as an afterthought
- should the bot encounter a reCAPTCHA challenge, users present in the channel will be able to solve the challenge via the reCAPTCHA API
To see Group Chat in action, feel free to join #inportb on freenode. Or if you want, you might just luck out on Omegle… Have fun out there!
Popularity: 14%
Omegle Group Chat
by Jiang on Nov.24, 2009, under Computing, Hacks
Omegle is a website used to communicate with random, anonymous people across the Internet. Thousands of users troll the website every day, following its slogan to “talk to strangers.” Because of the lack of moderation, there has also been a recent proliferation of spam bots and human spamvertisers, and sometimes it takes 20 wasted connections before one could have a normal conversation. Now, with the Omegle Group Chat extension, users can finally talk to multiple strangers simultaneously while avoiding spam! If you have been using Omegle lately, you might have come across this introductory message:
You have been randomly selected to join an exclusive Omegle group chat…
The fundamental rules are the same: there is no need to reveal your identity and you may leave at any time. I hope Group Chat has been an enjoyable experience for you. Since you’re here, I might as well answer some common questions:
- Group Chat is neither part of nor endorsed by Omegle
- Yes, this is a real chat room on Omegle
- Up to around 20 people are in the chat room at once
- The chat room is powered by a proxy bot written in Python
- The script uses less than 4MB of memory and less than 40MHz of processor time
- The chat lags purely because of Omegle’s AJAX interface
- Group Chat is bridged with IRC! Join #inportb on freenode for less lag
Due to the recent proliferation of spam, I have implemented a number of spam filters, both automatic and manual, designed to keep the chat clear of junk. Here’s a sampling of the cruft caught by the filters:
** STAT: spambots/s 22.2272497218
13317 :: bot filter – hi, 18/f/new york, wanna see my nüde video? GO HERE: hxxp://……/8hMmzE
85117 :: bot filter – hi, 20/f/florida, wanna see my naked video? GO HERE: hxxp://……/8hMmzE
67937 :: bot filter – hi, 20/f/new york, wanna see my pr0n video? GO HERE: hxxp://……/8hMmzE
54294 :: bot filter – hi, 20/f/new york, wanna see my pr0n video? GO HERE: hxxp://……/8hMmzE
83998 :: bot filter – hi, 19/f/new york, wanna see my pr0n vid? GO HERE: hxxp://……/8hMmzE
Here’s some other crud that I would not dare post on any blog… and on average, the spam rate is approximately 80%. Enjoy spam-free Group Chat!
Update: there has been more work on Group Chat.
Popularity: 22%