CrashPlan on a Synology DS214play

I recently decided to upgrade to a full NAS after years of fooling around with external drives and NAS-lite hardware.  It used to be that I was afraid of the cost, but now with two kids and a demanding job, I realize that the most important resource I have is time.  Anything I can do to preserve my time is worth an investment.

Most recently I’ve been very concerned about a nasty new class of viruses called ransomware which block access to your computer’s data, and then offer you the key for a fee. CryptoLocker, which targets Windows and (ironically Synology systems) encrypts your data and with encryption that experts consider it practically impossible to break using brute force attack methods.

Given that CryptoLocker does its damage silently, if your backup solution does not keep versions of old backups or if it is possible for this virus to encrypt your backup, I decided that an offsite paid solution, such as CrashPlan ($60/yr), would be my solution.

I stumbled across an blog post from Scott Hanselman, Microsoft Evangelist, who posted instructions for installing CrashPlan on a Synology 1511+ NAS based on a set of packages and instructions from an enthusiast who goes by the name PCLoadLetter.

I ended up purchasing a Synology DS214play and 3TB Hitachi NAS internal hard drive from newegg (~$530).

For those of you who are looking to do this, I ended up following a post by Mike Tabor to get CrashPlan working on my NAS.  The upload of 260 GB of photos and images took about 9 days to complete.

That’s all for now, but in the future I might post about:

  • Selection of CrashPlan over BackBlaze or DropBox
  • Selection of a Hitachi Drive
  • Selection of Synology DS214play vs QNap vs desktop vs other NAS
  • Synology Unboxing, screenshots of the setup
Posted in Uncategorized | Comments Off

Eclipse Dark Theme in 20 minutes

I needed a dark theme for eclipse which would give Eclipse a refreshed appearance and would help reduce eye fatigue.  Some of the new IDE’s (e.g. Sublime, Atom) come standard with dark themes.

Using the reference below, I set this up about two years ago.  Since then, Eclipse has pulled in some of the resources into its source and tweaked it a little.

1. Set up the IDE chrome and windows to a dark theme.

Window -> Preference -> General -> Appearance -> Theme -> Dark

2. Set up the code editors with a dark theme

2a. install Eclipse Color Theme through the Eclipse Marketplace
2b. select a new theme from the menu
Window -> Preference -> General -> Appearance -> Color Theme

3. Optionally download additional themes from http://eclipsecolorthemes.org/

EclipseDarkWithSolarized

References:

http://stackoverflow.com/questions/5053834/eclipse-ide-for-java-full-dark-theme

http://ethanschoonover.com/solarized

Notes:

one thing that didn’t work was installing the Moonrise theme and then applying an Eclipse Color Theme.  The background of the code editor took the black background and only when a line was selected did it take on the expected background color.

Posted in Eclipse, EclipsePlugins | Comments Off

WinMerge and P4Merge integration into Subclipse on Windows

Subclipse diff and merge tools in Eclipse are okay to start with, but there are better tools on the market.  Seeing as how Subversion is a repository system, this understandable, so thank god they’ve provided integration points.

I prefer WinMerge as my diff tool and Perforce as my merge tool.

The following tips illustrate how you integrate these tools with Subclipse module in Eclipse.

In Eclipse, edit the Preferences by going to Window ➔ Preferences ➔ Team ➔ SVN ➔ Diff Viewer.

Click “Add” fill out the fields as shown below:

Extension: *

Diff

Path: C:\Program Files (x86)\WinMerge\WinMergeU.exe
Arguments: -e -x -u "${base}" "${mine}"

Merge

Path: C:\Program Files\Perforce\p4merge.exe
Arguments: "${base}" "${theirs}" "${mine}" "${merged}"

Here is an alternate solution using Perforce only

Posted in Eclipse, Tools | Comments Off

Reconfigure the port on IIS website

If we wanted to have multiple ports available for a website, we need to configure the IIS configuration as well as the Windows firewall.

First we want to configure IIS to listen on different or additional ports:

in IIS, go to the Sites folder and select the website you wish to configure.  Right click and select “Bindings”.  Add or Edit more Bindings (ports to listen to).

 

in the Windows Firewall, you may need to configure to allow incoming connections.  Go to the “Windows Firewall with Advanced Security” and select “Inbound Rules”.  Create a “New Rule”, for TCP, on “specific ports”.  You may wish to set “Profiles” to a mix of “Domain” “Private” and “Public”.  In my working example, I selected all of the available choices.

Posted in IIS, Networking | Comments Off

Setup domain name resolution without a DNS server

One of my goals was to set up an intranet site that is convenient to access and navigate to.  Ordinarily, I would pop open a hole in the computer’s firewall on port 80 and navigate to the site using the ip address, e.g. http://192.168.0.199.

 

Although this is nice, it would be even better if we had name resolution, e.g. http://COMPUTERNAME

There are a few options available.  We could get a DNS server / service running with Windows Server or run a DNS Server (Linux or Windows application).  Of the Windows applications there are two applications that are available: BIND for Windows, and MaraDNS.

I found that BIND was just too complicated for what I was looking for.  There were multiple config files to edit, and I had a feeling that it could be done simpler.  MaraDNS was easy to setup, but I didn’t like the idea that I was setting up my router to use the MaraDNS instance as the DNS server.  It seemed too invasive for me.

The last resort is always available: editing the hosts file.  The big downside to this approach is that it doesn’t scale well and is fragile.  You have to configure each computer on the network this way.

The best way I’ve found is to use features of the router.  I own a DIR-655 which is able to simulate some DNS server features.

Under Setup -> Network Settings -> DHCP Reservations List.   In this list, I’ve configured to use the actual computer name.  I’m not sure if this matters or not.

After doing this, I am able to ping and navigate to the server with http://COMPUTERNAME/

 

Posted in IIS, Networking | Comments Off

Why do we have immutable types?

In Java and .NET, there are some data instances which are known as “immutable”.  It is similar to const in C++ but there are some differences.

 

What does it mean to be “immutable”?

An immutable object is an object whose state does not change once created.  For example, you could create an immutable class by defining a class with getters but no setters (readonly properties).

Strings are immutable.  A reference to the string allows us to find the storage of the string in memory, but this storage space is never reallocated again.  As  a result, our storage space only needs to be as large as the data being stored.

 

Reasons for having immutable data.

There are many reasons for having immutable data types.

The key reason that keeps coming up is that the use of immutables simplifies concurrent programming.  Because it is difficult to synchronize access to shared resources, it is hard to guarantee there will not be race conditions between multiple reads and writes.

Some side benefits include the fact that immutables always work the same, regardless of the environment that they are used in.  This is partially due to the fact that since the data cannot be changed, we always know what state the data is in, and that we always know that the value that they have can be trusted.

In addition, immutable data is faster to read and create instances of.  There are no locks and there is no synchronization needed.  In addition, compiler optimizations streamline use and creation.

There is one special case: immutable strings.   The fact that strings are immutable has many effects.  For one, a programmer will never have a race condition because of a corrupted string.  For these same reasons, strings make great hash keys because of their immutability.

James Gosling, in an interview with JavaWorld, recalled that there was one scenario in particular that told Java designers that strings should be immutable.  In the case of opening a file, there are all kinds of security and authentication checks that occur.  If strings were mutable, then it could be possible that a string could be changed after security was checked but before the actual OS calls were made.

 

 

 

Posted in Uncategorized | Comments Off

Java decompiler: JadClipse

Coming from the .NET world, you take for granted the awesome integration that Microsoft has built in. In addition to that, there is a rich environment of plugins and tools that support development (let’s face it: toys). And coming from the the philosophy that the guy with the most toys wins.. eventually you’d have to expect that I’d start looking for toys in the Java stack as well.

That brings us to today’s toy: JadClipse.

What is it?

(From the JadClipse main page) Normally, when opening a class file the Class File Viewer will show a brief API outline of the class. If you install this plug-in, however, the Class File Viewer will be replaced with the JadClipse Class File Viewer that shows the decompiled source of the class.

 

How do I install it?

Installation was a piece of cake.

  1. Download Jad.  I grabbed “Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform“.
  2. Download JadClipse. I grabbed “net.sf.jadclipse_3.3.0.jar” for Eclipse 3.3
  3. Put the JadClipse JAR file into the plugins folder of your Eclipse installation.
  4. In Eclipse: File -> Restart
  5. Copied Jad to Program Files and edited the Environment variable “Path” so that Jad would be in the path.
  6. In Eclipse, configure the Jad Path: Window -> Preferences -> Java -> JadClipse -> Path to Decompiler
  7. Go to Window -> Preferences… -> General -> Editors -> File Associations and make sure that the JadClipse Class File Viewer has the default file association for*.class files with no source code.  Remove the existing association.

How did you find it, and are there other tools to explore?

I found it by starting with a simple google search: “java eclipse plugins must have”. That led me to a post on StackOverflow, and a few other interesting posts. Jadclipse was near the top suggested items on StackOverflow, and was mentioned on a few other sites as well.  Check the StackOverflow post: “What is the single best free Eclipse plugin for a Java developer” for other suggestions.

Posted in Uncategorized | Comments Off

Spring MVC for Java: Step by Step setup

I recently went through the “Step by step” experience published by Spring MVC to help users get a feel for writing a Spring MVC app.  I was very impressed by the documentation, which left out very few details.  Unlike some tutorials which leave out some really critical steps, the Spring MVC step by step tutorial never had me stuck for more than a few minutes.

There were some details which took me a little time to figure out.  For one thing, they don’t cover stepping through code on the Tomcat server, so when setting up my environment, I grabbed the wrong versions.

1. You’ll need a copy of the Eclipse IDE for Java EE Developers.  I had the “Java Developers” edition installed so when I needed to debug and step through code, I had to do a little troubleshooting.  I went with Eclipse Indigo.

