Tuesday, July 29, 2008

How-to: Full read/write access to ReiserFS in Windows Server 2008 x64

Yes, I am fully aware of the ReiserFS IFSD project. However due to the somewhat draconic driver signing requirements of 64 Bit Server 2008 this driver doesn't load. I have heard you can convince it to in 32 bit versions of the OS. There's something about the image hash integrity that prevents it from working. I may try to recompile this in 64 bit but that is a project for another week.

However, it's still possible to gain access to your ReiserFS (and any other linux filesystem you'd like) using free tools in Windows Server 2008. All it takes is some time and a rather twisted hack.

You will need:
  • An installation image file (ISO) for your favorite linux distribution. If you don't know linux that well I'd recommend Ubuntu or Fedora. I used Gentoo, since I knew I could make it a very small installation.
  • VMware Server 1.0.6. VMware Server is free, you need to fill out a web form to request pretty much any number of license keys.

At the end of this article I've provided the kernel configuration file I used for Gentoo as well as my smb.conf.

Start VMware Server, before you install you should reboot. Press F8 before windows loads, and make sure to select "Disable driver signature enforcement". Before some recent patches, this could be set permenantly using bcdedit, but no longer works. It is recommended you suspend your windows installation instead of shutting down to avoid having to do this every time you boot your system.

Connect to localhost and create a new VM, use typical settings. Selecting the type of OS you'll be running is only really useful for VMware tools, which I won't discuss here. Feel free to comment on this. Call it whatever you want.
At the networking screen, for security's sake it's advisable to use NAT or host-only networking. I used NAT.
The next screen is for the size of the virtual hard disk. This doesn't really matter, and should only be as large as absolutely needed for your linux of choice, but really shouldn't need to be much bigger than 6 or 7 gigabytes. My Gentoo installation is about 1.3GB, and could probably be made smaller.
For the CD-ROM drive, if you've burned your installation disk use the physical drive, otherwise select the image file you downloaded earlier.
Finish setting up your VM and start it. With no data on the virtual hard drive, it will boot off the CD. For the sake of the length and scope of this article, I will assume you know how to setup the distribution you selected. When you get to a point where you can, make sure to install the most recent version of Samba you can.

Once your linux VM is installed and working, shut it down.
In the VMware console select the VM and click "Edit virtual machine settings", then click "Add" to add hardware. The 3rd option when adding a drive should be to directly access a physical hard disk, for experts only. Click 'ok'.
The names VMware gives the disks in your system are probably not the most descriptive things in the world, but you select to use Invidual Partitions and click next you can see the partitions and their types that are available on the selected disk. Select your Linux partition(s).
Start your VM again.
Once you are up and running, fdisk -l or the system browser should recognize the new disk.

Open the file /etc/fstab as root in your editor of choice and add a line similar to this:
/dev/sdb1 /mnt/reiser reiserfs user,defaults 0 0
Where /dev/sdb1 is the name of the partion as shown in fdisk -l. Also make sure the directory /mnt/reiser actually exists. If it doesn't, create it (you will likely need to be root).

Now mount /mnt/reiser.

The final piece of this convoluted puzzle is samba, the smb.conf file.
workgroup = WORKGROUP
netbios name = vmlinux
server string = Samba Server %v
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
path = /mnt/reiser/
public = yes
writable = yes
browsable = yes
guest ok = yes

Make sure samba is configured to run on startup...in Gentoo this is
rc-update add samba default
in Ubuntu or Fedora you can configure this in the GUI. If your desktop is GNOME, this will be in System>Administration>Services

Either reboot here or start the service /etc/init.d/samba start

Now back in Windows, open the explorer and go to Network. If you are using Aero you will need to hit the 'Alt' key to see the 'Tools' menu. Select 'Tools' and 'Map Network Drive'.
Select whatever drive letter you want, and as a folder use:
Click 'Finish' and you are done! Yay! You can now open your linux partition under windows and have full access to it.

If you left 'Reconnect on logon' checked when you mapped the drive you should edit the virtual machine. In the options tab of the edit dialog, select the Startup/Shutdown setting and from the dropdown box under "On host startup:" select "Power on virtual machine"

