JS Ext

Friday, August 31, 2012

Wifi tethering

In July, I rooted my phone so that I could tether over WiFi.  I was traveling and I knew. Wouldn't have access to the internet.  I installed a WiFi tethering app on my phone but it had some issues.  After I was done with the internet, I disabled tethering.  At that point, my phone couldn't connect to any WiFi networks.  I had to restart the phone t use the WiFi.  The experience made me hesitant to root my current phone to do tethering.

The other day, I discovered the FoxFi app.  This app allows you to do WiFi tethering without root or a tethering data plan!  Although available on Google Play, some carriers block the app from being listed.  It was convenient enough to go to the app's home page and download the .apk file.  After installing the .apk file, I was ready to go.  I set a WPA password and turned on the hotspot.  I had my coworker connect to my hotspot.  After he verified that it the tethering was working he installed the app, and I connected to his hotspot from my phone.  It was that easy!  The user interface was pretty simplistic.  It didn't support some of the features that other tethering apps supported, like Mac filtering. Working without rooting your phone makes it well worth it, though!

Thursday, August 30, 2012

The Joys of Xen Snapshots

One of the Windows VM's that I have is for hardware drivers.  I don't like installing custom drivers because they never see to go away.  This is where the snapshot feature of qcow2 comes in handy.  I just take a snapshot before installing the drivers.  If the hardware doesn't work out, I just apply the old snapshot and no more messy drivers!

This also works well when trying out new software.  Lots of software comes with adware.  Adware is sometimes hard to remove.  By making periodic snapshots, you can rollback the adware, instead of trying some poorly written anti-virus program.

mycomputer disks # qemu-img snapshot -l vm1.img 
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         fresh_install             0 2012-08-21 19:06:12   00:00:00.000
mycomputer disks # 

The qemu-img command allows you to create, apply and delete snapshots.  As mentioned in a previous post, it is highly advised to shutdown your vm before taking/applying a snapshot.  The -c option is used to create a snapshot.  The -a option is used to apply a snapshot.  The -d option is used to delete a snapshot.  

More and more filesystems are starting to support copy-on-write features.

Wednesday, August 29, 2012

Sharing pictures and home movies with Retroshare

File sharing (and I don't mean illegal file sharing) can be tough in today's world.  I have a collection of pictures and home movies that I would like to share with friends and family.  Sure, there are websites like Facebook, and Dropbox that will allow you to share pictures/files, but Dropbox only gives you so much space.  Facebook downsizes your pictures.  I have 13GB's of family photos.   My brother has a really nice camera, and I would like to download some of his photos of family functions.

While searching for an answer, I stumbled upon Retroshare.  Retroshare is a peer-to-peer social media platform.  What does it mean to be peer-to-peer?  It means there is no central server.  Since there is no central server, then there is no body that can snoop on you.  There is no limit on how much can be shared.  Retroshare supports messaging, chat rooms and file sharing.  All communication is encrypted.  This is far more secure than I needed, but I'm not one to turn down extra security if its built in.

The extra security does have some drawbacks, however.  Encryption is built around GPG keys.  Every person generates their own public/private key pair.  To "friend" someone, you give them your public key, and they give you their public key.  Once keys are exchanged, you can connect to each other.  That part is what is a little confusing for many people.  Retroshare does a good job of walking you through the process, but it still uses the technical terms that make it very intimidating.  Only 1/3 of my friends and family that I tried to get connect actually set it up.  All of that 1/3 were technical people.  By technical, I don't mean software engineers.  By technical I mean they can install Windows from scratch.

File sharing is really easy.  You select what folders to share, and then all those files are available for your friends to download.  Retroshare also makes use of distributed technology.  If two people in my circle have the same exact file, and a third starts downloading it, then that person will download it from both people who have that file.  With such a small circle, we aren't talking about a big performance boost, but it is a novel feature.

The UPnp functionality to automatically set up port forwarding was a bit spotty.  My Gentoo server did not self-configure but my Gentoo laptop did.  One of the people in my circle uses the Windows client, and that did not set up port forwarding correctly.  This is another hurdle for non-technical people who fear the router.
The software does lack some features that would be pretty nice.  I want the ability to remotely control Retroshare.  If I'm on the road, and I am exchanging keys with a family member (most likely because I'm setting up Retroshare for them), I want to be able to import the keys remotely.  I want to be able to test the connectivity while I'm there.  The encrypted messaging and chat room feature is nice, but I tend to use my phone for that type of communication.  There currently isn't a mobile app available for the iPhone or Android.  Retroshare doesn't currently have classifications of friends.  Everyone you exchange keys with can see every file you have shared.  It would be nice to classify people into groups, then allow certain groups access to certain folders.

