Sony Xperia connection problems

After much searching and head bashing, I finally got my Xperia to connect via USB.

Beyond doing all the normal stuff: rebooting the device, installing Sony’s PC Companion to get the latest drivers, still nothing worked. PC Companion would detect when the device was attached but wouldn’t connect.

This little tid-bit is the key, I had to flush the cache for their “MTP extension service

Go to:
Settings > Apps > All > MTP extension service > Clear data/cache

also stop the extension.

Bridging a WRT54G to a local hotspot (iphone) with DD-WRT

These instructions are geared to a mobile phone hotspot, but they should apply to most hotspots.

If you need to reset your router, unplug it for a few minutes, holding the reset button down plug the router in and continue to hold the button for at least 30 seconds.

  1. Connect to your router (192.168.1.1) and reset the user and password (you should be asked, if not do another hard reset)
  2. log in
  3. Go to “Wireless->Wireless Security” enable,
    1. set security mode “WPA2 Personal”
    2. select the WPA algorithm to match your hotspot in my case “TKIP+AES” and enter the password the corresponds to your hotspot
    3. save & apply
  4. Go to “Wireles->Basic Settings”
    1. set wireless mode: Client Bridge
    2. set the SSID to match your hotspot exactly
    3. save & apply
  5. On your phone you should see your WRT54G connection on your phone
  6. Go to “Security->Firewall”
    1. disable SPI Firewall
    2. Uncheck “Block Anonymous WAN request, Filter IDENT”
    3. save & apply
  7. Go to “Setup->Advance Routing”
    1. change “Operating Mode” to “Router”
    2. save & apply
  8. Go to “Setup->Basic Setup”
    1. set your Local DNS to a well known DNS server like Google’s 8.8.8.8

That should be it, you should now be able to connect to the Internet via any port on WRT54G

Note: that any machine that uses DHCP that is connected to your router will get a bridged network IP and will not be able to administer the router. To administer the router manually set your IP to 192.168.1.131 and you will be able to connect to the web administration console.

Assorted Windows Tricks

Most of these were scraped from reddit.com

systemd – migrating from init.d

Since Fedor 16 systemd has replaced init.d (or tried to at least) and given the somewhat poor documentation you may require a bit of trial and error to integrate your init.d scripts with systemd.

Since Fedora 17 some of my startup scripts no longer function properly with systemd, hence the need to at least migrate to systemd (but not actually go native)

The other issue besides the documentation is that there are multiple ways to achieve the same thing which adds to the confusing documentation.

First you will need a systemd startup/shutdown script like the following, /etc/init.d/sample is a classic init.d script, that is, takes start/stop/restart command line arguments.

Create your sample.service file in /etc/systemd/system.

You’ll notice there is no “ExecRestart”, systemd’s creators think they’re smarter than you or I, so restart calls ExecStop and ExecStart in order. An alternative is to use the ExecReload if you have custom restart behaviour, sadly this is a departure from how things have been done in the past so you will have to use reload instead of restart when using systemctl.

/etc/systemd/system/sample.service

[Unit]
Description=Sample service
After=syslog.target network.target


[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/etc/init.d/sample start
ExecStop=/etc/init.d/sample sto
ExecReload=/etc/init.d/sample restart


[Install]
WantedBy=multi-user.target

If your service depends on another service you add the dependency to the After clause, for instance: After=syslog.target network.target some.service

For running init.d scripts I use Type=oneshot which coupled with RemainAfterExit=yes means don’t kill the process group when finished.

To enable the service use: systemctl enable sample.service you can check /var/log/messages for any messages.

If you make any changes to your service files you must reload systemd using: systemctl --system reload

Starting your service: systemctl start sample.service
Stopping your service: systemctl stop sample.service
Status of your service: systemctl status sample.service
Restart your service: systemctl restart sample.service
Reload your service: systemctl reload sample.service

References:
http://www.freedesktop.org/wiki/Software/systemd/
http://www.freedesktop.org/software/systemd/man/systemd.service.html

VMWare Server 2 on Fedora Core 14

I gave up on Fedora Core 15 (for now)

Prerequisites:

Install Fedora, I use the Software Developer version with the Fedora Packager.

Unpack raducotescu-vmware-server-linux-2.6.3x-kernel-release-1.6-0-gbb26dce.zip, copy VMware-server-2.0.2-203138-update-2.patch into raducotescu-vmware-server-linux-2.6.3x-kernel-e26b34e, you can either overwrite the original vmware-server-2.0.2-203138-update.patch file or update vmware-server-2.0.x-kernel-2.6.3x-install.sh to use the patch-2 file.

Disable selinux

Update /etc/services so that 902 reads as follows:

vmware-authd    902/tcp

Create a link to the kernel headers:

ln -s "/usr/src/kernels/$(uname -r)" /usr/src/linux

Add UTS_RELEASE to /usr/src/linux/include/linux/version.h (see https://blog.tuinslak.org/vmware-server-and-kernel-2-6-33):

echo "#define UTS_RELEASE \"$(uname -r)\"" >> /usr/src/linux/include/linux/version.h

Finally run Radu’s script giving it the directory of your vmwarer server 2.0.2 archive.

./vmware-server-2.0.x-kernel-2.6.3x-install.sh /PATH/TO/VMware-server-2.0.2-203138.x86_64.tar.gz

If all goes well you will have completed your install without error.

A couple of final cleanup issues you will need to rename libxml2.so.2 for vmware to something else (see http://communities.vmware.com/message/1670144#1670144)

mv /usr/lib/vmware/lib/libxml2.so.2/libxml2.so.2 /usr/lib/vmware/lib/libxml2.so.2/SKIP.libxml2.so.2

And finally update /etc/init.d/vmware script so it starts after networking has properly started, the default configuration doesn’t do this on my machine.

Update the chkconfig line to read:

# chkconfig: 35 35 20

Make sure the init scripts are properly linked:

chkconfig --del vmware
chkconfig --add vmware
chkconfig --level 35 vmware on # for good measure

Reboot your machine.

Depending on your configuration you may also have to update your iptables rules.

Outlook is a massive POS

This is why the machines will never win the coming Judgement Day, Microsoft Outlook and circular logic 101:

The e-mail address for the sender (ABC@theYYYgroup.com) is internal to your organization and cannot be added to the Safe Senders list. E-mail from senders in your organization will never be treated as junk e-mail.

  1. So the email from the internal sender was flagged as junk
  2. And the sender cannot be added to the white list because the sender is internal
  3. If the sender is internal and always trusted how did the email get flagged as junk.
  4. Reductio ad absurdum

Doesn’t Microsoft test their software?

Fuzz Tester First Release – Code Less, Test More

I’m happy to release the first version of Fuzz Tester a JUnit 4 compatible test runner. Fuzz Tester is a data-driven test runner.

You can download the first release 0.7.0 at Google Code: http://code.google.com/p/fuzztester this should be considered a beta release as I currently have some people reviewing the release, and I will hopefully get some good feedback to improve the project and documentation.

FuzzTester is a JUnit 4 test runner that allows you to manage your test data in files instead of in your test code, this simplifies your test code, and decreases the feedback loop between writing tests and running tests.

Code less, Test more.

iPad first thoughts

Having used my iPad now for a few months here are some of my observations, in no particular order…

  • Instant on, this is a killer feature if only the wifi synced as quickly as the iPad started
  • no cables or power during regular use
  • can perform a wide variety of simple tasks from the comfort of wherever, need I say more
  • A great device for the gym, easy to read e-books while working out on the stair master, treadmill, etc.
  • with the correct HDMI cable you can use it as a media player
  • My wife finds it easy to use and uses it regularly
  • Great for technical documentation, in particular PDF’s, also  dictionary searches in the application
  • A portable interactive manual great for working on mechanical things without having to have a full blown computer near by

The negatives, and there area few…

  • It could be lighter, but I expect that to be a future enhancement
  • The wifi sync’ing can be slow at times
  • typing in long passwords on all portable devices is highly annoying, this is true of every portable device
  • A little too easy to cheat on the crossword

Good News: iTunes 10 doesn’t break rTunes

As has been the case with previous major updates to iTunes which changed the com interface on windows and forced me to re-package rTunes with the lastest com interface, iTunes 10 didn’t change the com interface so all systems are go.

Solving the Android R.java problem

R.java is one of the most annoying things I’ve come across recently. If you want to create and deploy multiple android apps from the same source, it must be done with each app having a unique package name, and there in lies the rub. A unique package name means a unique R.java with the same package name for each instance, but your source want’s to use a single R.java, and you certainly don’t want to be changing all your source to update the package name every time you release a different version of your app, for example a free trial vs. the paid version.

So the solution is to create two R.java files, one with your internal package name and the other with the package name of the release which comes from AndroidManifest.xml, at this point I would point out that you should probably generate your AndroidManifest.xml.

To generate the required R.java files, you must customize the Google Ant build scripts,  copy android_rules.xml from the SDK into your project. The second exec stanza generates the internal R.java which you specify with the property “package.internal”

<!-- Generates the R.java file for this project's resources. -->
 <target name="-resource-src" depends="-dirs">
 <echo>Generating R.java / Manifest.java from the resources for ${package.destination}</echo>
 <exec executable="${aapt}" failonerror="true">
 <arg value="package" />
 <arg line="${v.option}" />
 <arg value="-m" />
 <arg value="-J" />
 <arg path="${gen.absolute.dir}" />
 <arg value="-M" />
 <arg path="AndroidManifest.xml" />
 <arg value="-S" />
 <arg path="${resource.absolute.dir}" />
 <arg value="-I" />
 <arg path="${android.jar}" />
 <arg value="--custom-package" />
 <arg value="${package.destination}" />
 </exec>

 <echo>Generating R.java / Manifest.java from the resources for ${package.internal}</echo>
 <exec executable="${aapt}" failonerror="true">
 <arg value="package" />
 <arg line="${v.option}" />
 <arg value="-m" />
 <arg value="-J" />
 <arg path="${gen.absolute.dir}" />
 <arg value="-M" />
 <arg path="AndroidManifest.xml" />
 <arg value="-S" />
 <arg path="${resource.absolute.dir}" />
 <arg value="-I" />
 <arg path="${android.jar}" />
 <arg value="--custom-package" />
 <arg value="${package.internal}" />
 </exec>        
 </target>

In your build file, tweak the android setup as follows

<setup import="false" />
<import file="${basedir}/build/android_rules.xml"/>

import false says don’t use the standard android_rules and the following import references your custom rules.

A good reference, but didn’t go far enough: http://java.dzone.com/articles/building-two-versions-same?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone)