July 30, 2008 at 10:56 pm
If you’ve ever used Linux and gotten used to having a command prompt, then going back to the Windows command line is a difficult and frustrating change. Luckily, there’s an amazing program called PowerShell that can alleviate your stress.
To open a command prompt in any directory in Windows Explorer, follow these steps to add a list item to the context menu:
- Open up Windows Explorer
- Click “Tools” -> “Folder Options” -> “File Types”
- Select the “Folder” file type
- Click “Advanced” -> “New…”
- The Action will be displayed on the context. For example, I entered “PowerShell Here”.
- Now enter “C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath ‘%L’” for the program to use or “C:\Windows\system32\cmd.exe” if you don’t have PowerShell installed.
If you want to later remove the entry from your menu and the “Remove” and “Edit…” buttons are grayed out as they were for me then you can open up regedit and delete the corresponding entry from HKEY_CLASSES_ROOT/FOLDER/shell
Buy Me a Beer
Permalink
July 29, 2008 at 2:08 pm
Getting started on Linux can be challenging. Largely because the first time user won’t have any idea how to track down potential problems. The following commands are essential to get additional information about your system when something goes wrong:
- uname -mr - Shows what kernel version and processor you are running on
- sudo fdisk -l - Can help you figure out how things are mounted
- dmesg - Useful for tracking down problems during boot
- tail -f /var/log/messages - Now run the process giving you problems and you might see helpful error messages
If you’ve got other suggestions, please feel free to comment below. Thanks!
Buy Me a Beer
Permalink
July 27, 2008 at 5:12 pm
Wine attempts to create a Windows-compatible layer on top of Linux to allow you to run your favorite programs. Recently, Wine had its 1.0 release and has gotten quite strong when compared to earlier versions. Quicken works reasonably well with wine-1.1.6 and later.
With wine-1.1.5 and earlier you’ll need to use a WINE override. That is, you must tell Wine to use the native Windows version of gdiplus.dll:
- Get a copy of gdiplus.dll ensuring that you adhere to any applicable licenses and put it in ~/.wine/drive_c/windows/system
- Run winecfg
- Hit “Add Application…” and browse to “drive_c/Program Files/Quicken/qw.exe”
- Under the “Libraries” tab add a native override for gdiplus
Unfortunately, Quicken still cannot access the internet and there is no workaround for this since schannel, the library which implements SSL, has not yet been implemented.
If you need better debug logs for filing bugs you can set the WINEDEBUG environment variable to get more detailed output or suppress output that is overwhelming. For example, you can put the following in your ~/.bashrc file:
export WINEDEBUG=fixme-richedit,trace+secur32
Then run “source ~/.bashrc” to reload the file.
Also, if you’d like to see the debug output scroll by on the screen as well as save it to a file then you can run the following:
wine qw.exe 2>&1 | tee trace.log
Buy Me a Beer
Permalink
July 27, 2008 at 7:36 am
To get Windows Explorer to open to a default directory, you can create a new shortcut and modify the path. For example, the following shortcut path will open a directory of documents on a shared drive using Explorer instead of the normal window:
%SystemRoot%\explorer.exe /e,S:\Documents
Buy Me a Beer
Permalink
July 10, 2008 at 1:51 pm
I often want to have a String description of my beans for debugging or logging purposes, but hate having to manually concatenate the fields in my class to create a toString() method. This code snippet using Apache Commons (a.k.a. Jakarta Commons) is very helpful for just such occasions:
public String toString() {
try {
return BeanUtils.describe(this).toString();
} catch (Exception e) {
Logger.getLogger(this.getClass()).error("Error converting object to String", e);
}
return super.toString();
}
Buy Me a Beer
Permalink