Space Efficient Mysqldump Backups Using Incremental Patches

Update 2015-08-18: Boy do I feel silly! It turns out there’s a much simpler and much more robust way of doing what I’ve done with the scripts below. It turns out that, using any revision control system (eg. cvs, git, svn) that stores revisions as deltas (and most if not all do), all you need to do is copy anything into a revision control repository and commit it. Tada! The rcs takes care of the incremental part for you by its use of revision deltas (ie. patches). As a big fan of git I was hoping there was a way for it to fill this role. I had mistakenly thought that git stores whole files without diffs/deltas for every revision. This is true until git garbage collects as I found out with my Stack Overflow question: Can git use patch/diff based storage? There’s some great reading there, check it out. Simply garbage collect after adding and committing in git and you automatically get space efficient incremental backups with the bonus of the robustness and reliability of git (or whatever rcs you choose). Bonus: You can delta anything you can store in an rcs repository meaning files, binary or text, archives, images, etc. You still get the space savings! So, quite literally, my database backup is now something like this: (1) mysql dump, (2) git add dump, (3) git commit dump, (4) git gc. Simple, powerful, elegant, beautiful. As it should be!

Space Efficient Mysqldump Backups Using Incremental Patches

I’m now using Duplicity for super convenient one-liner style incremental backup commands in a simple shell script (seriously, it’s like three commands long) but what I’m missing is incremental space-savings on my database dump. Right now my mysqldump produces about a 40MB file, about 10MB compressed. It’s irked me for some time that there’s no simple way to do intra-file incremental backups. I’ve also wanted to do intra-day, not just daily, backups. Duplicity’s incremental backups allow for that but full database backups add up quickly. Well, I finally went ahead and wrote a shell script to do it and a recover script that can recover to any date in the series of backups – just like duplicity. The key was interdiff for incremental patches. Here’s how I did it…

Continue reading “Space Efficient Mysqldump Backups Using Incremental Patches”

SimXperience AccuForce Pro Steering System

Update 2018-09-28: Published a new post, Secrets of the SimXperience AccuForce Pro, in my Secrets series where I’ll be recording the less obvious/less intuitive discoveries and tips and tricks with the AccuForce and SimCommander. I’ll be putting AccuForce Game-specific content over there from now on.

Update 2018-02-24 – 2: Added Tips and Tricks > AccuForce causing spurious inputs / Inability to assign controls in-game due to spurious inputs section detailing a fix if your AccuForce is causing spurious inputs.

Update 2018-02-24: Organized with a Table of Contents.

Update 2016-11-15: My latest R3E settings, including the November 2016 update, are over at my RaceRoom Racing Experience Force Feedback Settings post.

Update 2016-06-10: Updated Assetto Corsa FFB settings a little.

Update 2016-03-31: After the R3E update, I was getting a constant vibration in the wheel that tracked the cars speed (not engine rpm). People said to zero Slip Effect in-game but that wasn’t working for me. I eventually created a brand new R3E controller profile in-game and then compared to my previous profile. I noticed some differences like “FFB steer vibe freq mult=0” (and related values). Once I synchronized those I changed Slip Effect to zero in-game and that solved it.

Update 2016-03-08: Clarified certain language after time and reflection per the Closing Thoughts section. Filled in some sections that were still left undone.

Update 2016-02-19: Updated R3E section to sync with update notes. Added Assetto Corsa and rFactor place-holder sections for now. I plan to add more as I setup those games to work nicely with the AccuForce.

Update 2016-01-12: Added Suggestions for Improvements section.

Update 2016-01-01 – 3: Continuing my RaceRoom Racing Experimence experimentation (see updates below) I have been trying different cars with the settings I came up with earlier. I’ve run the Cadillac CTS V.R, BMW M4 DTM 2014, and the Aquila CR1, all at Brands Hatch Indy. They all felt really great except the Aquila which had very heavy steering (I’m not sure if S3 has updated the car in a long time) and its shift effect is ridiculous, I’ll have to turn that down even though it’ll also effect the other cars. I’ll be trying more cars and more tracks as my next step… Tested the McLaren MP4-12C, Ford Mustang GT3, Audi V8 DTM 1992, and 134 Judd V8. They all feel way better than my previous settings. The only quibble I have is cars with heavy steering could feel better. Remember some cars do not have updated physics/ffb (like the BMW E30 Gr. A I just tried) and they feel particularly “numb” or “dull”.

Update 2016-01-01 – 2: Following on my RaceRoom Racing Experience experimentation earlier today (see first 2016-01-01 update below), I then started experimenting with Wheel Modes and Dynamic Force Boost (expand Sim Commander Effects > Game Force Feedback to see the checkbox). I felt like I had more grip or could better tell how much grip I had under the Responsive (Peaks Allowed) mode as opposed to Default Wheel Mode I was using. This wheel mode allowed in some more what I call “boat sway” in the steering (ex. high speed straight wheel oscillates back and forth on its own) but it’s not so bad. I then enabled Dynamic Force Boost and the feeling of grip improved a little more. As a bonus, force feedback effects come in clearer due to the added force strength added by the wheel mode and force boost. I then had to experiment again with SC Dampening and Friction and I ended up on 1.57% for both. By the way, I have so far kept both Dampening and Friction to the same value as it feels correct in the steering and also seems to make sense in that they are sort of opposites and complement each other in a way. Dampening feels like added “weight” during force feedback effects, such as when the wheel swings back the opposite way when the backend goes out and you need to push through the effect to correct the steering, whereas friction adds weight when there are no force feedback effects. It’s still not perfect, I need to test with other settings like SC Inertia, as I said, and also try other cars (so far testing on BMW M3 GT2 at Brands Hatch Indy). Here are my latest Sim Commander and in-game settings for R3E:


Update 2016-01-01: In RaceRoom Racing Experience, I experimented with moving Smoothing, Spring, Damper, and Friction to Sim Commander settings, so these are disabled (0%) in-game. I figure all the AccuForce does is FFB so it might be better or at least more efficient than the in-game settings. It also consolidates as much as possible to the wheel to avoid duplicating settings. I noticed both SC and R3E had smoothing applied so I first disabled it in-game, which felt better, and then disabled it in SC, which felt even better: I realized I was now feeling effects quicker than I was before. It seems Smoothing was delaying effects or making it feel delayed. I then did the usual binary search on SC Smoothing and Dampening and landed on 8.24% for each. It doesn’t feel perfect but it’s the best I could do in the binary search so far. I might have to experiment with some other SC setting like Inertia. Oh, before I started I did Reset to Defaults on the wheel, ensured Wheel Mode was Default (because High/Responsive modes have had too much oscillation in R3E), disabled Engine RPM (also SC), and then started experimenting in-game. Here’s my latest Sim Commander and in-game settings for R3E:


Update 2015-12-24: Added a Closing Thoughts section which wraps up my thoughts and feelings after having driven with the AccuForce now for more than 6 months. What do I really think of the AccuForce? Would I buy it again? Read on to find out… Oh, and here’s an article over at about the Leo Bodnar SimSteering2 wheel where he compares it the AccuForce he tried earlier in the year. The direct drive wheel market keeps getting more and more interesting.

Update 2015-11-26: I picked up Stock Car Extreme on the Steam Fall Sale ongoing right now. Not a bad pikcup for CAD $20. Sim Commander supports it right out of the box with pretty good settings. I made a new SC profile from scratch and reset it to defaults. When you launch SCE for the first time remember to set Windowed mode or you won’t see Sim Commander’s overlay in the game. In game, you’ll need to setup your controls as per usual for any sim. It doesn’t feel like SCE knows about the AccuForce so I had to set the Wheel Range (in the Controls screen just after you launch a track but before you get on) to 900. It still feels off, you might need to set the Wheel Lock in the Garage screens to 30 to get a 15:1 steering ratio (ie. something like GT-style steering ratio). Let me know if there are any more settings we AF owners should be setting for a more solid ride. Enjoy.

Update 2015-09-25 – 6: My latest Sim Commander settings for R3E:


And for R3E in-game:

RRRE 2015-09-25 23-49-00-52RRRE 2015-09-25 22-57-04-73RRRE 2015-09-25 22-57-08-21

Update 2015-09-25 – 6: A note on dialing in range settings. I’ve mentioned it before but I think I’ll mention it again. When I come up with settings within a range (ex. Smoothing 5% where the range is 0% to 100%) I do a binary search by hand. Put simply, a binary search is starting at one extreme, adding or subtracting half the range, and then adding or subtracting half again, based on preference, and repeating this process until you find an optimal value. For example, with Damping I went from 0% to 100% to try the extremes, then 50% because it was too high, then 25%, then 12%, then 6%, all based on preference. So, put in the setting, run a lap and, if it feels too much lower the value or if it doesn’t feel enough raise the value.

Update 2015-09-25 – 5: I’ve been playing around with Smoothing (5%), Damper (6%) and Friction (6%). Smoothing was at 25% before and it was taking a little bit of definition out of the ffb so I put in just 5%. Damper was at 0% before and it tends to simply dampen all forces (sort of make them slower) and I found more dampening helped me catch sliding backends. Friction was at 0% before and it applies a resistance to the strength you put into turning the wheel. I found in slides or losing grip that something felt off, it was too easy to swing the wheel back and that caused me to misjudge how I correct a slide. Turning up friction to 6% (after trying a binary search) helped me just a little better about how to correct my steering in those scenarios.

Update 2015-09-25 – 4: Even though R3E doesn’t officially support the wheel yet I find I’m finally getting to like the AccuForce FFB results after a lot tweaking (see the updates below from the last few days). The only thing really bugging me right now is the boat-like swaying motion on straights (“floaty” steering feel near center) and also the awkward steering feel when your backend flies out and you need to counter-steer. Something’s still not right there. But, hey, things are feeling pretty enjoyable.

Update 2015-09-25 – 3: I experimented in R3E with Steering Rack FFB. I was used to 0% (ie. all forces from tires as opposed to steering rack) so I flipped it 100% (ie. all forces from steering rack as opposed to tires) and I noticed a more “gradual” or “analog” rise and fall as I mounted and dismounted kerbs. I quite like the extra information so I’ve currently settled on Steering Rack 50% (ie. half of all forces from tires and half of all forces from steering rack).

Update 2015-09-25: Tweaked R3E Steering Force Intensity and Understeer as I put in more seat time and learn what I like.

Update 2015-09-17: Added force feedback settings for RaceRoom Racing Experience. Basically I reset the Sim Commander Profile and then set Steering Force Intensity 70% 50% and Understeer 25% 20%. That’s all I’ve done so far.

Update 2015-09-15: Having problems with Sim Commander crashing after launching games or the in-game overlay not showing in some games like RaceRoom Racing Experience? Power cycle your AccuForce and it should come back. I knew this trick since I ran into a bug when I first got the wheel where the computer wouldn’t even boot with the AccuForce on. Since then I must have gotten into the habit of turning the AccuForce on shortly after booting and that was causing problems. If I only power on the AccuForce after logging in then RaceRoom appears to work flawlessly and I don’t need to power cycle.

Update 2015-07-30: Check this very helpful and informative post on tuning the Accuforce Pro: AccuForce Settings For Dummies.

Update 2015-06-03: Added RaceRoom Racing Experience after 2015-06-02 Update section.

Update 2015-06-01: Added Auto-Tuning with Sim Commander Software section. Recommended read for AccuForce owners: AccuForce Tuning Feedback Test. This is a thread Berney of SimXperience created after the Sim Racing Garage head-to-head video, mentioned below, attempting to provide collect some user experiences and determine what kind of changes could be made to the wheel to improve feel for sim racers (who may have different force feedback tastes than real-life race drivers).

Update 2015-06-01: Barry, from Sim Racing Garage, has release a head-to-head comparison of the Accuforce Pro, Bodnar, and OSW wheels. It has highlighted some nagging concerns I’ve had ever since I’ve been playing with the wheel. Before we go any further, don’t think for a moment I’m saying the Accuforce is not a good wheel. It’s a professional, supported, warrantied, complete package, direct-drive, very strong wheel, with good force feedback and excellent tuning options. It’s a great wheel and at a competitive price. What I will say though is that the forces are not coming through as much as I’d like. For example, one reviewer in the video mentioned how it was difficult to tell the different between a slide through grass and the moment it hit the pavement during the slide. The AF wasn’t communicating that well. Other examples include strong cornering forces washing out road feel, or banking or kerb forces not feeling as defined as the other wheels. On the SimXperience forums, Berney (of SimX), has said he’ll be thinking about pushing out wheel updates to work on the comments the reviewers had in the videos. I look forward to trying those updates.

