Endnote to BibDesk

I’m currently in the process of writing a thesis for my final year at university. Previously I have used Word & Endnote together for large reports. While I have nothing against Endnote, the same cannot be said for Word.

Hence this semester I decided to use LaTeX. Which has been absolutely amazing. The tricky thing I found was, that I had 20+ references in my Endnote library that i needed to convert to something that LaTeX understood.

On the Mac installation of LaTeX, BibDesk comes with it. I found this excellent guide to converting from Endnote library to BibDesk. It can be found here. Best of all, it requires no external programs or scripts to do the conversion.

Posted in Computers, LaTeX | Tagged , , , , , | Leave a comment

FTPS Setup On FreeNAS 7

Recently I’ve been trying to setup SFTP (FTP over SSH) on my FreeNAS 7 server. Its been an uphill struggle, and I basically gave up. It appears to have become much easier on FreeNAS 8.

So I gave up with SFTP and switched to FTPS, which is FTP using SSL/TLS. Its much easier to setup and I’m not going to go into to much detail. The trickiest bit is generating the Self Signed Certificate and Private Key.

The easiest way to generate the Certificate and Private Key on Mac OSX is to use OpenSSL. This is already installed on Snow Leopard, and is run from the command line.

The following command will generate a 1024 bit key:

openssl req -new -x509 -nodes -sha1 -days 365 -newkey rsa:1024 > ftps.cert

The certificate will be valid for 365 days from creation date. OpenSSL will generate the certificate called “freenas.cert” and a private key file called privkey.pem. You can now use these files in your FTPS configuration page by copying all the data in each file.

More details can be found here.

 

Posted in Computers | Tagged , , , , , , | Leave a comment

Galaxy Nexus, 4 months in…

Around four months ago, my iPhone 3GS was really starting to irritate me. Since the last couple of iOS updates, it had become a snail. Opening the messages app took a good 10 seconds, and overall the performance seemed to decline after every update.

My contract was up and I knew I wanted to switch to a better carrier. I’d been following the new Galaxy Nexus progress and wanted a phone I could customize a little bit more. All the reviews for the Galaxy Nexus where saying its the best smart phone on the market. So I decided to get one hoping that the reviewers were right…. Mostly, they weren’t. Here’s why.

The phone physically is pretty nice, accept for the lock button location! Ice Cream Sandwich is definitely the best iteration of Android. The user interface is intuitive, they finally hid the developer icon, and when the phones works I would agree with other reviewers about it being the best.

The problem is, the phone rarely works. This seems to be typical of a lot of Android devices. They can be wonderfully stable, or they can crash at the drop of a hat. I honestly believe that Samsung made the battery removable so that you can recover your device when it hangs. Now people will preach and say that it’s because of x app that you have installed. That maybe the case, but how am I meant to know that? Android should not be like this…

Before purchasing this phone, I knew that with Android devices the carrier often decides on when you get updates. This is not meant to be the case with the Nexus series devices. Well it is now. It’s been four months since I went on contract with Telstra, and ICS is up to version 4.0.3. I’m still on 4.0.1.

I feel like I’m part of a beta program, with how unstable this phone is. So I decided to root it and install a custom ROM to get me up to version 4.0.3. I went with the Code Name Android ROM. Which is very stable, and initially fixed most of my problems.

Alas, it now seems I’ve installed another app that isn’t compatible and am getting frequent crashes again…

Next time I’ll get an iPhone…

Posted in Android | Tagged , , , , | Leave a comment

iPad accessing computer via sFTP

I recently purchased an iPad and so far have been finding it really useful. At work I tend to need two screens, one usually has a datasheet open for the project I’m working on and the other has some the IDE open that I’m using for that project.

Initially I tried setting the iPad up as a second screen using an App such as iDisplay. This App works decently so long as your network works well. I do all my coding in a virtual machine, so the network performance is a bit average I’ve found. Thus the second screen created by iDisplay was sluggish and not usable. It did work a-lot better in Mac OSX.

I came up with a second (better) solution. By using sFTP to access my Mac via an App such as GoodReader. GoodReader is by far one of the best PDF readers I’ve ever used. Its full featured and worth every dollar! You could use FTP instead of sFTP, but in my opinion, if your going to be leaving a service open to accept connections to your PC/Mac then I would make it a secure one!

To setup sFTP, I recommend using the in built sFTP server within Mac OSX. I followed this guide. To make connecting to your sFTP network independent then use your computers name instead of an IP address.

If your like me and want to access the hard drive of a virtual machine, then I recommend mounting the virtual machines disk via the network. I wrote a guide on how to do that here.

 

Posted in Computers, Mac OSX, PC | Leave a comment

Making Finder clickable shell scripts

I was after a way to make a shell script execute when I double clicked on it in Finder. After a-lot of Googling and trial and error, I eventually came up with this method.

The script I’ll be demonstrating is a simple one I use to mount a my VMWare Fusion Virtual Machines C Drive in the /Volumes directory on my Mac.

The script is as follows:
#! /usr/bin/env sh
mkdir /Volumes/folder name
mount_smbfs //username:password@network location /Volumes/folder name

Simply fill in username, password, network location and the folder name. In my case, the network location was my virtual machine, chrisvm/C. The folder name was  chrisvm. I named the script mount_chrisvm.sh.

To make the above script executable via Finder, basically so its like a little application. Execute these commands:

mkdir -p mount_chrisvm.app/Contents/MacOS
mv mount_chrisvm.sh mount_chrisvm.app/Contents/MacOS/mount_chrisvm
chmod +x mount_chrisvm.app/Contents/MacOS/mount_chrisvm

The script should now run when you double click on it. This method has been tested on Snow Leopard, I believe it should work on all versons of Mac OSX. If it doesn’t, then please let me know!

 

Posted in Mac OSX | Leave a comment

Netbeans & Automatically Fixing Imports!

Currently I’m working on a project in Java SE, where I’m using the SAX XML parser. After reading some guides on the internet I got my head around it pretty quickly. In the process of experimenting, I discovered that I had picked up a bad habit from last semesters Enterprise Java class!

The bad habit, was whenever I needed to import a module in Netbeans, I would push CTRL+SHIFT+I, hence fixing imports. Then quickly push enter, and move on with the rest of my code. However, If your not careful you will import the wrong module and get no error!

Here I am using the SAX XML parser, to use it you must inherit DefaultHandler, and override the functions startElement(), characters(), endElement(), plus any others you want to use.

Here’s my startElement code:

After doing this, I then did fix all imports. Which of course added this to the top of my .java file:

import java.util.jar.Attributes;

Which is incorrect! Hence why there is no warning telling me that I need to add a @Override annotation to my startElement. This is because the prototype is technically different now. The fourth parameter is of different type, even though the name is the same! If you then did a parse on a XML file, you would find that startElement would not get called at all! You should be importing this:

import org.xml.sax.Attributes;

After adding the proper import, I now have this:

Notice how I have the @Override annotation, this is because the prototype now matches the inherited class DefaultHandler and Netbeans throws a warning without it! Hence why always taking the Fix Imports option can be dangerous if you don’t pay attention!

The code now works perfectly!

Posted in Java, Programming | Leave a comment

New Webspace

My previous web hosting plan was about to expire. I was previously with crazydomains. They are any Australian based host, and to say I was impressed with the service would be a pretty big lie.

Luckily I had been scouting out a new webhost for about 6 months now, and stumbled across Dreamhost. They seemed to offer competitive prices with some really nice features, such as Subversion, shell access, cheap VPS options and a bunch of other neat stuff. So I went with them and so far I have been very happy.

One of the challenges I was faced with though was migrating my page from one host to the other. I didn’t want to do a full copy and paste job. I wanted to do a fresh install of WordPress and then just copy the content. Silly me initially went the difficult route! Trying to copy the SQL database tables across, which is theoretically possible, but pretty tricky to do for the non SQL savvy type like me!

What I failed to realise was that the developers that made WordPress are pretty good at making difficult tasks like updates and the like easy to do. So they have of course incorporated and import/export feature into WordPress! Theres a simple guide on how to do it here!

Posted in Computers, Web | Leave a comment

Netbeans 6.9 and UML class modelling

This semester I’m studying Java 1, for one part of our latest assignment we had to create a UML diagram. This is usually very easy, however can be time consuming if you have alot of classes.

For this particular assignment I had 17 classes, all these classes had a lot of methods. To many to do manually!

I google’d if Netbeans could generate UML class diagrams, and it turned out it used to be able to in previous versions. However now its a plugin that is pretty tricky to find. I did find it, and got it to work!

The plugin is UML Modeler for Netbeans 6.9 (1616). Ive only tested this on Netbeans 6.9.