Click here for the Gentoo kernel .config file

As a note I wrote this while incredibly hungry, so it might but hard to understand some things. I might be rewriting sections of it to word things better later...if it looks like anyone's coming here and reading this.


Saturday, July 26, 2008

How-to: VLC/Windows Full Screen Video trick.

Once upon a time, nVidia cared about us. The nVidia control panel was hard to use but pretty slick and it had one feature that I thought was absolutely great: There was a video overlay feature that would automatically clone any video output from either screen in full screen on a screen you specify.
In Linux I can simulate this by selecting a screen for full screen output, and VLC will comply without hesitation every time I go to fullscreen mode and every time I add a file to the playlist...it opens in full screen ON THAT SCREEN no matter where the VLC window is.

Windows has befuddled my every attempt to do this. In Direct X output mode video uses the wrong aspect ratio in XP and forces Vista to change from Aero to Vista Basic, and displays on a portion of the video. (Your milage may vary). And OpenGL requires me to move 51% of my window to the other screen, but then if the next video on the playlist starts and I have moved the window to a different screen, it full screens there. Usually on top of my work.

After some experimenation using VLC 0.8.6i on Windows Server 2008 I have managed to get an affect that is close to my Linux experience.

The final result is this: A VLC player with controls, but no video in the main window and video automatically playing in full screen, on the same screen each time (even after the next video in the playlist.)

First enable full screen off the bat so you don't need to force the video into full screen when you start VLC the first time:

1. Go into the settings menu and open preferences, check the box that says "Advanced Options"
2. Select the "Video" section from the box on the left.
3. Check the box that says "Fullscreen Video Output"
4. Scroll the main settings area down to place where you can see "Window Properties"

"Video Height" and "Video Width" should be set to the height and width of the screen you will be viewing your full screen video on. (In this iteration of the technique this is not strictly necessary, but is a leftover from experimentation with the "clone" video filter which would allow video in both the main window and the extra screen)

In my case this is 1024x768 screen.

5. The next 2 options will be Video X and Video Y. In my case, my 1024x768 screen is to the right of a 1280x1024 screen. So I set Video Y to 0, so it's at the top of the screen, and Video X to 1280 so that it will be in the left corner.

6. Further down the window will be another box for "Window decorations". Uncheck it.

7. The very last option on the left should be "Interface", expand this, and then expand "Main interface". Select "wxWidgets" from this list. Unceck the options for "Embed video in interface" and "Size to video"

While this is incredibly involved and rather inflexible, it does get me video the way I'd generally watch it and could hopefully be of use to someone else.

As a note I already tried getting Windows Media Play, MPlayer, and Media Play Classic to behave the way I want them to (like VLC/Linux) but had no luck. MPlayer wouldn't even play ANY video on my other screen.


Sunday, July 20, 2008

Full Review: The LG VX10000 (LG Voyager)

I have had the LG Voyager for just shy of a full week now and I've uncovered several things I haven't seen in any review so far.

Let's get this out of the way.
Things about the PHONE that suck:
  • The phone is soap bar shaped, there are buttons on only one side. Unfortunately if you're not looking for these it's too easy to hold the phone upside down. In 6 days I have done this twice. Despite the slickness of the phone, it's hard to look cool when you're jabbing the speaker.
  • The speaker. The speaker is pretty good for regular calls, when speakerphone is off. The speakerphone speakers (Yes, two...AMAZING) are on the inside of the flip. The first time I turned speakerphone on I didn't even realize it, the volume was still so muted. Honestly, who opens their phone to talk unless it's SUPPOSED to be a flip-phone?
  • They only have a mini-jack, not a 3.5mm
  • I wish they put a slide cover over the camera lens. Not really a big deal but I keep putting my fingers on it when I hold the phone when it's flipped open.
Things about the PHONE that are sweet:
  • I gotta say I really like the unique interface. The 2 screens, the flip, the full QWERTY keyboard.
  • Slide out antenna for mobile TV to improve reception. It makes it look like one of those old battery powered handheld TVs.
  • The touch screen is very good, so is the keyboard. I can type pretty quickly on both. The locations of the spacebars on the full keyboard is a little eh, and differs from the on-screen one...you have to learn 2 different layouts to use 1 device. But the keyboard is still sweet.
