Google Ads

I have been waiting a long time for a mature, stable build of CyanogenMod for the ViewSonic gTablet, and I have to say that I am quite pleased with the effort that the CyanogenMod team has put into the version 7.0.3 build. In fact, the only complaint I have is about the lack of built-in CIFS support on the gtab build. This is a guide on how to mount CIFS/SMB shares on your gTablet running CM7.

The reason the gTablet build of CM7 doesn’t allow mounting CIFS/SMB shares is because the cfis.ko kernel module was left out of the ROM. Fortunately, this is a fairly easy fix. On the official CM 7.0.3 gTablet build, the running kernel is Linux 2.6.32.39, and the correct module can be found on DroidBasement in the following lib package:

http://droidbasement.com/gtab/kernels/2632/37/lib-2632.39_gb.tar.gz

If you are running a different version of CM7 (or perhaps another ROM that is likewise lacking cfis support), you will want to run “uname -a” from a terminal emulator or adb to determine the correct kernel lib package to get from DroidBasement, and make sure you get the correct package for your device.

$ uname -a
Linux localhost 2.6.32.39-cyanogenmod #1 SMP PREEMPT Sun Apr 24 22:06:49 EDT 2011 armv7l GNU/Linux

Anyway, there’s only one file in that archive that you should be concerned with at the moment:

lib-2632.39_gb.tar\lib\modules\2.6.32.39-cyanogenmod\kernel\fs\cifs\cifs.ko

Once you have located this file, extract it and copy it to the internal storage of your ViewSonic gTablet using a micro-USB cable or the microSD card. Once you have it loaded onto your tablet, open the Market on your device and install CifsManager. Load the CifsManager app, click Add New Share…, enter the server IP and share name as instructed, enter the mount point, username and password (if applicable), then click on Save Share. Be sure your mount point exists in a location that is writable so that CifsManager can create it.

Before you mount the share, you have to tell CifsManager how to load the cifs.ko kernel module. Click on Menu, Settings, then check Load cifs module, and Load via insmod. Finally, enter the full path to the location of cifs.ko, then hit back and attempt to mount the share. If all goes well, you will see a message that reads, “The share has been mounted successfully.”

Unfortunately the version of CifsManager I had installed failed to set the permissions correctly when it created my mount point. Particularly, it left out the execute bit for everyone except the owner. In order to fix this, open up your terminal emulator, ssh client or adb, and type:

$ su
# chmod a+rwx /mnt/cifs/mountpoint

Replace /mnt/cifs/mountpoint with the actual name of the mountpoint you are using for your share.

And that’s it! You can now access files on your smb share directly from your gTablet within any Android app. I use it to access my music library as well as pictures and video files.

We recently started working on an old Unisys Aquanta EN (which is a rebranded Acer AcerNote Pro 950cx) for the lulz. However, since the thing won’t boot off any external disks and we have no internal floppy or CD-ROM module for it, it turned out that getting an operating system onto it wasn’t so easy. After several hours of fiddling with USB sleds and other possible solutions, we gave up on doing it directly to the hardware.

Enter virtual machines. We first tried VirtualBox, but it turns out that there’s not any easy way to install an operating system directly to a physical hard drive attached to the host OS. We decided to try VMWare Workstation.

Trying to install was a little disconcerting – we could get it booted and going, and the Windows 98 SE installer saw our 4GB IDE hard drive attached to my computer over USB, but as soon as the installer tried to format the hard drive or write files to it, it choked and VMWare gave us a “could not write to the disk” error.

It turns out that, unsurprisingly, UAC in newer versions of Windows prevents software like VMWare from directly accessing a hard drive and writing to it – even though VMWare presented a UAC prompt requesting elevated privileges to access the physical disk. After a little swearing and a bit more Googling, it turns out that you need to manually unmount the hard drive and set it as writable. This isn’t all that hard, but it does require a few minutes of command line work.

Open up a command prompt, type diskpart, and hit enter. Once diskpart launches, type list disk and hit enter to view a list of attached physical drives. You’ll now need to identify which of the drives listed is yours. Once you’re certain you’ve got the right disk, type select disk $n (where $n is the number of your disk). To take the disk offline (unmount), just type offline disk. Once you’re sure the disk is unmounted (you can double-check by looking in Explorer), type attribute disk clear readonly to make the disk writeable. Type rescan to wrap up, and you can now exit diskpart.

Open up VMWare, start your virtual machine, and now you can format your disk normally.

VMWare is a great way to get an operating system on to a disk when you’re unable to do so from the real host computer. VirtualBox is a good free alternative, although it’s a little rough around the edges in a few places. If you have problems or need a more advanced configuration, you can find an in-depth article on this issue on VMWare’s website here.

Happy geeking!

I’m a big scary IT contractor now, working for a relatively small Texas-based company on a contract for the USDA. It’s pretty awesome, and I’ve learned all kinds of things since I started here. One of the cooler tools made available to us is Microsoft System Center, which allows for a single application to manage a huge variety of tasks, including pushing updates to users, working with virtual servers, and installing software remotely. It also has an awesome remote control feature that allows working on a customer’s machine without having to log them out and use regular RDP (remote desktop).

I had the client console installed, but it never worked, mostly because my user account wasn’t in the right domain group, so I didn’t have access rights to connect to the MSC server. Then it turned out that I had a typo in my server hostname, which was causing the SCCM application to crash every single time I loaded it.

Since I couldn’t get the application to stay open long enough to rename the server it was connecting to by default, I figured I’d just uninstall it, which would (theoretically) wipe out any settings that had been created for the application.

Not so.

I mean, really, Microsoft, really? It’s just good manners to take any registry edits and config files with you when your application’s uninstaller is used.

It turns out that I had to search through the registry for the bad server name, rename it, and presto! My client console works perfectly. If you’re having a similar issue, the server string is located in HKCU\Software\Microsoft\ConfigMgr\Admin UI\MRU\DefaultSite. Change ServerName to whatever the correct name is, and you should be back in business.

Maybe the System Center 2012 client uninstaller will actually, you know, uninstall everything.

There’s no doubt about it, Microsoft Windows Media Center is a pretty fantastic product. There are competitors out there (Boxee, Front Row, and MythTV come to mind), but WMC is undeniably an amazing piece of software. It has continued to evolve and improve since Microsoft created its Media Center Edition of Windows XP, and now most home computers come with Media Center – it’s a standard component in Windows 7 Home Premium and Ultimate.

Combined with a good codec pack, Windows Media Center can handle pretty much anything you throw at it – I have no problems playing many different video formats, from the popular XviD and DivX to the slightly-less-common MKV format (which is frequently found as uncompressed 1080P video). However, as I started using WMC more and more with my little Acer L310 HTPC, I discovered I wanted a little more out of my MCE remote.

I’d had the good fortune to come across a used Microsoft MCE Remote v2, which undeniably offers the best support for MCE, seeing as it’s a Microsoft device made specifically for Microsoft hardware. Shortly after acquiring this remote and its accompanying USB receiver, I ended up getting a refurbished Logitech Harmony 550 universal remote for even more awesome control of my home theatre system.

I was disappointed to find out that the Harmony remote and its software can’t easily accept keyboard shortcuts (e.g. Ctrl+C) as remote commands. This makes sense, I suppose, since the remote uses standard IR commands for the many devices it supports. I was stuck with only the buttons that my MCE remote had, and I wanted more. There are handy keyboard shortcuts to access the media sections of WMC – pictures, videos, and music (the DVD menu button will take you to the movies section if a DVD isn’t currently playing). I wanted to program these shortcuts to the multi-function buttons around the LCD on my Harmony remote.

I first tried an older solution with an application called HIP, which theoretically could have let me reprogram the buttons on my MCE remote. Unfortunately, HIP relies on a modified driver for the USB IR receiver…which isn’t 64-bit compatible. I knew that Microsoft used to market an MCE keyboard that used IR, so if I could get my hands on one of those, I could teach my Harmony remote all the IR commands I was looking for. However, this particular keyboard is no longer sold, so I’d be stuck searching for one on eBay and elsewhere – not to mention that I really don’t need yet another keyboard floating around my apartment.

Finally, I happened upon a post on Logitech’s customer forums that mentioned the Microsoft MCE IR keyboard is in the Harmony software’s hardware database – you just have to know how to get to it! Instead of adding your HTPC as its own device, use the keyboard itself – it’s under Computer > Computer > Microsoft. Enter MCE Keyboard as the device, and presto! You have access to all 104 keys of a standard keyboard, plus some extra shortcut keys and MCE controls present on the original Microsoft hardware! With the Harmony software’s ability to enter key sequences in the “additional buttons” section, you can make your remote do anything you want – you can even further extend its ability with something like AutoHotKey, and assign a simple two-key shortcut to whatever scripting needs you might have.

With this discovery, I have exactly what I need to get the most out of my Harmony remote and my Windows Media Center experience. Keep in mind, however, that this solution will only work with Microsoft MCE-specific eHome IR receivers. Third-party MCE remotes use different receivers and IR commands; the keyboard’s IR codes will only work with an original Microsoft receiver.

2010.07.30 [Fri] | 12:50 PM

I recently won a copy of Adobe Creative Suite 5 Design Premium…only to find out that there is no custom folder icon in OS X for containing all the different applications that are part of the suite. I decided to make my own icons, and they turned out so well that I’m releasing them here for the world to use – there are different icons depending on which suite you own (or which icon you prefer). Enjoy!

screenshot

Download here.

I run a Windows Server 2008 R2 box at home, primarily for hosting small multiplayer online games and various websites. While Server 2008 is built on the same foundation as Windows 7, there are quite a few differences.

I finally upgraded my main desktop to Windows 7 Ultimate tonight and discovered that my server was no longer showing up under the “Network” view in Windows Explorer. It turns out that in Windows 7, that view (which used to be called Network Neighborhood in the Windows NT/98 days and My Network Places in Windows XP) depends on a service called Network Discovery to find machines attached to your network. For the multiple machines on my LAN running Windows 7, they display in my Homegroup and Network views perfectly fine. Server 2008, however, has Network Discovery disabled by default, likely as a security precaution.

Of course, when I remoted into my server and tried to enable Network Discovery, imagine my surprise when it kept re-disabling itself! A little googling revealed in this forum post that Network Discovery relies on several Windows Services to function properly. Getting everything set up is surprisingly easy.

The following services should be set to Automatic (some may be set to Manual; others may be entirely Disabled):

  • Function Discovery Resource Publication
  • SSDP Discovery
  • UPnP Device Host

Once you’ve set up these services to start automatically (and made sure they’re started!), you can enable Network Discovery in the Network and Sharing Center’s advanced sharing settings view. Once you save your changes, your Server 2008 machine should show up in the Network view of your Windows 7 computers.

enabling-network-discovery1

Since the launch of OS X Leopard – 10.5, the default icon for SMB (aka Windows/Samba) shares is a CRT monitor with a Windows 98-era BSOD on its display. I prefer the more innocuous generic LCD icon that’s buried in OS X’s system files. It’s not hard to fix, but as I’ve been using Macs at home more and more recently, and I got tired of having to manually remove it every single time I reinstalled (or updated) OS X. So, I made a super easy shell script that lets you fix the icon with one click. You can either download it at the end of this entry or make one yourself.

Making bash shell scripts in OS X is easy – open up TextEdit to get started. Either go up to the Format menu and select Make Plain Text or use the Command+Shift+T keyboard shortcut to convert your new file into plain text.

plaintext

Then, all you need are the commands, one on each line, that are used to replace the BSOD icon with the generic OS X computer icon (which looks like an Apple Cinema Display):

cd /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/
sudo mv public.generic-pc.icns public.generic-pc_lame.icns
sudo cp com.apple.mac.icns public.generic-pc.icns
echo "script complete."
exit

This script copies the original BSOD icon to a backup file, and makes a copy of the generic Mac icon and gives it the appropriate file name. Save this file as something like BSODfix.command.

In order to make it executable, you need to set the correct file permissions. Open up Terminal and navigate to the directory where you saved your script (I keep my shell scripts in Users/Claire/Scripts), and run chmod 755 BSODfix.command to set global execute permissions on the file. Now you can double-click the file in Finder to run it. Terminal will open up and prompt you for the password for your current user account (assuming you are currently logged in as an administrator), execute the script, and exit.

Quit terminal, restart your computer (for some reason, killing and restarting the Finder doesn’t always make the change take effect), and map to an SMB share to see the change.

If you don’t want to write the script yourself, you can download it below:

BSODfix.command

2008.12.12 [Fri] | 07:05 PM

Note: This method has been deprecated with the release of WordPress 3 – in Ubuntu/Debian, you now only need to run the following as root:

apt-get install libssh2-php
apache2ctl -k graceful

And you’re done!

Read the rest of this entry »

My friend Danny is a systems administrator and all-around IT guy at a manufacturing company in Indianapolis. He recently came up with a pretty useful little script, and wanted me to pass it on to the world.

Recently I needed to find out which folders a certain person was able to access on our Windows network. Apparently, this was extremely easy in Novell. Since it isn’t 1995 anymore, I tried to find a way to do this on the Internet. I couldn’t, so I set about making my own.

