Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Monday, 29 March 2010

FreeNAS Magic Sauce: Getting Transmission to play nice with Samba

I love my FreeNAS setup. I can download torrents on it faster than with my Windows boxes and it's about as close to "set it and forget it" as it gets. Love it.
I did have one problem though. From some reason transmission got in the habit of downloading files with permissions that let me read them but not write or modify. It would get worse if I tried to move them around via Samba.
As I'm not keen on running scripts to constantly do the same thing (like reset permissions) over and over again with little regard for what they're doing I found another solution. Tell Samba how to behave!
Adding these commands to the "Auxillary Parameters" of the CIFS/SMB config will make all your problems go away. Is it secure? Probably not. Is my network secure? Yes. Good.
force group = wheel
force user = transmission
Bounce the service and you'll never have permission problems again! :)

Wednesday, 20 January 2010

A Word About Backups At Home

I just posted this on a Subaru message forum (off topic section) because people were discussing backups and I couldn't deal with all the bad info. I thought I'd repost it here for posterity. Note that this is STRICTLY for home setups and has nothing to do with SQL backups and what you should be doing at work! ;)

1. - Know Your Limits
If you barely manage with Windows and have an ongoing problem with spyware/malware/viruses stop reading now. Go buy something from DLINK or Linksys, or whoever. You do not have the skills to build and maintain anything more robust and you'll need support. This will cost you a lot more money and you'll get less flexibility, but it'll be easy to use.
If you are an average to above average Windows or Linux user you can probably risk trying out some of the stuff I'll describe below.
If you're an expert Windows or Linux user you should already know this stuff.
If you're a mac user go overpay for something stylish then tell us all how much better it is and you are. Or suck it up and follow along below

2. - Identify Your Goals
You can waste plenty of time and money if you don't know what you NEED to do. You may WANT to backup everything you have in real time, but do you NEED to?
How much data can you afford to lose? How often is the data changing?
For example a normal computer user probably adds a few bookmarks, downloads a few shows, songs, imports some pictures from their camera, etc. each day or so. Maybe a weekly backup of a few directories/files would fit your needs. Maybe you need something to keep entire volumes in sync. Think about it, make a decision, then move on.

3. - Know Your Options
Options range from really easy & cheap, to very expensive and complex.
On the low end of the scale you've got USB attached storage. Maybe it's a HD or solid state device. Maybe it's an entry level RAID or JBOD.
In the middle you've got more advanced attached disk setups through eSATA, USB, or even network attached.
On the high end you've got custom built servers that do nothing but share files.
On the extreme high end you've got true NAS appliances from vendors like NetApp. If you know what these are you shouldn't be reading this!

4. - Know What Causes Problems
People. Hardware failures. Software glitches.
Most often at home you lose data because a hard drive dies, a CD or DVD degrades, or something else happens like your DLINK media server mainboard fries.
How do you prevent these things? REDUNDANCY!!!
That's it. Multiple copies of things in different places is the only way to guarantee it survives. I laugh at the people who throw a couple disks in a box and mirror them (RAID 1), then go on to brag about how they'll never, ever lose data. What happens when the RAID controller dies a few years down the road? What happens when you get a virus that overwrites all the data? What happens when they stop making the identical drive you need so the el-cheapo RAID controller will agree to rebuild your array? Or what about when little Johnny decides to try installing a new Linux partition over your Windows 7 setup? Yep; total data loss.
If you're doing something as simple as say once a week copying or auto-syncing say your "My Documents" and "My Pictures" folders (sorry Linux folks) to a USB drive you've just prevented total data loss for about $100 in hardware. Congrats!
That being said... if you CAN accept that you *might* lose all your data if X,Y,Z unlikely things happen then a simple RAID 1 setup could be all you need.

5. - Identify What You Want To Backup
Backing up everything is an option, but do you need to do it? Probably not. Identify all the things you can't lose and ensure they're safe. For me this is things like documents, movies, music, pictures, and code.