Things about the PLATFORM that are sweet:
  • Relatively responsive.
  • Custom shortcuts.
  • VZ navigator has gotten quite a bit better since I last used it 2 years ago when I got my RAZR.
  • The keyboard does sometimes self-correct if you shuffle across a key very fast or put in 2 letters very fast that make absolutely NO sense. Or at least it seems that way. The haptic and audibly feedback is good stuff, too.
  • The mobile IM app is nice, in the fact that it supports both screens.
  • The contact list is layed out really well.
Things about the PLATFORM that suck:
  • The mobile email app sucks out loud. It only runs in the inside screen, it's slow. Scrolling sucks. It won't pull URLs from messages, but sometimes finds phone numbers hidden in them.
  • The mobile IM app is ugly as sin and hard to use from the touch screen. If you open the phone to type a message using the real keyboard (since it's a little easier, and you can see IMs other people send when you're typing.) then close it again, the application quits. Also it has a "SENDING" screen when you send an IM...not very instant, is it? This app also seems to have a HELL of a time connecting sometimes.
  • There is an application, RemoSync, which costs $10 to install and allows syncronization with Microsoft Exchange. This is worse than staring at a horse's ass for a protracted period of time. It syncs calendar, but to its OWN application not the phone's main calendar. It does this BADLY. When I tested it missed half my recurring appointments and a few standard ones. It also only pulls the last week of email. Also for some reason I had to turn the application's SSL off to work with RIT's servers. This was odd since we use SSL on our servers for MAPI and OWA.
  • The phone can't multitask at all. If you close the phone while something's running, the app will close. You can't do ANYTHING while the music player is running. There is no rhyme or reason as to which apps require you to open them. Most of them are obviously hacked up ports from the standard platform to the dual-screen/touch screen paradigm.
  • The SMS app seems to be the only application on the phone that doesn't allow the wide touchscreen keyboard to be used. You're stuck texting your friends on your pimpass touchscreen phone using a touchscreen keyboard that's faking your old 10 button phone keyboard.
  • The Obligo browser is a piece of junk. Don't even pretend.

I've enjoyed having the phone, but I intend to take it back in another week. It definitely isn't worth the $410 I paid to get it without a contract.

What I would love to see is a phone with the unique physical attributes running something like LiMo or Android. An open platform that the development community can make stop sucking. I daresay that the extra screen would make a linux phone on the Voyager sweeter than the Instinct or the iPhone.

As a closing, I'm sure I missed something here someone wants to know about the phone...I am always available on AIM or by e-mail for questioning regarding anything I write about.

--- PXA

Saturday, July 19, 2008

Dark Knight For Dummies.

I recently had the pleasure of seeing The Dark Knight in IMAX. It was an absolutely amazing film, tinged slightly by the passing of Heath Ledger. Although the movie is really a fitting memorial.

During the movie I was surprised initially at the rambling feel of the plot, and the ridiculous feel of the dialog in some parts. I read a review that described it as "operatic", that's a very good way of putting it. Phrases like "Gotham's White Night", "He's not the hero we deserved, he's the hero we got.", "We'll hunt him, because we have to...because he can take it.", ...the word "MUST", and such are peppered in.

And it seemed like every 20 minutes the movie was reaching an epic climax, which would lead directly into the next building sequence. Not that I don't think movies should do that, I thought it was excellent, but it just didn't fit with the very clear and straight plots modern films and the previous Batman films have had.

It took me until almost the last frame of the film to realize what I was missing. And I'm disappointed it took me so long. I realized all these make more sense when taken in a different context. If you think about it not as a movie, but as a comic book series, it all makes more sense. The dialog while somewhat overstated and strange when spoken is now perfectly at home in a speech bubble. The repeating epic points are like end of each book, keeping you there so you buy the next installment.

Recent films have been following in this trend, emulating graphic novels. Most are far more blatant, being based on the novels, being cell shaded (Or using a very obvious visual style). The Dark Night is very much like these in scope and attitude, but opting for a more striking true-to-life visual look.

