Sunday, August 30, 2009

Fix Juniper Network Connect on Snow Leopard

If you are unable to connect your corporate Juniper SSL VPN with Network Connect after an upgrade to Snow Leopard, enter the commands below in a Terminal window:


sudo chmod 755 /usr/local/juniper/nc/6*
sudo mkdir "/Applications/Network Connect.app/Contents/Frameworks"



Try to connect as usual and this should do it.

Tuesday, August 18, 2009

Sort installed RPMs by size

Keep forgetting this one, to list all RPM packages installed on a Linux (Red Hat / CentOS) machine sorted from the largest to the smallest in size:

rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more

This outputs something like this:

[root@healthy ~]# rpm -qa --queryformat '%{size} %{name}\n' | sort -rn | more
87389896 kernel
66720559 glibc-common
35274936 perl
30873913 valgrind
28767659 selinux-policy-targeted
27805586 redhat-logos
27022854 valgrind
26982540 mesa-libGL
24517704 mesa-libGL
22091978 python
20474820 specspo


Sunday, July 5, 2009

Cydia size mismatch error

While installing SBSettings or other packages in Cydia it kept aborting the installation with the error "Size mismatch error" and an "Okay" button was the only option.

After some googling I found out it was probably network related, disabled Wifi to force going over 3G and the installation worked. It could also be that the repository server is down, in this case be patient and try again later.

Default root password on iPhone 3.0

Just installed SSH, was able to login with:

- root / alpine
- mobile / alpine

You can change the default passwords if logged in via SSH by using the 'passwd' command for both accounts.

Monday, June 15, 2009

How to mount an LVM partition

This details the commands I had to run to mount a CentOS 5.1 main disk into another machine. Because of LVM using mount on standard scsi partitions is not enough.

Assuming main physical disk: /dev/sda
Second physical disk: /dev/sdb
  1. Run pvscan to list the physical volumes found in any block device of the system. Among error lines this returned PV lines for /dev/sda2 and /dev/sdb2. On the same line was the name of the volume group, in my case 'sysvg'
  2. Made the 'sysvg' volume group active by typing lvchange -ay sysvg. This created a new entry in the /dev/sysvg
  3. Doing an ls /dev/sysvg showed the different volumes under that volume group, from there simply had to do: mount /dev/sysvg/root.vol /mnt
  4. When done: umount /mnt && lvchange -an sysvg

Friday, May 22, 2009

GWT disable text selection in an HTMLTable

While modifying FlexTable to handle cell selection It took me a while to figure out how to disable the native text selection behavior of the browsers on 'SHIFT+Click' events. Turns out this native javascript function does the job pretty well. I tried playing with event.preventDefault() and event.stopPropagation() but that didn't work.

private native static void disableTextSelectInternal(Element e, boolean disable)/*-{
if (disable) {
e.ondrag = function () { return false; };
e.onselectstart = function () { return false; };
e.style.MozUserSelect="none"
} else {
e.ondrag = null;
e.onselectstart = null;
e.style.MozUserSelect="text"
}
}-*/;

@Override
public void onKeyDown(KeyDownEvent event) {
if (event.isShiftKeyDown()) {
disableTextSelectInternal(table.getElement(), true);
}
...

Thursday, May 7, 2009

How to disable GZIP compression in Firefox

Not sure this is the only/best way but I used the following steps to disable gzip compression in Firefox 3.0:

  1. Type about:config in the URL bar (Accept the disclaimer)
  2. Type encoding in the filter field underneath the URL bar
  3. Doubleclick the line network.http.accept-encoding
  4. Enter the following value instead of the default: gzip;q=0,deflate;q=0
Note: See comment from Anonymous below for a possible better way of doing this. Thanks Anonymous!

Delete Flash9f.ocx - Access is denied

After installing Windows 7 on an XP partition I couldn't completely get rid of the Windows.old folder. The culprits were a few ocx and dll files left with strange permissions by Adobe Flash and Acrobat. All attempts to take ownership and delete failed.

I was finally able to delete these files easily thanks to Unlocker.

Sunday, May 3, 2009

GWT+Eclipse: NoSuchMethodError

If you get this error message while compiling a GWT module in Eclipse, go to the project Build Path and change the Order/Export tab to have the GWT-SDK module at the top.

java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.genericType()
Lorg/eclipse/jdt/internal/compiler/lookup/ReferenceBinding;
at com.google.gwt.dev.jdt.TypeRefVisitor.maybeDispatch(TypeRefVisitor.java:178)
at com.google.gwt.dev.jdt.TypeRefVisitor.endVisit(TypeRefVisitor.java:101)

Software List May '09

Here is the list of programs or utilities that I currently use to get things done. Many of them are open source and freewares, the ones that are not are marked with an asterisk.

The every day stuff:
  • OS: Windows 7 RC1 *
  • Office 2007 *
  • Firefox 3 / Chrome
  • Pidgin
  • gVim
  • SecureCRT *
  • 7zip
  • FileZilla
  • Greenshot (screen capture)
  • VLC
  • TrueCrypt
  • AutoHotkey
More specialized:
  • Wireshark (network capture)
  • WebScarab (http capture)
  • SquirrelSQL (sql client)
  • Eclipse (java coding)
  • Tomcat / Hibernate / Spring / GWT
  • PostgreSQL
  • TightVNC
  • VMWare *
  • GIMP
  • TPFanControl (keeps lap cool)
  • ClipX