Update 2015-05-21: Added iRacing Settings, RaceRoom Racing Experience Settings

Update 2015-05-19: Added Setup, First Impressions, First Driving Experience, G27 Thoughts, Resources

SimXperience AccuForce Pro Steering System

accuforce2I’ve recently received my SimXperience AccuForce Pro and have been enjoying it for the past week. I’ve only owned one other force feedback wheel, a Logitech G27, and this is, of course, leaps and bounds beyond a G27. There is ample power and tuning options to provide the flexibility sim racers really want to ensure the best and most realistic experience while driving.

I’ll be posting my initial thoughts, my driving and tuning experiences, and providing tips and tricks for various facets of the wheel, it’s tuning software, and for the various sim titles I play.

I’ll be writing this post in parts and updating new sections as I have time and learn new things about the wheel!


Continue reading “SimXperience AccuForce Pro Steering System”

Request for a Versioning File System on Linux

The people who make file systems are developers. As a developer myself the value of a versioning file system is so keenly clear I’m so surprised it’s not, at the very least, a standard option on every single file system ever created. So this is a request to all the file system developers out there: Please, what can we do to get a versioning file system?

The people who make file systems are developers. As a developer myself the value of a versioning file system is so keenly clear I’m surprised it’s not a standard option, at the very least, on every single file system ever created. So this is a request to all the file system developers out there: Please, what can we do to get a versioning file system?

I’ve googled for years looking for a production ready versioning file system. I think a fuse-based fs would even suffice. I may even take the plunge and see what I can do with fuse and perl. But I’m just so surprised it’s not already done.

There are projects out there like ext3cow, which looks like the Right Way(TM) to do it but seems dead, and the Wayback FS, but it looks dead, too. I love the way they tried to implement versioning on ext3cow. It looks exactly like what I’d want. Everything integrated at the console as a first-class citizen fs.

Now, I know people say just use a revision control system. But initialization and adding and committing files on an ongoing basis is just not something I’m going to do. Anything requiring manual labour will slip through the cracks one day. We have computers to do things for us. This should just be one more thing.

Other arguments include things like revisioning constantly changing files like database blobs, log files or just plain very large files (images, movies, data, etc.). I agree there are some things you don’t want to revision but the benefit to a developer of versioning would be immense.

I once lost a day’s work because of a bad console rm. Since it was in the span of a work day, what was supposed to save me? Frequent rcs commits? I don’t use rcs for backup (neither should you, but that’s a whole other story) and I don’t commit unfinished code. That’s just bad practice and is a symptom of a problem. So, daily backups wouldn’t have saved me, but a versioning file system would have. It got me so worked up that I created a poor man’s versioning “file system” in shell script using rsync to mirror a directory and timestamp backups. Unfortunately, it’s IO requirements caused stuttering when doing normal work. I think I’ll post that shell script in case any one wants to improve on it to see if they reduce the IO requirements. Ooh, good time to try github.

So, what can we do to get a versioning file system on linux? I’ve wanted one for years and I can’t understand why it’s not a priority. If I don’t have the knowledge to code a file system myself what can I do to bring this goal a little closer?

git – the fast version control system

At work, we’ve been investigating revision control systems to replace our current system, CVS. Primarily, we’re investigating git (wikipedia article) as it has basically become the de facto distributed version control system.

Update 2013-10-05: See my other post on git for my latest thoughts on git. I’m now an enthusiastic fan of git. :)

At work, we’ve been investigating revision control systems to replace our current system, CVS.

Primarily, we’re investigating git (wikipedia article) as it has basically become the de facto distributed version control system. And we definitely see the advantage of being distributed. While we’re focusing on git, I have been reading up on lots and lots of other systems: dcvs, svn, aegis, bazaar, mercurial, and many, many more. I’ve been compiling an internal wiki document with many resources for each so we can better learn and compare them.

The odd thing with me is that I was late to the rcs game, starting to use cvs only around 2004 or so. I started on cvs and have continued to use cvs until now. I know its ins and outs. I’m comfortable with its plain text repository files and their contents. I’ve written scripts to parse them and present structured data back to the user. For example, which files and revisions have we marked with a specific bug in the comments: Great way to get a changeset for one bug if you’re disciplined enough to “tag” comments with the right bug number. Again, I’m comfortable with tagging, branching and all the discipline and structure and branch modeling needed for proper branching and merging that will necessarily occur in significant projects.

So, I see the dotted version numbers they use for revision specifiers and they make sense. Everybody versions their code releases with dotted version numbers (1.0, 1.1, 2.0, 3.0, etc.), whether they use revision control or not. So it makes sense to version files that way. But it seems modern systems don’t like that. They’ll use hashes to represent file versions.

I also see the plain way in which my checkout files and directories are recorded as the same name files and directories in the repository. It makes sense. There are some limitations like symbolic links but they either don’t come up that often or they can be dealt with in other ways (we use project initialization shell scripts that setup the environment complete with symlinks for perl package namespaces, apache config symlinks, etc.). But, again, modern systems will use custom structures which allow them to model plain files and plain directories in their own format and export them as needed.

I can totally understand where the mindset came for cvs back in the day in the 1980s. It was probably significantly if not directly inspired in its design and architecture by the Unix Philosophy. The Unix Philosophy, by the way, is a brilliant thing of utter common sense and simplicity. It is the only philosophy in program design that has produced real interoperability: the command-line.

Then I look at all of the modern, distributed revision control systems and they completely eschew with the idea of plain files and plain directories. They also mostly do away with file version numbers. I understand there are advantages. Namely performance and ability to model more than simple files and directories. The possibility of more easily versioned directories is there as well. There are definitely advantages but I’m still on the fence as to whether it’s worth it or not.

As I said, I grew up on cvs and, as necessity usually forces one to do, I invented means to get around cvs’s shortcomings and now have an ecosystem that I am comfortable with, have a good knowledge of, and have the confidence that I can extend it to do what I need when I need it without a lot of hassle.

Modern systems abstract out concrete file system concepts such as files and directories and simply model them in their own objects. They can then be exported to concrete file system files or directories internally at will. I’ve actually always been one for abstracting and modeling things in a generalized way that gives power to the application rather than to external forces but it does have its disadvantages; things become more opaque and so more difficult to work with.

We have a number of server-side “locks” in place to prevent things that might be “bad” when users commit. For example, a file, directory or branch may be locked, or the commit message was invalid, or the file contained dos line endings which we don’t want, or we’d like to enforce certain policy regarding the content of the file. This is all very easy as, during the commit, these hooks have access to the plain files. I tried to figure out how to do the file access hooks in git and didn’t come away with any real answers – yet.

I guess my concern is that perhaps modern revision control systems have abandoned some good principles of the Unix Philosophy and, as those with experience know, those principles came with a lot of pain. Discard those principles and you’ll probably learn them all over again with a lot of pain. In a common unix adage, paraphrased, those who forget their unix history are doomed to repeat it, badly.

Or perhaps we understand version control well enough now that it’s no longer exciting and we don’t want to implement plainly again so we’re taking the next step? I find this at work in my own code. At times I’m excited by a new technique or implementation and I hone it and hone it until at some point I get bored of it and no longer want to know it inside and out. So I might use a perl cpan module and now it’s a black box and I don’t have to worry about reinventing the wheel.

Whatever the case may be, if hiding file and directory details behind custom, binary data structures, and using meaningless hashes for version identifiers, is the way of the future, perhaps I’ll just need to try a little harder to wrap my head around these new systems and the new ideas they’re bringing to the table.

I’ll mention just one other thing that I think is important. RCS can do everything that modern systems can do, it just needs glue scripts. CVS can do everything that modern systems can do, it just needs glue scripts. Git, being a modern system, does everything it does without the need for glue scripts.

What I’m saying is, I get the advantage of cvs plain files and plain directories, and dotted version numbers, and I get the advantages of changesets and a dstributed nature if I put in place my own solutions for these things – they’re not in by default. Some if not all can be relatively automated. The point is I almost feel I can get that well known 80/20 win where the biggest win comes in the first, relatively small amount of effort. Perhaps it would be a nightmare of details to make cvs distributed but here’s the important thing to remember:

Give me something that follows the Unix Philosophy and I’ll likely be able to extend it to do pretty much whatever I need.

Get a little too complex with your data formats and abstract models and you’ll start suffocating innovation because it’s difficult to work with.