Place it in .git/hooks in your git source controlled directory
git diff-index -z --cached HEAD --name-only --diff-filter=ACMRTUXB |
xargs -0 -t -L1 /usr/local/bin/jsonlint -c;
if [ "$?" != "0" ]; then
echo "\nOne or more JSON file didn't pass jsonlint'ing.";
echo "Fix them before committing. If it is not possible to fix them all commit with the option --no-verify.";
This works on a mac. xargs is a little bit different on linux where it probably should be changed to
xargs --null --no-run-if-empty /usr/local/bin/jsonlint -c;.
This assumes jsonlint is installed in /usr/local/bin
The gist can be found here.
I published an article about Anti-patterns in Docker today, on Constant Contact tech blog. In the editing process, some thoughts were cut from the main article but I thought I’d share these tips, follow up:
- Don’t store data or configuration files in containers, keep them on shared volumes where they can be backed up easily by other containers.
- Use remote log collection for your logs
- Don’t leave your build artifacts laying around: Minimal Containers
- Are Centos, RedHat, Ubuntu, Debian the right distros for containers? Look into ArchLinux, CoreOS and UniKernels
- Think about generic images that could run any properly structured app on a given stack. For example, this image could be to run pretty much any node.js with good package.json file.
- Reach out beyond basic Dockerfile & docker commands and learn the differences between similar looking commands & understand the intention behind those differences.
- Comprehend the impact of ADD & VOLUMES as cache invalidators
- Imagine what you can do with onbuild, container linking, , volumes and environment variables
- Files and sub directories under the current directory are added to the context, which is sent to your Docker demon because it might be running on a remote machine. Only place files and directories that you need to add to image under the current directory.
Docker Package on Synology – 88k downloads!
Docker is a great addition to my DS1815+ Synology NAS. Its implementation is very cool in many ways but has a few big weaknesses.
Amongst its strengths, I can think of:
- Pretty great UI for managing running containers, including docker exec
- Good UI for adding images (though no way to update them, see later)
- Pretty stable
- Great alternative to community or Synology built packages
- Can export/import container settings
- Through volume exports, can map to main FS folders
- Accessible through command-line
As DSM 6.0 seems to rely heavily on Docker, I think it’s worthwhile to petition for these shortcomings to be remedied:
- Runs an old version of Docker (1.6.2, several versions and security patches behind, soon to be deprecated)
- No UI support for Dockerfiles
- No way to refresh images once they’ve been downloaded through the UI
- No support for docker-compose (UI or CLI)
- Cannot pull a specific version of an image (such as: edasque/nodebb:v0.0.2) in the UI
- Docker containers do not restart on reboot
- Occasionally containers will cause a system reboot (for example on automatic system update)
- Documentation and support seem to be lacking
What am I missing? What is remedied by DSM 6 Beta 2+ for those that run it?
I found a great stand for my Apple Watch http://buff.ly/1JnZzrR
Apple Watch bedside table stand
It’s pretty cheap, simple, looks good. Your watch will stay put thanks to the magnets. It works for 38mm & 42mm watches. There might be alternatives but this one works for me just fine.
By default Podfiles only link Pods framework to the main target.
So you’ll need something like:
link_with 'AppName', 'AppName WatchKit Extension'
to indicate that you want the Pods to extend to the WatchKit target! Simple but a bit of a head scratcher at first.
For some reason there was an anomaly in one of our metric last night and it was ruining a lot of our graphs readability. The data was correct and we are looking into the issue but it was anomalous and so high that it was hurting mean, mean_90, etc.
So I needed to find a way to overwrite existing data in Graphite. You cannot remove datapoints in Graphite but you can overwrite the data manually if you know the time stamp:
echo 'stats.timers.browser.timedPageRender.circus.accounting.rendered.mean 14000 1409268080' | nc p2-graphite.ad.prodcc.net 2003
If you’ve got a few bad data-points and you used statsd to gather timer data for example and as such it spans accross a few different metrics (median, std, mean, mean_90, …), I wrote a quick commmand line application to overwrite data over a give threshold for a span of time. You’ll find it in this gist but proceed with caution. Look at and understand the different constants, check the time range (I didn’t put constants for that). Here there be dragons. You’ve been warned!
An update to my old popular toolbar application now for Sublime Text 3. You can download it here. Is you’re on Maverick, you’ll need to Option-Command drag it to your toolbar.
After buying and borrowing a few chargers, I realized I didn’t want to ever have to upgrade (in a multirotor/plane scenario) my next LiPO battery charger, didn’t want a cheaply made and potentially dangerous Chinese clone and wanted something solid I could take to the field and power from my car battery
So, what is the best LiPo charger?
My advice would be to go with the HiTec 44167 X4 AC Plus 4-Port AC/DC Multi-Charger. This checked all the checkboxes for me and for just a bit more money seemed vastly superior than the alternatives.
I use this connected to an AC outlet at home and while flying connected to my car battery. It charges four batteries at a time and is built like a tank.
Each port of the X4 AC Plus can handle up to a 6S Lithium, LIPO pack, 15 NiCd/NiMH cells or 6-12 volt lead acid batteries. Four individual balancing ports eliminate the need for a separate balancer when charging Lithium batteries. Its twin fan cooling system with an internal sensor for controlling fan speed provides the utmost in efficiency and safety. It’ll discharge battery, charge them for use or for storage, balancing the different cells effectively.
Why shouldn’t I get a cheap LiPo battery charger?
I know many will say it’s out of your budget, but in all honesty it really is something that you shouldn’t scrimp on for so many reasons, the main one being safety. This charger has already been adopted by many, you really want to just be able to buy a unit that does everything adequately and safely and be done with it and not have to upgrade again.
Not all chargers are equal, and cheap Chinese crap from Hobby King should be avoided. Get a charger from a known brand that has a good reputation such as Hitec.
How fast can I charge LiPo batteries?
How long it should take you to charge a 4000 mah pack ? Well you should have something that is capable of matching the capacity in one hour, so something that can charge at 4000 mah, also referred to as 1C. Although you can charge some packs quicker I don’t recommend it and obviously the cost of a charger that is capable of that will go up considerably.
If you want a charger that is going to charge your packs at 1C it’s not going to be a super-cheap item, and the ones that can and are cheap I would tend to avoid. You really want a digital charger that will tell you what you are currently charging at, what the internal resistance of your pack is, should have excellent balancing capability and also allows you to charge/discharge for storage.
This is it.
P.S. Note that you’ll want to get three XT60 Charge Cable (one comes in the box) to charge four batteries simultaneously
Good and cheaper (but not cheaply made) alternatives exist, the HiTec 44165 Plus Single Charger which charges one battery on AC or car battery and the HiTec 44169 4 Port Multi-Chemistry Charger which will charge 4 simultaneously but only on an AC outlet.
I have now made available an RSS feed for the audio book deal that Audible publishes every day: Audible Daily Deal RSS feed (http://feeds.feedburner.com/AudibleUsDailyDeal).
I have also added it to the US iOS & Android Amazon Kindle Deals of the Day applications that I built. I know that they’re not technically Kindle deals but I thought the same audience would be interested in them.
And your shows are no longer downloading…
I had that issue with my Tivo Premiere XL4 and I fixed it by going through the Guided Setup twice (Settings/Help/Reset or Rester/Guided Setup), the first time with a bogus zip code(90210)/Provider and after that with my actual zip code and cable provider. That caused the Tivo to just reset its guide completely and all was well.