tag:blogger.com,1999:blog-60055609862267321892024-02-20T19:51:36.907+01:00swisstech.netDigital & Film Photographer, Darkroom Rat, Petrolhead, Software Architect, Enterpreneurblog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-6005560986226732189.post-63509954927523400412016-01-28T18:51:00.001+01:002016-01-28T20:56:22.416+01:00Buying Multimeters: The Uni-T UT61E
This is not a review, just a quick teardown of the Uni-T UT61E. If you expected a review, check out the in-depth review by Martin Lorton on youtube:
Part 1: First Look and Basic Functions
Part 2: Look at PC data logging software, UltraDMM software, mains measurement and more
Part 3: A look inside at input protection / build quality.Test battery consumption and low warning
Part 4: Torture test blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-61280822324674953332016-01-25T23:36:00.000+01:002016-01-26T23:37:18.219+01:00DPS-800GB A 1kW 12V 82A HP Server Power Supply
I recently snatched Four of these nifty 1kW power supplies. They were all used but still working. Well I kinda damaged one of them but more on that later. Here are a few shots of these things. They're pretty compact for that amount of power.
Here they are removed from their cases and ready some customization. To disassemble, remove all screws on the outside of the case except for the Eight blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com5tag:blogger.com,1999:blog-6005560986226732189.post-82756959095862685432016-01-25T23:07:00.003+01:002016-01-25T23:07:32.791+01:00Always check those cheap electronics parts for faults
Yes tons of stuff can be ordered for next to nothing from China but be sure to check the quality. So sometimes this stuff is just billig (cheap) and not günstig/preiswert (good value for money).... Caveat Emptor.
blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-87961879702489328432015-01-27T13:21:00.001+01:002015-01-27T13:21:22.180+01:00Building custom libs that are missing in maven central or jcenter
So you really need that java lib somebody made but they can't be bothered to upload it to maven central or jcenter? Build it yourself and host it on your nexus repo. That's what the script below does. Additionally, it includes a little xslt magic which allows to change the pom.xml in any way you want. Are they using snapshot versions? No problem, just insert your own (as shown in the script). blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-61827472502044373212014-10-16T15:36:00.001+02:002015-01-27T13:23:01.310+01:00Reuse repository definitions in gradleA project I'm working on has accumulated a bunch of repositories we need for the build.gradle script and for the build itself. I don't want to keep everything twice so I thought some re-use is in order. Thanks to the excellent gradle javadocs and api design, it was easy to accomplish. The end result is this:
blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-44671628611267158902014-10-08T18:43:00.001+02:002015-01-27T13:24:06.765+01:00Dump all (most?) JMX Beans via Jolokia using just the shell and a bit of json formattingIt seems jolokia doesn't support dumping everything with just one command.
So here's a really hacky quick and dirty way to get all information jolokia can access:
Once you've gotten this far, piping the information into a file or another tool is trivial.blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-33835610507880613152014-09-19T11:54:00.000+02:002014-09-26T12:22:35.196+02:00Executing shell commands from groovypre { border: 1px solid #EEE; }
Sometimes you want to run a shell command generated from groovy or just want to achieve something that's faster/simpler in the shell in comparison to doing it with groovy. One such case would be to get the number of git commits of a repo. The command for this is fairly simple:
$ git log --oneline | wc -l
179
Running shell commands from groovy is really easy too.blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-56773007091431956992014-06-13T17:24:00.000+02:002015-01-27T13:25:14.278+01:00How to fix file permissions on debianIt just so happens I recently migrated a linux system from ext4 to btrfs and didn't want to do a fresh install. So make a new partition, format it and copy the system over... Too bad I forgot to tell 'cp' to preserve the file permissions. I ended up with a system where every last file was owned by root and that obviously causes problem with everything that isn't executed as root. And of course, blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-51729011639721651742014-01-30T16:09:00.002+01:002014-01-30T16:09:55.166+01:00Migrating Sonar to a different host
Just a few notes on how to move your sonar installation to another machine without loosing any of your config and/or history. Some of that include the normal installation steps too. This list is specific to debian.
Add the sonar debian repo to your machine (/etc/apt/sources.list.d/sonar)
deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/
Update and install sonar (sonar pkg is blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-32475516933959514452013-10-01T16:36:00.000+02:002013-10-01T16:37:47.837+02:00Installing/Upgrading flash on Ubuntu behind a proxy
This just refused to work because the flashplugin-installer that actually downloads the packet doesn't honor the http_proxy environment variable to I had to do a little hack to get this going. It's actually pretty simple: download the file and serve it from localhost so we don't need the proxy at all.
First shell:
mkdir /tmp/flash
cd /tmp/flash
wget http://archive.canonical.com/pool/partner/a/blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-63766322427616023002013-09-08T23:09:00.001+02:002013-09-08T23:09:59.334+02:00Reclaiming you Music from an iPodA while ago I wrote a quick tip on how to mount an ipod in linux, I did this while working on a python script that would retrieve all my music from my ipod and put it back into a file structure of my choosing with file and directory names that a human being can understand. The reason for this is simply the fact that I kept rating music over time and ended up rating everything - an information I blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com1tag:blogger.com,1999:blog-6005560986226732189.post-81078053766753518552013-06-03T20:57:00.000+02:002013-06-03T20:58:12.334+02:00How to rename/merge projects in sonarSonar doesn't support merging of projects out of the box so when you happen to rename a project as I just did, you're suddenly stuck with 2 projects of the same name unless you do a little bit of sql trickery in the back. Here's how you do it (quick & dirty approach). What we're going to to is: rename the old projects (with all the juicy metrics) to the new groupid/artifactid and delete the new blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-22100453624163371052013-05-13T14:57:00.001+02:002013-05-14T08:47:04.306+02:00To gradle daemon or not to gradle daemon?The gradle daemon speeds up builds quite a bit and you do want to have it running on your local machine but not on the build server, that one should always re-build from scratch. This is actually quite easy to accomplish.
In your '~/.bashrc' add the following export so your local machine runs all builds with the gradle daemon:
export GRADLE_OPTS="-Dorg.gradle.daemon=true"
Since, by default, blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-83131801193549233032013-05-12T22:50:00.001+02:002013-05-12T22:51:01.657+02:00How to mount an iPod in linuxI'm currently trying to get rid of my iPod and move all my music to my android phone. Needless to say my iTunes installation on the PC is long gone and these iDevices are the proverbial bottomless bit - you'll never get anything back out of them, or do you?
Thanks to the libimobiledevice and ifuse projects, you can now mount an ipod like any normal usb stick in linux, and it doesn't even have toblog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-67090411004571473102013-05-12T01:49:00.001+02:002013-05-12T20:21:38.391+02:00First steps on a new postgresql installationI've found myself trying postgres over mysql for a few things and had some trouble accessing the db server at all at first. So here's how you first access the server:
$ su - # su to root
# su - postgres # su to postgres
$ psql # access the server
That wasn't so hard now was it? Once I'm in the psql shell, I tend to issue the following SQL statement so my primary user has blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-23487786672778038522013-05-09T23:10:00.001+02:002015-01-27T13:26:47.066+01:00Always test your Puppet ModulesAlways test your puppet modules. Even if it's just a little smoke test like this:
class { my_module: }
Now to make this one better, create a job on your continuous integration server and let it run the following script inside the modules directory of your puppet project:
It looks for all '*.pp' files inside all 'tests' directories and does a simple 'puppet apply' call. It may not be perfect blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-13923355632642798342013-05-06T13:59:00.000+02:002013-05-09T23:00:42.232+02:00Resizing VirtualBox DrivesMy Virtualbox images are usually fairly small. Here's how to increase the size of a vbox disk, to 8G in this case:
vboxmanage modifyhd /home/user/vbox/vm/vm.vdi --resize 8192
After that, remove the disk from the vm it's currently attached to, hook it to a new vm, which will boot from an iso file. Once booted, start gparted. It will complain that the gpt partition table is not (anymore) at the blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-76631667764580222822013-03-14T14:33:00.002+01:002013-06-08T16:07:55.833+02:00Using awk to remove lines from a fileA little goodie I'm writing up here to document for my own future reference.
Objective: Remove all lines matching a certrain pattern from all files in a directory structure. The pattern is in the form of "part1.<alnum>.part2"
First try: grep and sed, unfortunately that leaves me with blank lines where the matching content was and I want that line removed completely. Apparently sed can't blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-62073465402429685372013-01-15T19:49:00.000+01:002013-06-08T16:17:47.365+02:00Simple python script to access jmx via jolokia
I've never been much of a python guy. Now there's this production environment where we've got a few basic things like bash, ruby (since we're using puppet) and python. Our Java based software has a nice JMX interface with a bunch of lifesavers in it and each JVM has the jolokia agent running (http/json access to jmx) so we can access this goodness fairly easily from scripts and/or the shell. So blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-68002613345860032792013-01-08T13:28:00.001+01:002015-01-27T13:28:10.683+01:00Pretty Capistrano outputI recently started tinkering around with capistrano to automate a few things like doing checks and generally make my life easier in terms of managing a bunch of linux machines. While capistrano is really cool, it's output is all over the place and I find that very irritating. Maybe it's just me but I don't like non-aligned repeating Strings. Take this output for example:
** [out :: blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-21847037392721328862013-01-02T18:53:00.000+01:002013-01-02T20:23:39.512+01:00Quality loss when saving as JPEGSo recently an article was linked on reddit about a bunch of photography myths. Number 7, called "Saving a JPEG multiple times degrades quality" which was apparently proven to be wrong disturbed me most and so I did a quick test on my own.
Further below are Three images. The Original, the one saved 30 times and an XOR of the first Two showing the differences. If you toggle between the first two blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-65088919135739779532012-12-30T15:31:00.002+01:002016-01-25T23:06:11.410+01:00Building a wooden Lensboard for the Schneider-Kreuznach G-Claron 240/11 WAI recently bought a nice little repro lens, the Schneider-Kreuznach G-Claron 240/11 WA. The Schneider-Kreuznach archive contains some more information on the G-Claron 240
So without a real plan, only a rough idea I went ahead and bought some materials to build myself a little lensboard. With a little wood, some glue and a few nails I quickly threw together that lensboard. Add some felt to make blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-18469749500113647922012-12-21T15:55:00.000+01:002013-01-07T17:55:02.989+01:00Tanuki Software's Java Service Wrapper and your Environment VariablesThis post has been updated
Here's an evil little gotcha I ran into when using the Tanuki Software Java Service Wrapper to run our company bamboo server. But first you need to know a little bit of context:
We had our bamboo agent running as root for a long time and about two months ago I changed that. I created a bamboo user and installed multiple agents. Each of these into its own folder along blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com3tag:blogger.com,1999:blog-6005560986226732189.post-50658976528399070772012-11-12T11:01:00.002+01:002013-06-08T16:18:25.437+02:00Using WSDLToJava with Gradle
I currently need to generate some java sources from a wsdl with Gradle. In Maven, I've done this using the cxf-codegen-plugin but I want to avoid using anything that's maven in my new build. And there's several resources out there who will either tell you to call WSDLToJava via cxf's ant task or directly. The 'direct' way still leaves you with several possibilities like calling ProcessBuilder blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0tag:blogger.com,1999:blog-6005560986226732189.post-57551182896416672912012-11-07T13:13:00.001+01:002013-06-08T16:19:08.782+02:00Anatomy of a Gradle Task: Task Dependencies
Here's another little "gotcha" on gradle tasks. When they're triggered. I've seen quite a few posts on stackoverflow along the lines of "How can I call a gradle task". You can't (Well ok you could but you don't want to). It is executed as a dependency of another task.
Going back to that little copy task I wanted to execute, I needed it to run roughly somewhere after the clean task and before blog.swisstech.nethttp://www.blogger.com/profile/01384046964833815670noreply@blogger.com0