6. Pros & Cons
Everything you coudl possibly choose has pros and cons... I'll try to go over the most popular.
a) CDs & DVDs
-pro- cheap
-con- don't hold much data
-con- very labour intensive to use
-con- don't last too long
b)Hardware RAID 1/ RAID 10 (1+0, stripe + mirror, etc)
-pro- pretty cheap
-pro- most motherboards have this now
-pro- braindead easy to get disk level redundancy
-pro- disks last longer than CD/DVDs, but not as long as solid state devices.. solid state is still very expensive
-con- no redundancy of RAID controller (typically)
-con- typically need identical disks
-con- can lose all data to stupid mistake (blow away partition) or virus/corruption
-con- always possible driver issues
-con- might not be able to move RAID disks to new HW and have them recongized
c)Software RAID
-pro- probably pretty cheap or free with OS
-pro- very easy to use
-con- can lose all data to stupid mistake (blow away partition) or virus/corruption
-con- may not be portable/easy to upgrade
-con- performance hit
d)USB devices (single disk)
-pro- pretty cheap
-pro- very portable
-pro- no lock in to hardware, OS, manufacturer
-con- may need software to automate backups
-con- can fail pretty randomly
-con- performance is limited
d)Vendor Device (DLINK, Linksys, etc.)
-pro- very easy to use
-pro- often has HW RAID and funky GUIs, maybe even backup software
-con- often very expensive for what you get
-con- locked into the vendor
-con- when the HW fails it's unlikely you can fix it
-con- BUGS!! & hassle of firmware updates
-con- proprietary disk RAID setups
-con- often limit the size of disks you can use
-con- software included can sometimes be utter garbage
-con- may not work with all OSs
e)FreeNAS/Linux/Windows Home Server
-pro- Very robust, very flexible solution
-pro- Easy to work with (depending on skill level)
-pro- Commodity hardware can be used, purchased, upgraded
-con- Can become expensive
-con- Need decent computer skills
-con- Uses more space & power than other setups
-con- May not include anything to help you automate backups
-con- Need to stay on top of patching

Once you work through all of this you should have a good idea of what you need, what you need to backup, and hopefully have an idea of how you can back it up.
To help out a bit more I'll detail my setup...
I have two laptops, two PCs, a BlackBerry, and a wired home network + wireless access to it. I run Windows Xp, Windows 7, and Ubuntu. I want all my devices to be able to access music, pictures, and I want each device to have certain things like documents backed up. Securty of all this is a totally different matter...
My largest risk exposure is to fire. In the event of a fire I would lose everything because I'm not moving my data off site... it's too damn expensive and I don't trust online providers enough. At some point I'll look at getting a fireproof safe and then backing things up to external storage on a regular basis and putting the backups in there.
Aaaaaanyways...
My backup solution is an older P4 box with a few TB drives in it running FreeNAS. I use software RAID to protect against disk failure and RAID hardware failure and the performance is more than good enough. FreeNAS itself runs off a free 128MB USB stick I got and I've got another copy of it in case anything happens to it. If the computer did die I could easily slap the drives into any other FreeNAS box or even a linux box that reads UFS formatted disks and I'd be able to recover my data. That's really good.
On some PCs I have specific folders set to stay in constant sync with FreeNAS, while others do it on a schedule. Everything is enabled to "work offline" if FreeNAS wasn't available meaning I've got at least two distinct copies of my data. Total cost if you were to build this thing new is about $300-$600+ depending on the number and costs of disks you put in it. Go as cheap as you can on CPU.

So there y'all go. One REALLY long post about backups. You should be good-to-go now.

Cheers!

Tuesday, 21 July 2009

Lenovo T61 + OCZ Solid Series 64GB SSD = No Love

I picked up an SSD on sale for $105 Saturday and I'll be returning it tomorrow. What a pile of crap.
First off the T61 doesn't even recognize the thing... BIOS update fixed that.
Then there are HUGE problems just trying to get the damn thing to seat properly in the HD bay and not throw a 2100 error. Finally solved that with some by not using the drive caddy and using the just the rubber ends, then wiggling just right until it seated in the SATA connections.
Then I find out that the T61 doesn't support SATA II.
Then I find out the SSD doesn't support AHCI.
Then I finally get all the tweaks done, mount the drive in another computer, track align @ the 4k boundary, format, get rolling with the XP install on the laptop and... NOTHING.
A blinking cursor in the upper left after the first reboot. Awesome.
Tried to fixboot, fixmbr, etc. No dice.