Overall, I am really excited about Retroshare.  It does have a long road ahead of it before the masses can start using it, but I think its good enough for my friends and family to share photos and home movies.  Once the software is set up, it is pretty user friendly.  If you don't mind configuring it on all your friends computers, then you might want to consider being an early adopter.



Tuesday, August 28, 2012

Maven is for building, not deploying

Writing software doesn't help you if you can't install it.  In a simple web environment, Maven works great.  It produced a war file (with every dependency in WEB-INF/lib).  Just drop that war into Tomcat and you are done.  What happens when you have a more complex setup?  Maybe Websphere with an aggregator pom for the jars that go into the Shared lib class loader level?  What about a batch application that is just a bag of jars?  Maven has a copy-dependencies goal that copies the dependencies of the pom file into a directory.  When you call that goal, you may notice something weird.  Why is junit.jar in the extract?  Oh, that's right.  Copy-dependencies ignores the scope tag of your dependencies.  All of your test and provided scoped dependencies are in your extract folder.

The next problem we notice is the lack of context with regards to your scope tags.  Why do you need a context?  Say we have a war file destined for Websphere.  To reduce our memory footprint, we exclude some jars that will be shared among the war files.  To exclude them, we declare the dependencies as 'provided' scoped.  From the context of the war file, those jars are provided by Websphere.  Let's assume we fixed the copy-dependencies problem from above.  Now, we extract the jars that are destined for Sharedlib.  Oh no!  All our jars are missing.  All the jars are marked as 'provided' so nothing was extracted.  From the context of the sharedlib pom, the jars are not 'provided'!  Now we start messing around with the extraction process and duplication of data in pom files.

All of these problems occur because Maven was designed as a build tool.  It has no concept of how to extract and deploy your code (other than a simple war or ear setup).

Monday, August 27, 2012

Complaints About Maven

The whole Java world seems to have embraced Maven as the future of building code.  I find this troubling.  I am not a fan of Maven.  I am not saying there is something out there right now that is better than Maven.  That doesn't mean I have to like it, though.  My hope is that what ever replaces Maven will solve some of my gripes with the technology.  I will be going further into my complaints in future blog posts.

Sunday, August 26, 2012

Glad to have a Samsung phone again

My Samsung Galaxy S had an unfortunate run in with the washing machine.  I had to borrow my friend's old iPhone for two weeks.  I was not happy.  I, unlike some Apple designers, can tell the difference between an Apple phone and a Samsung phone.

For starters, I like having a back button.  Androids have back buttons.  Windows phones have back buttons.  Non-smart phones have back buttons.  The B button of my N64 acted as a back button.  Is Apple so forward thinking that they don't need back buttons?  Just like they don't need a right-click on their mouse.
I like open standards.  Open standards make things cheaper and more flexible.  I like the fact that 5 of the last 7 phones that my wife and I have owned use the same charger.  Who would have thought that Motorola, Samsung and Research in Motion can invent the same exact technology.  O wait.  They didn't.  They used the USB standard.  What an interesting innovation.

Why does Apple have its own "data plan?". I am on AT&T.  I pay for a data plan.  Why is it that when I put my Sim card into an iPhone, I get a popup every once in a while complaining that I don't have a data plan.  Data is data.  Why is Apple special?  We are transmitting 1's and 0's.  Do they use 2's as well?
I am now a proud owner of a Samsung Galaxy S 2.  Yes, I know, the S 3 is out.  I tend to wait for the latest technology to come out so that I can by the older generation for much less.

Saturday, August 25, 2012

Gmail and a Home SMTP server

All of my computers have ssmtp installed.  This allows any program that uses the 'sendmail' command to send mail via the Gmail SMTP server to work.  I just have to put my Gmail credentials in the /etc/ssmtp/ssmtp.conf file.  Not all software uses the 'sendmail' command, however.  Some programs prefer to talk directly to an SMTP server.  This means I have to configure each program with my Gmail credentials.  I would prefer only having a single location to maintain those credentials, because I do change my Gmail password.  I decided to set up Postfix as my home SMTP server.

With Gentoo, I just run 'emerge postfix'.  Postfix gets installed and ssmtp gets uninstalled (since you can only have one sendmail command).  There is a handy Ubuntu guide on configuring Postfix to forward to Gmail.  There are a few differences in the guide between Ubuntu and Gentoo.  The sasl password file is /etc/postfix/saslpass, not /etc/postfix/sasl_passwd.  The Gentoo Postfix package does not contain a CA certs file.  In Gentoo, there is an app-misc/ca-certificates package that contains the CA certs for every application.  The certs file can be found at /etc/ssl/certs/cacert.org.pem.

From here on out, I can configure ssmtp on all my other computers to forward to my Postfix server.  I can also take my Gmail credentials out of my Jenkins server.