Initial Setup of a MikroTik CRS309 Switch
Setting up a new MikroTik CRS309 turned out to be a bit more complicated than anticipated.
This post outlines my process of setting up the switch. The screenshots show the newer gui as I’m reconstructing this process after setting everything up.
Login to Admin Gui
The MikroTik manual states you need to use a windows program called winbox but I found out,
the switch has a web gui running on port 80, so thats what I used. The switch boots up with
an ip of 192.168.88.1
and a netmask of 255.255.255.0
so you need to set some ip in the
same subnet to access the web gui.
Proxmox on mirrored root zfs
why
I wanted my new proxmox to have mirrored boot drives for redundancy resons. I used somewhat large drives, meaning to pass them trough to a TrueNAS instance
how
Basically just install debian on a mirrored root zfs and then put proxmox on top
- put 2 drives into the system
- follow the Root on ZFS Guide by OpenZFS and set the drives up as a mirror.
- follow the Install Proxmox VE on Debian Bookworm Guide by Proxmox. As new Debian versions are released, new guides will probably be published but the basics likely remain the same
Buying 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 to see temperature stability and calibration with DMMCheck
And to balance things out, also check out what Dave Jones of the EEVBlog has to say about the Uni-T UT71E and UT61E in general.
DPS-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 that hold the fans in, remove the lid, remove the Four screws in the corners of the PCB. Pop out the mains connector and push in the LED. Then you need to pull the mains plug out of the case so you can guide the mains wires through the opening where the mains plug was. It’s a bit fiddly but It’ll come out. Just be patient and try not to rip off the caps and whatever else is soldered to the mains plug. The fans are in their own little subassembly which can be gentrly pried away from the rest of the board after unplugging the fans. Please not that the PSU will shutdown a few seconds after powerup when either of the fans isn’t connected and running.
Always 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.
Building 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). Need to change a dependency? With some more xslt you can definitely do that too! You can run this script locally or on a build server (the script is using jenkins’ BUILD_NUMBER environment variable).
Reuse repository definitions in gradle
A 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:
// add your repositories here
buildscript {
repositories {
mavenLocal()
jcenter()
maven {
credentials {
username 'user'
password 'pass'
}
url 'https://example.com/maven2'
}
}
// re-use repositories from buildscript
buildscript.repositories.each { repositories.add(it) }
Dump all (most?) JMX Beans via Jolokia using just the shell and a bit of json formatting
It 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:
for name in $(curl --silent http://dwtest:10002/search/*:* | python -m json.tool | grep '"value":' -A9999 | tail -n +2 | head -n -2 | sed 's/ /%20/g' | cut -d'"' -f2);
do curl --silent "http://dwtest:10002/read/$name" | python -m json.tool;
done
Once you’ve gotten this far, piping the information into a file or another tool is trivial.
Executing shell commands from groovy
pre { 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. Make a list and call ’execute()’ on it - how awesome is that?
How to fix file permissions on debian
It 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, the old partition was already gone - bad luck. Reinstalling is pretty much the only ‘solution’ I could find for this problem on the web. What follows are a few simple steps to resurrect a system to at least a runnable / good-enough state: