Archive for October, 2011

The Synology NAS, two months later

Saturday, October 29th, 2011

NAS time, again! Like before, I’m collecting my notes and thoughts all in one place.

Two months later

Why have 1 when you can have 2? After winning the GameTree prize, I decided I should have 2

So according to my blog here, I’ve been running the Synology NAS for just over 2 months now, and I still love it. Heck, I bought a 2nd one! The NAS has become a permanent part of my development setup, and even my development workflow. It sits in the corner and just works; What more do you want?

As mentioned in my earlier posts, I’m running both SVN and AppDailySales on it (iTunes Connect Sales Stat grabber). In addition, I’ve been running an internal wiki on it. I used to host 2 different external wikis, but both have been imported and archived locally.

I chose DokuWiki for my internal wiki because it uses flat files, meaning I don’t have to run SQL (though it is just a button to enable MySQL on the Synology). This has the added bonus that I can regularly commit the data to my SVN repository for extra redundancy (the Data and Media folders). On my TODO list is to add an automated task that commits wiki changes every morning, but hey, I decided to write this post instead. 😉

Here are are some of the more recent developments.

Moving Hiccups

Since I moved in to my new apartment, I’ve actually been having an issue with my NAS. AppDailySales, the python script I use to get my latest sales data, it wasn’t working. This required me to manually run my script to get sales data, but unfortunately, I’ve lost just shy of 3 weeks of sales data. Seeing how Smiles is a good 3 years old now, I’m not too bothered by the loss of daily data (weekly is still available), but it’s still a bit of a disappointment.

I’m not sure what compelled me, but I decided to investigate the connection problem today. Long story short, my DNS and Gateway settings were set wrong. Looking back, getting my network setup correctly was a real pain, so this doesn’t surprise me. My DSL modem apparently also acts like a router, so to get the two to play together nicely, I set my real router use a different IP (192.168.1.2 instead of 192.168.1.1). Silly NAS was set to “.1” instead of “.2”.

Part of that network config, I changed IP blocks from 192.168.0.x to 192.168.1.x, since that’s what my new router used. I had previously set static IP addresses for the NAS (.110), so I had to re-run the windows DSAssistant tool to change the IP block (an IP in 192.168.0.x cannot see an IP in 192.168.1.x, at least not with a subnet of 255.255.255.0).

Those were the only 2 issues introduced during my move. That’s not to say I didn’t find more ways to mess things up. 😀

Upgrading from DSM 3.1 to 3.2

About a month ago, Synology finally released the latest version of the OS for their devices. And not even a week ago, they released a bugfix for that. The changelog is extensive, including some improvements to features I’d like to start using, so today seemed a good day to update.

Updating was extremely easy. Since I started with 3.1, all I had to do was click the update button in the Control Panel. After it downloaded, just clicked install. Waited, and it was finished. Very nice.

But as expected, a few settings got messed up after updating. Nothing built in to the UI, but my cron job for running AppDailySales got removed from the /etc/crontab file. No problem, I wrote down what I did here in a blog post. THAT is why I’m writing this here now.

SVN seems to be still running properly. Nothing to do there. All my settings are still set. The wiki is still running. Great.

However, the EVIL Thumbnail generation processes are back! These eat up 100% of the CPU usage, doing pointless thumbnail generation. Ack!

But like before, this is easily fixed.

cd /usr/syno/etc/rc.d/
S77synomkthumbd.sh stop
S88synomkflvd.sh stop

But unlike my old notes, I have since found that renaming the files was not enough. The better solution is to move them out of the rc.d folder.

mkdir ../rc.d.I_REALLY_HATE_THUMBNAILS
mv S77synomkthumbd.sh ../rc.d.I_REALLY_HATE_THUMBNAILS
mv S88synomkflvd.sh ../rc.d.I_REALLY_HATE_THUMBNAILS

After waiting a while double checking “top”, I then saw a process fileindexd start up and eat my CPU. no problem.

S66fileindexd.sh stop

This one I did not remove from the folder, so it’ll certainly start up again once the NAS reboots. Thumbnails are useless to me, but file indexes I need to look in to. I don’t yet know if these file indexes are a Synology thing or a Linux thing.

That’s everything I’ve had to fix since upgrading.

Now, lets try out some new features!

Remote Backups

At long last, I finally set up remote backups on the device. I’m actually backing up my data 2 places:

  1. To the “other” NAS
  2. To Amazon S3

Both options are built-in to the device, you simply have to provide login credentials… oh, and one thing each.

  • On your “other” Synology NAS, you need to enable Network Backup mode (in the control panel).
  • On Amazon S3, you need to create a bucket to store the data.

I’m especially fond of the Amazon option, not only because it’s remote, but because it lets me experiment with Amazon AWS services. Amazon gives you a whole bunch of free data and services for 12 months, and if my math is correct, once those 12 months expire it’ll cost me less than $0.50 a month to host my 3 GB repository mirror. Not bad… Heck, that’s a bargain given what that data is worth to me (my whole biz relies on this).

Best I can tell, it only stores a single copy of each file on the backup destination (as it should), and only sends files that have changed. There is an optional addon extension called “Time Backup”, which as far as I can tell works just like Apple’s Time Machine. Time Backup only works with remote Synology devices, or attached external drives (no Amazon).

VPN

Remote access to my network, on an iPod

Now this very cool. For a while I was (figuratively) bashing my head against a wall trying to come up with a solution for accessing my SVN repository and wiki remotely. The repository was the tricky part, as the local PCs on my network tend to use the local Windows share name or the IP in the SVN url. Local IPs don’t exist outside your LAN foo!

So today I set up a VPN. This is an addon feature for the Synology that’s pretty great. I wont bother describing the setup, since it’s literally a checkbox and some minor configuration. I’m using PPTP, since it seems to be supported everywhere. It’s literally a feature of Windows, OSX, iOS, Android, and I would not be surprised if it worked on stock Ubuntu too (I have not checked as of this writing).

The only real work was opening the port on my router, and calling that work is pretty silly. After opening the port, I was able to access the VPN locally by using my IP. That wasn’t enough of a test for for me though, so I picked up my laptop and visited my parents to “borrow” their WIFI. Yep, worked great. Once connected, I can commit and checkout from my SVN repository, view my wiki, and even access devices on my network… all from far far away.

I figure I’ll only be using this when I’m out of town, or hanging/jamming at a friends place. Still, it perfectly solves my SVN problems, and gives me a bunch of nice features. My router easily lets me turn this off too, so I can keep my local network nice and secure in the off season.

Summary-ology

The Synology DS211j NAS – Easily the best $200 (+drives) I’ve spent in a long time.

Notes: Exporting .bullet data from Blender 2.5

Thursday, October 6th, 2011

Here’s some notes from my internal wiki.

How to export .bullet data from a Blender 2.5x scene (awfully close to 2.6 now ‘eh). This might be as of Blender 2.57, and should continue to work well in to 2.6x.

Exporting Bullet Data from Blender

Exporting Bullet Physics data from Blender is a pain in the ass. Plain and Simple. It *SHOULD* be a right click export, but no, it’s complicated.

1. Switch to Game Engine Mode (In the Title Bar, the default setting is “Blender Render”. Should be “Blender Game”).
2. Game Engine Mode changes the *Physics* Properties (bouncing ball)
* Make the Physics Type a “Rigid Body”
* Enable Collision Bounds, and pick a bounding volume type (boxes, hulls)
* To make compound objects, you need to treat one object as the parent, and check the compound buttons
* Under the *Object* Properties (tiny cube), Relations Parent can be used to identify oneself as a child of a parent
* Defining compound objects is required to make overlapping volumes that don’t affect each-other.
3. Change a pane to a *Logic Editor* (little red-ball joystick)
4. Add a “Keyboard” sensor, and set the key to the spacebar (for example… we’re binding the spacebar to an action)
5. Add a “Python” controller
6. Change a pane to a *Text Editor*
7. Hit + to create an instance (default name is “text”)
8. Paste the following script in to the text editor

9. Update the “Python” controller to use this script file
10. Drag a link between the Keyboard sensor and the python controller (see the little nodes between them)
11. If you haven’t already, save the .blend file. If you close Blender, then double click on the saved .blend file, it will change the current working directory of Blender. This is important, because the script above (with no path) saves the .bullet file to the working directory.
12. Finally, to generate the blend file, run the simulation (R key).
13. To export, while the simulation is running, push the spacebar.
14. The console will show the “Exporting…” message. If you don’t have a blender console, you can enable it under Help->Toggle Blender Console

Done. That’s the annoying way to export .bullet data from blender.

The reason for the complicated procedure is that the PhysicsConstraints and bge libraries are just not available in standard plugin scope. Right clicking and running the script, just not an option. So we need to enter a game instance, where all these helpful library instances exist (as otherwise you wouldn’t have physics).

Research conducted on October 6th, 2011, using Blender 2.59.

References

http://www.blender.org/documentation/blender_python_api_2_59_3/bpy.path.html

http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=6683&p=23315#p23315

http://wiki.blender.org/index.php/Doc:2.5/Manual