Microsoft has a utility called xcacls.vbs (if you’re using Vista, you’ll have to make sure WMI is installed, and modify the script. If you can’t do that comfortably, you probably don’t want to be messing with the rest of this anyway). It will allow you to change and view ACL’s from a command line. Since I’m not that interested in modifying the ACL’s in a script, the usage is fairly simple “xcacls c:\windows” will result in a listing of who has entries in the ACL and what the entry is (n.b. you’ll also have to have the default script host be cscript. Wscript won’t work).

In order for this to be useful, we really need to be able to have it run automatically on several, if not all, folders on a computer. The first step would be to get a list of the folders we want to run this on. I chose to limit it to one folder and all its subfolders only (c:\ will do everything, while c:\windows will only do the folders in c:\windows. If you want to do c:\windows and c:\program files only, you’ll have to run it twice).

What I was looking for was basically a text file that just had all the folders. This command will create exactly that:

dir "c:\program files" /s /b /o:gn /a:d > c:\batch\xcacls\dirlist.txt

Now that we’ve got a list of all the folders we need to search, we need to actually loop through it.

For /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat administrator %%i

C:\batch\xcacls\aclSearch.bat is another batch file which takes two parameters (I’ll show you it in a minute). I call the other batch file so I don’t have to worry about how DOS handles variables (it doesn’t like to evaluate them during runtime, and will wait until the loop is done and use the final value for each iteration. It’s weird, I know).

A caveat about the for loop: when using for in an interactive CLI you use a single % sign in front of the i, when using it in a batch file, it’s a double %. Don’t ask me why.

aclSearch.bat contains the following

call c:\batch\xcacls\xcacls.vbs "%2" > c:\batch\xcacls\xcaclsResults.txt
 
find /i %1 c:\batch\xcacls\xcaclsResults.txt
 
if %errorlevel%==0 goto Found
 
goto End
 
:Found
 
echo %2 >>c:\batch\xcacls\%1results.txt
 
:End

This calls xcacls.vbs (from Microsoft) passing it the folder name. The quotes are there to handle filenames with spaces. It then sends the results into a temporary file called xcaclsResults.txt

Next we do a find using the search string (the first item passed – administrator in this example) on that file. If Find finds a match, the errorlevel is 0; if not, it is 1. If the errorlevel is 0, then the folder name is put into a results file named whatever the search string is, with results.txt appended (in this example it’d be administratorresults.txt).

So, how do you actually use all this? FindPermission.bat contains:

dir %1 /s /b /o:gn /a:d>"c:\batch\xcacls\dirlist.txt"
 
for /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat %2 %%i

To search the c:\program files directory for anything the administrators group has access to you’d type:

Findpermission.bat "c:\program files" administrators

The results will be in the same folder you ran findpermissons from and be called administratorsResults.txt. To search the C drive for anything Danny Parrott has access to, you’d need:

Findpermission.bat c:\ "Danny Parrott"

The results from this one will be in Danny Parrottresults.txt.

This does require that Findpermission.bat, aclSearch.bat, and xcacls.vbs be either in the same folder, or in a folder that’s in the path variable. It will work for either users or groups. This process is also not instantaneous. The xcacl.vbs script can take upwards of half a second to run, so on larger systems, this is something you’d want to start and come back to later. On the plus side, though, it hardly uses any system resources while running (5MB RAM and 2-4% CPU time on a four-year-old server at work) so you can run it during the day.

2008.10.27 [Mon] | 08:53 AM

Since OS X 10.4 (Tiger), Apple has provided a remote desktop capability integrated into the operating system. However, unlike Windows (which uses a proprietary protocol called RDP), Apple chose to use the VNC protocol for their remote desktop server and client.

I wouldn’t recommend using Apple’s VNC server; it’s far more restrictive than alternatives. Vine server is much more robust and customizable, and it’s open-source.

However, if you find it necessary to use Apple’s built-in VNC for whatever reason, you may also find yourself needing to control the server from the command line (for instance, if the server application fails and you need to SSH into your remote Mac to restart the service).

I found out the hard way that the Perl script Apple uses to restart the server stores the VNC password in plaintext. This is wrong on a lot of levels, one being that it’s completely user-unfriendly. At any rate, after some Googling around, I found a Perl script that will encode the password with the necessary key. You can then input the encoded password in your VNC restart command.

The Perl script looks like this:

perl -nwe 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; \
chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"'

Paste this at your bash prompt and hit enter. You can then type your password, hit enter again, and have the encoded password ready to go. Once you have your encoded password, you can use the kickstart command to restart the VNC server. Apple has some documentation on using kickstart here.

Overall, Apple made a major blunder by not correctly encoding the password with the kickstart utility. Hopefully this will be remedied in a future release of OS X.

Google Ads