I'm done. The whole plan was to use this as a quick swap for use in the car (while tuning) to avoid issues with bumps and to ensure my original HD could be encrypted and thus used for work only; all personal use = SSD HD.
I suspect it's a partition issue and could be resolved but after all this I've got a sour taste in my mouth and this just isn't worth it. For a few hundred dollars more I could get a very decent NetBook and enjoy all the advantages that brings.

Oh well, nice idea but it just didn't work out... Shocking how many problems there were.

Saturday, 9 May 2009

Fish-Cam is GO!

I recently made a nice little to-do list on my fridge with a dry erase marker I've had since university. It doesn't judge me; you shouldn't either.
..anyways I've made some very good progress on said project and have now officially kicked off my "Fish-Cam" project. It is essentially a budget/DIY version of this or this.
I decided to use a portable DVD player instead of a stand-alone mini-LCD or *gasp* a mini-CRT. The main reasons for this decision are:
  • Cost. A portable DVD player is ~$80 - $180 CAD right now. Mini LCDs are $110+
  • Design. Portable DVD players are meant for lugging around. Mini LCDs are really meant to be mounted somewhere.
  • Features. A Mini-LCD is useless on it's own. A portable DVD player plays DVDs, mp3s, etc.
  • Availability. Wal-Mart had plenty of portable DVD players. Only a few shops have mini LCDs... and questionable return policies if things don't work!
I've also picked up a B&W (I can upgrade to colour if this works well) CMOS security camera with 6 IR LEDs on it for $29 CAD. It comes with 60ft of cable so all I need to do now is get some PVC tube and acrylic that I can mount the camera in. Then the Fish-Cam will be complete!

Review: Portable DVD Players (RCA DRC6338 & Toshiba SD-P70S)

As part of my Fish-Cam project I decided that I'd look at purchasing a portable DVD player to use as the monitor. So I went over to Wal-Mart and picked out the RCA DRC6338 8" portable DVD player because it was on sale and had an 8" screen. What a mistake! Luckily upon return of that unit I picked up the Toshiba SDP70S and was very pleased.
Here are my reviews...


RCA DRC6338

Cost - $119 CAD
Features - Car charger, wall charger, built-in battery, 8" screen, audio/video inputs & outputs, remote
Review - Crap. It has a cheap feel, doesn't include the special cable you'll need for av i/o, and didn't work with my video input source at all. It also lacks the ability to output digital audio (not that I care). Even worse; you can't use the device and charge it at the same time! Really poor design.
This unit went back as soon as it failed to display my video input source.

Toshiba SD-P70S
Cost - $98 CAD
Features - Car charger, wall charger, external battery, 7" screen, a/v in & out, remote
Review - Excellent. It feels well built and the packaging is many times better than the RCA. It also INCLUDES the special a/v input cord you'll need and does do digital output. It worked right away with my video input source and I didn't even have the battery plugged in to the unit. This is great as I plan to run this 100% from a 12V battery as part of the fish-cam and I don't want to worry about battery life at all. The unit CAN charge and play at the same time.
Although it does have 1" less viewable space I'd consider this unit superior to the RCA. The fact that it includes the a/v cables makes up for the screen size IMHO.

Sunday, 3 May 2009

Roomba Scheduling App Released (SerialBandit)

I spent some time writing an application that will communicate with a 5XX series Roomba (I have a 530) via RS232 (COMM Port or Serial Port) from your computer. The main goal was to let me setup my Roomba to clean at specific times (cleaning schedule). You can buy a device from iRobot that will let you do this remotely, but not for my version of Roomba (or below in the 500-series).
I couldn't find any apps that worked reliably and did what I was looking for so I wrote my own.
I'll include a few pictures of the setup, but essentially it's the standard Serial Port -> MAX232 -> Roomba setup. You can get further instructions here if you need them.
The application is up on CodePlex here. You can download the compiled app on the "Downloads" tab. :)

Picture below show...
  • Quick shot of the interface
  • The Roomba serial port connector I made (A 6 pin mini DIN with the key removed, connected to Cat5e cable)
  • The Roomba plugged in to the serial adapter
  • The PC -> Roomba Converter on breadboard
  • The schematic I used. 100% Credit on the schematic goes to Tod E. Kurt




































Leave comments here for support.
Cheers!

**UPDATE 1**
I've posted my announcement on RobotReviews.com (here)
**UPDATE 2**
Apparently 2 posts with details of this app is "spamming the boards". Oh well. :p