Viewed with this in mind the whole thing really does feel more ingenious, a more epic vision. It's a little strange to think that a MOTION PICTURE is made better by imagining it as a photo-realistic, live-action comic book...but it works.

Monday, July 14, 2008

I do not own an iPhone.

My poor phone has had its balls unceremoniously removed by my wireless carrier. Yes, I admit, I have Verizon.

My Verizon contract is expiring in November. Since the standard cell contract is 2 years, I have been shopping for not only a new phone but a new carrier. I'm going to be graduating with this phone, and this carrier. Verizon got me when I was graduating high school. They were appealing on plan cost, "in" calling. I didn't care much about phones or features. Times have changed. I'm addicted to the internet, I need e-mail at my beck and call, IM available at all times...just in case. My life is ruled by Microsoft exchange. I'd really like to have that calendar at easy access.
My iPod is beginning to die out. Bad battery, freezing hard drive...it's out of warranty. Why buy two devices when I can get one? Unfortunately the only "one" device is the iPhone. There are a few that come close in cool. And given the type of people who've jumped on the iPhone...I've really been trying to avoid buying an iPhone.

So I've been looking for my transition phone on the eve of the release of Apple's next massive lifestyle addon. And HOO-Boy, it's hard to avoid.

However there are several other phones available on the market (Closed source/proprietary OS phones only...I have yet to see hide or hair of a LiMo or Android phone) with compelling feature sets.

This excludes the Windows Mobile and Blackberry phones. I don't know why, but it always feels like these phones are trying to violate my corneas in incredibly inappropriate ways. SO! I ignore them.

The LG Dare: 4 Cool points.
The LG Dare is an all touch screen feature phone. I think it is of note because it is the only phone I have seen that has a concept resembling a desktop, and not just a collection of shortcuts. The "dumped" look of the icons on the "desktop" is very interesting, and very indicative of the amount of eyecandy the phone presents. The phone uses the same mobile e-mail app as most Verizon phones. It also has its balls removed, like most Verizon phones. The calendar is passable by itself, but it doesn't sync to...anything. The e-mail app on the touch phone doesn't provide the most compelling interface, since it's just an update of the old app to use touch interaction, but it serves well. The screen is very bright and clear and the touch is very responsive. But in the pure-touch contest it can't compete with the Samsung Instinct or the iPhone, it just doesn't have the features those do.

The LG Voyager: 6 Cool points.
The Voyager is a dual screen phone carried by Verizon. There is a touch screen on the front allowing access to the phone, contacts list, some other features. It does a very good job here, the phone is very easy to use. To use any of the advanced features like the browser or the text client, you simply FLIP the phone open to reveal a full QWERTY keyboard and another GREAT screen. This one's not touch though. Aside from the interface differences (The keyboard, the dual screen) this one doesn't have anything on the Dare. The Dare I used at the store actually had the e-mail app installed, the Voyager didn't. The phone actually loses there. The Voyager does have several cool points on the Dare, simply by virtue of its unique interface.

The Samsung Instinct: 8 Cool points.
This phone is seriously one of the coolest things I've ever held in my hands, next to girl-parts. This is another all touch screen phone. It has a very large screen, a bit smaller than the iPhone's, but larger than pretty much everything else on the market. Even those eye-porking blackberries. The colors are smooth, the screen is great...even for video. The browser is marginally better than the Verizon standard browser. The phone also has a pretty-ok music player and a standard headphone jack. Which serves my purposes well. I love the interface on the phone, the menus are very intuitive, the keyboard is surprisingly good, the phone app is slick. The haptic feedback is done quite well, it's present but not obnoxious. Sometimes it lags a little bit when switching layouts or moving between applications but it's still better than anything Apple's done. The e-mail application on the phone configures almost effortlessly to work with Outlook Web Access, but doesn't sync to the calendar. The lack of calendar sync is really the ONLY thing I don't like about the phone. Since they're scraping OWA already it'd be pretty inconsequential for Samsung/Sprint to hook this into the calendar, much like the Evolution Linux e-mail client. Unfortunately the platform the phone runs on is closed so no one can write a bridge...Samsung will have to do it, and they really ought to do this, if they want to compete with the iPhone. And WOAH they want to compete with the iPhone.