Installation Instructions:

  1. Extract the contents of the archive into your Netbeans installation directory.
  2. In your Netbeans directory you should now have a folder called UML.
  3. Restart or open Netbeans.
  4. To verify its working, try to create a new project. In the list of project types, there should be the option to create a UML project. If you have that option, then it is all working!

Usage:

  1. Open an existing Netbeans project.
  2. In the projects pane, right click on the project your working on and click Reverse Engineer.
  3. You will be presented with a window on what to reverse engineer. Choose only the source files and tell it to create a new UML project for you.
  4. It will tick away for a little while, then you should now have a new UML project in the projects pane on the left.
  5. The UML project should now be full of all the components your using.
  6. Expand your UML project, then expand the Model.
  7. You should have folders for each package thats in the Netbeans project you generated from. Example, I had one package called assign2, so i had one folder called assign2 in the UML project. Plus several other files that arent important.
  8. Right click this folder and choose Create Diagram From Selected Elements.
  9. Choose to create a Class Diagram, and push Finish.
  10. You might be prompted with a message saying: The selected element has one or more scoped elements. Do you want to include the scope elements on the diagram in addition to the selected element?
  11. Click Yes.
  12. You should now have a completed UML class diagram.

Notes:

  • The modeler does a good job of presenting the data, however it tends to push it to the right side of the window. Which wastes a lot of printing room. The only way i found to fix this, was to move every element manually to the middle. It seems the middle is the best place for printing.
  • I also couldn’t find a way to save the UML diagram as an image or a pdf. So I used Cute PDF Writer to do the job!
Posted in Computers, Java, Programming | 6 Comments

ESXi and Areca raid cards

Recently my home server got infected with a nasty virus. I was running Windows 2003 Server on it, and the virus got in through an out of date version of Firefox!

Basically there was a security flaw found in versions below Firefox 3.6.3 that allowed a Javascript file to run and infect your computer!

So after cracking a shit because i spent most of the day repairing the computer, i decided to format over the Windows 2k3 partition with ESXi. However there was some complications, which ill now go into in hope that someone else will find this useful!

My home server configuration is as follows:

  • Intel Q9400 quad core processor
  • 4GB DDR2 RAM
  • Gigabyte GA-G41M-E2SL motherboard
  • Areca ARC-1260ML raid card

Problem Number 1:

ESXi does not support Realtec 8111 network adapters, i think this has alot to do with the fact that Realtec network adapter’s arent that good! When installing there error wasn’t a particularly usefull one, it just halted and said VMFS3 Failure.

After some googling i found this meant that there wasnt a network adapter detected. So i went out and bought a Intel Pro 1000CT adapter and past the error!

Problem Number 2:

The next problem occurred after installation. My 4TB raid array on the Areca raid card was not appearing in the storage section of ESXi. After more googling and looking at the ESXi Hardware Compatibility List, i discovered that its not strictly supported. However, i found this ftp on the Areca site. Navigate yourself to VMware/”ESX Version Here”/.

In my case the final address was: ftp://ftp.areca.com.tw/RaidCards/AP_Drivers/VMware/ESXi_4.x/

Then i opened the folder with the version of the driver which was 1.20.00.15_100202 at the time of writing.

Open README.txt and follow the instructions for your version of ESX(i).

However for ESXi there is a catch (haven’t tried ESX). At the time of writing, the drivers will only install on ESXi 4.0. If you try to install them on ESXi 4.1 or greater then you receive this error:

“No matching bulletin or VIB was found in the metadata. No bulletin for this platform could be found. Nothing to do.”

More googling found me this website with a simple solution. To fix it, either follow the solution on that website or do what it says below:

Open the .zip file you downloaded from the Areca FTP, and navigate to the offline-bundle folder. Once your there open the metadata.xml file in any editor (notepad++ will do nicely).

Find this section of code:

<systemReqs>
<swPlatform locale=”" productLineID=”esx” version=
“4.0.0″ />
<swPlatform locale=”" productLineID=”embeddedEsx” version=
“4.0.0″ />
<maintenanceMode>true</maintenanceMode>
</systemReqs>

You should change the 4.0.0 in both the red locations to 4.1.0 or 4.* for broader support. Like this:

<systemReqs>
<swPlatform locale=”" productLineID=”esx” version=
“4.1.0″ />
<swPlatform locale=”" productLineID=”embeddedEsx” version=
“4.1.0″ />
<maintenanceMode>true</maintenanceMode>
</systemReqs>

Now save it, and try the instructions from the Areca website again and you should be golden!