2.  They don’t specify which Tomcat version.  I went with 6.0.35.  You’ll want to grab the application version, look for the 32 or 64 bit “Windows zip” version.  Instead of installing Tomcat as a service, you’ll run the startup.bat file in the bin directory each time you want to use Tomcat.

3. They don’t specify how to install ant and where to download it from.  I downloaded ant 1.8.2 and followed the instructions that I found off google.  Two notes about those instructions to get this working on my Win7 machine:

  • You create 2 new environment variables:
    • ANT_HOME == D:\ant
    • JAVA_HOME == C:\Program Files\Java\jdk1.7.0_02
  • Edit the Path variable to have the following:
    • %JAVA_HOME%\bin;%ANT_HOME%\bin

4. The other thing that is important is that when following the tutorial, it is extremely important to get the 2.5.0 release with dependencies.  I ended up grabbing 2.5.0 RC2. It appears that these dependencies changed over time and were not released with later versions of the distribution.  With version 2.5.0, you can be sure that all of the dependencies needed (logging, jstl, etc) are conveniently located in your download.

 

Once you have all of these dependencies, you are ready to follow along with the tutorial.

Posted in Uncategorized | Comments Off

Deploying an ASP MVC 3 app to Win7

I’ve been trying to run a simple ASP MVC 3 application deployed to my local machine (localhost) and run into quite a few little gotchas.

Here’s how to do it:

Download and install ASP MVC 3

Create an MVC3 Hello World App in Visual Studio

Install IIS from the “Windows Features” / “Turn Windows features on or off” in Windows.

Next, you need to configure a website in IIS.  I created one on port 81.  Open IIS Manager, and “Add a Website” to the “Sites” node.

For this website, I created this on D:\WebSite, and configured it to run on DefaultAppPool, configured for .NET 4.0, on port 81.

Most of the time, IIS is installed after installing the .NET Framework, so you’ll need to run some commands to register ASP.NET on IIS.

start cmd.exe as an administrator and run aspnet_regiis -i in C:\Windows\Microsoft.NET\Framework64\v4.0.30319

 

Initially, I had some trouble publishing the project to the destination but for whatever reason, Publish method: “FTP” to Target Location “D:\WebSite” seems to work quite well and publish only the minimum required files.

 

 

Posted in Uncategorized | Comments Off

Running Android on the HTC Touch Pro2, for Sprint SERO users

If you’ve got the Sprint SERO plan, you know that the newest, coolest phones aren’t available on our plan.  With the release of the iPad, the EVO, the 4G iPhone, my Treo is looking distinctly ancient. 
If you haven’t heard of the SERO plan, it’s $30 for 500 minutes, unlimited text messaging, and unlimited data. After taxes and surcharges, $37.  Still, with it’s dated OS (WinMo 5.0, released 2005) and IE combination, my old Treo is only capable of running the WinMo edition of Google maps, and checking email.  There is no java runtime available, so OperaMini is not an option as a web browser.
The mission: Find a phone that will run on the SERO plan, has a modern operating system and browser, AND allows me to tether.
After browsing SERO forums, I came across reports that there was an effort to get Android running on some HTC phones, including the HTC Touch Pro2.
HTC-Touch-PRO-2
htc_touch_pro2

The HTC Touch Pro2 is a great Windows Mobile phone issued by Sprint.  CNET rated it 4 out of 5 stars.  
Here’s a comparison of the two phones.

Palm Treo 700wx HTC Touch Pro2
Screen Size 2.5” 3.6”
Screen Resolution 240×240 800×480
Weight 6.30oz 6.3oz
OS WinMo 5.0 WinMo 6.1
Processor 312 MHz Intel XScale PXA272 Qualcomm MSM7200A, 528 MHz
Release Date late 2006 May 2009

The most obvious problem I see in upgrading is that the phone is not much smaller; both are 6.3 oz. 
What do we know so far?
Development is advanced enough to show video of the work:

The Rhodium device (CDMA Touch Pro 2, on Sprint) has a lot of the basics working (phone calls, data, speaker phone) but has a few glaring gaps:

  • BlueTooth
  • Sound (sound for calls work; no ringtones /music)
  • Camera
  • Hardware enabled graphics rendering
  • Battery Meter

While it appears that users are reporting that the OS is reasonably stable, there are still a lot off hacks (“on some devices you may have to remove the SIM card to enable data”).   On the other hand, it appears that the community that has risen around the device is helpful, and commenters are polite and respectful.  In addition, if you’re not ready to take the plunge, by going all Android, you can still dual boot the phone between WinMo and Android, using the haret utility.
I’ll keep watching the forums, but for now I’m going to stay on the sidelines.  It bothers me that there are still a lot of people with glitchy setups that can only be resolved by hours of tinkering, and even after resolving those issues, there are still several key features (listed above) that haven’t been enabled.  For $200(CraigsList), it’s too large of a money and time investment than I’m willing to make right now.

References:

Posted in Uncategorized | Comments Off