Apple iPhone 3G: 9 Cool points.
This phone has been written and talked about ad-nauseum. I'll keep it short. Think of the Samsung Instinct: now make it a little wider, taper the edges, brighten the interface, add calendar synchronization to Exchange, add some more applications on the phone by default, remove the haptic feedback, double the maximum storage capacity (but remove the expandability), and add an SDK. The iPhone uses a heat sensitive screen for its touch, not pressure like most of the touch phones on the market, slight difference but given the SDK people could actually use this. Also add that it's an Apple product, and everything that comes along with that.
...Turtlenecks, berets, inability to upgrade computer hardware, a strange desire to round all the corners on websites, goatees...

So there is the not quite objective review of feature phones. Despite my very strong desire to NOT like the iPhone, it still wins on cool...but only barely beyond the Instinct. Unfortunately Apple's always going to have the upper hand since the phone runs OS X under the hood and that allows for the robust SDK. A proprietary platform like the Instinct's will never compete with this. Samsung's only move would be to adopt LiMo or Android. (*wink*) I have reserved the 10/10 cool point rating for a phone like the Samsung Instinct running an open platform. An unencumbered phone WILL beat the iPhone...because OSS developers will make it so.


Wednesday, July 9, 2008

Exchange Form-Based Authentication and WebDAV in Python.

Since I've become employed fulltime at RIT, in addition to my part-time work with Synacor and trying to maintain something resembling a sleep schedule...I haven't had too much time to write. I did complete a successful test of the gcal sync software and then realized that IMAP won't allow me to place appointments into it making 2 way syncing impossible. So I have been forced to try to re-architect the script using Exchange's poorly documented WebDAV API.
WebDAV is supposed to be an XML web service that goes over HTTP/HTTPS. Unfortunately Microsoft can't do anything right. DAV uses several non-standard HTTP methods, like SEARCH, PROPFIND, PROPSET...instead of the standard HTTP GET, POST, and PUT methods.
Microsoft Exchange also has a bit of a quirk called Form-Based Authentication. When you enable Outlook Web Access, this is the only way to authenticate. Without OWA you can use Basic HTTP Authentication which is pretty easy. With OWA you have to do some interesting maneuvering to get your query in. From a theoretical point of view, what you need to do is simple:
  1. Fake an HTTP Post to the owaauth.dll file.
  2. Receive the response headers and pull the cookies, store them.
  3. Send these cookies back to Exchange while making your "special" DAV SEARCH request.
However, implementing this gets a little annoying. I've been using Python...which has a pretty slick high-level network protocol API, called urllib2. Which can automatically create HTTPS connections, parse HTTP response headers and grep out the cookies, create requests and urlencode GET and POST strings, all sorts of happy things. Unfortunately this library only deals with GET and POST, unless you write your own "handlers". I wasn't sure how to go about extending the library so I chose to go the dirty hack route and implement the functionality I needed at the low level.

import httplib,urllib2,cookielib,sys,getpass,Cookie

exchserv = raw_input('Exchange server: ')
loginex = raw_input('Enter Exchange Username: ')
passex = getpass.getpass('Enter Exchange Password: ')
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPSHandler(),urllib2.HTTPCookieProcessor(cj))
owabody = 'destination=https://'+exchserv+'/exchange/'+loginex+'/&username=main\'+loginex+'&password='+passex
owaheaders = {'Content-Type': 'application/x-www-form-urlencoded',
'Connection': 'Keep-Alive',
'User-Agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)',
'Host': exchserv}
owareq = urllib2.Request('https://'+exchserv+'/exchweb/bin/auth/owaauth.dll',owabody,owaheaders)
owa = urllib2.urlopen(owareq)

conn = httplib.HTTPSConnection(exchserv)

#there is nothing I like better than manually constructing HTTP headers.
conn.putheader('Content-Length', len(davapptquery))

stringofdeath = ''
for i in cj:
stringofdeath += i.name+'='+i.value+';'
conn.putheader('Cookie', stringofdeath)


resp = conn.getresponse()

Where davapptquery is an unholy string containing a SQL query wrapped in some XML.
I pretty much suck at python, but this does work. Someone better could probably more easily create a handler for exchange's DAV insanity.