Other than that, thats all the issues I’ve had so far! If you have more issues, then i would highly recommend the VMware community on the VMware website. The people on their are very useful!

Posted in Uncategorized | Leave a comment

Getting Battlefield Bad Company 2 to work!

So i finally got Battlefield Bad Company to work reliably as clock work. There are several things that should be done to get this game and Punkbuster to work well. My problem ended up being a bunch of stuff. It mainly all revolved around my virus scanner, and Punkbuster having many instances of its self spread through my computer.

These are the steps i took to make the game work from the get go:

1) Open required ports in router:
For my home network, i run Endian on an old Pentium 4 Media Centre PC. Endian is a great firewall/router. However for gamers it can be a slight pain since it by default blocks everything, and it doesnt support uPnP. Its easy enough to add outgoing firewall exceptions for it though. Ive allowed these ports through:

UDP/1050
UDP/2418
UDP/4355
UDP/11050:11070
UDP/18181:18186
UDP/19009
UDP/19567:19587
UDP/20867
UDP/18395
UDP/10000
UDP/20000
UDP/20050
UDP/20100
UDP/20150
UDP/20200
UDP/20250
UDP/20300
TCP/18181:18186
TCP/18390
TCP/18395
TCP/13505
TCP/10000
If you google ports to open for Battlefield Bad Company 2, you will find the list is actaully alot shorter. Yet if you look at the servers that you connect to, you will see that most of the ports the servers operate on, are in my list. So if you try to connect to some servers and it says cant connect then this will most likely be the reason.
TCP+UDP/27952
TCP+UDP/44301
TCP+UDP/45301
TCP+UDP/10002
These are for Punkbuster. I have set them to both TCP and UDP because i have no clue what Punkbuster does, and they dont tell you. Im to affraid to change it because it might break it!

You dont need to port forward these ports. Just open them up. If you have a basic Belkin, Linksys, Netgear etc then the you probably wont have to do any of this since they usually let anything through!
2) Add exceptions to Virus scanner:

This was the tricky part. Open a search dialog on your computer, and search for these items:

  • PnkBstrA.exe
  • PnkBstrB.exe
  • Directories named pb and punkbuster

For me, PnkBstrA and PnkBstrB where located in about 4 locations on my computer. So i added all 4 of them to the exception list of my virus scanner. I run Emsisofts Anti-Malware. So in my case i added all instances of both PnkBstrA.exe and PnkBstrB.exe to the whitelist. I found PnkBstrA.exe and PnkBstrB.exe in system32, sysWOW64, C:UsersUSERNAMEAppDataLocalPunkBusterBC2 and Steamsteamappscommonbattlefield bad company 2pb.

I found that there is a pb directory in the game’s directory and at “C:UsersUSERNAMEAppDataLocalPunkBusterBC2″. So i also added both of these directorys to my virus scanners whitelist.

I also added the directory “Steamsteamappscommonbattlefield bad company 2″ to the whitelist.

Emsisoft Anti-Malware also has a feature called Surf Protection. Which stops any application that looks “sus” connecting to the internet. So i added these rules to the Surf Protections exclusion list:

  • EA.COM
  • MASTER1.EVENBALANCE.COM to MASTER8.EVENBALANCE.COM
  • BC21.EVENBALANCE.COM
  • BC22.EVENBALANCE.COM

This list will vary from game to game that uses Punkbuster. If you go to the pb directory in the games install location, and open pbsec.htm it will have a list of the hosts its going to try connect to.

3) Allow Punkbuster through your firewall:

Punkbuster will try allow itself through the Windows Firewall but sometimes wont work. So i recommend that you check PnkBstrA.exe and PnkBstrB.exe are allowed.

4) Fixing annoying respawn delay after you click “ENTER” in the game:

This is a bug/poor programming in the game. Whenever you click “ENTER” to respawn in the game, it reads the files located in this directory:

C:UsersUSERNAMEDocumentsBFBC2

If you have a virus scanner that has scans any file that is read/written/executed (Real Time Protection) then you will most likely experience this delay.

In Emsisoft Anti-Malware i had to turn off the onAccess virus scanning feature, i set it to onExecution instead. For other virus scanners, you need to add this directory to its exception list so files within the directory dont get scanned. Its a big oversight by the game developers, that good beta testing would have picked up!

I hope this helps someone, because it was a massive pain in the ass to get working! But now that it is working, I’m enjoying the game alot :) .

Cheers

Chris!

Posted in Computers, Games, Tutorials | Leave a comment