ARmA III - Cheats

Well, since most trainers won’t enable me to become “GOD” (yeah, I guess I’m too stupid for ARmA III), here’s a list of commands that’ll change things. Disable damage to player and teammates: 1 { _x allowDamage false; } foreach units group player; Disable player fatigue: 1 player enableFatigue true; player enableFatigue false;

October 27, 2014 · 1 min · 53 words · christian

OpenELEC on CuBox i - Update to latest snapshot

Here’s an easy way to update the OpenELEC running on a CuBox-i easily: 1 2 3 cd ~/.update curl http://snapshots.openelec.tv/`curl http://snapshots.openelec.tv/ | grep OpenELEC-Cuboxi | cut -d\" -f2` | tar x mv OpenELEC*/target/* . && rm -r OpenELEC*

October 20, 2014 · 1 min · 38 words · christian

PowerShell - and how to add new DNS servers to remote systems

Well, I’ve been playing around with PowerShell today. I had the task to move (as in change the IP address) two domain controllers into another VLAN. I could have done it the easy way and added the DNS servers by hand (by RDP’ing to each system having these particular DNS servers configured) - which wouldn’t have been very hard considering the domain only has 7 members at this point … ...

October 1, 2014 · 2 min · 279 words · christian

Rename a Standard Port Group on all hosts in a cluster

Well, I recently decided to rename a bunch of my Standard Port Groups, since they did no longer reflect the network they were providing. Since I’m a lazy bastard (well lazy as in click lazy), I wrote this little PowerCLI script: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 param( [string] $vcenter, [string] $cluster, [string] $oldpg, [string] $newpg, [string] $vlan ) # Add the VI-Snapin if it isn't loaded already if ( (Get-PSSnapin -Name "VMware.VimAutomation.Core" -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin -Name "VMware.VimAutomation.Core" } If ( !($vcenter) -or !($cluster) -or !($oldpg) -or !($newpg) -or !($vlan) ) { Write-Host `n "pg-cluster-rename: <vcenter-server> <cluster> <oldpg> <newpg>" `n Write-Host "This script renames each port group with the name <oldpg> to <newpg>" `n Write-Host " <vcenter-server> - DNS name of your vCenter server." `n Write-Host " <cluster> - Display-Name of the vCenter cluster, on which we are" Write-Host " gonna create the new portgroup." `n Write-Host " <oldpg> - Name of the old Port Group that is to be replaced (ie VLAN2)." `n Write-Host " <newpg> - Name of the new Port Group (ie PG-VLAN2-Produktion)." `n Write-Host " <vlan> - VLAN-ID for of the new port group." `n exit 1 } Connect-VIServer -Server $vcenter Get-Cluster $cluster | Get-VMHost | Get-VirtualSwitch -Name $vswitch | ` New-VirtualPortGroup -Name $pg -VLanId $vlan Get-Cluster $cluster | Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "$oldpg" } | ` Set-NetworkAdapter -NetworkName $newpg -Confirm:$false Get-Cluster $cluster | Get-VMHost | %{Get-View (Get-View $_.ID).configmanager.networkSystem} | %{ $_.RemovePortGroup($oldpg) } Disconnect-VIServer -server $vcenter -Confirm:$false This script basically takes a vCenter instance and a single cluster, then creates a new Port Group on each host, after which it reconfigures all VMs possessing a virtual NIC with that Port Group and then deletes the old Port Group.

September 24, 2014 · 2 min · 321 words · christian

Create ComicRack compatible cb7 archives

Well, I have a few directories containing comics (in JPG/PNG) format. Since I’m lazy and didn’t want to create a 7z by hand for each directory, I wrote a short script that’ll do the work for me 😄 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 #!/bin/bash # Mangle IFS, since space is a valid default IFS SAVEIFS=$IFS IFS=$(echo -en "\n") # Locate the 7z binary if [ -x "/usr/bin/7zr" ] ; then ZIP='/usr/bin/7zr' fi if [ -x "/usr/syno/bin/7z" ] ; then ZIP='/usr/syno/bin/7z' fi ORIG_DIR="$PWD" #find $DIR -mindepth 1 -maxdepth 1 -type d -print0 | sed "s,./,," | while IFS= read -r -d '' dir; do find $DIR -mindepth 1 -maxdepth 1 -type d -print0 | while IFS= read -r -d '' dir; do dir="${dir##*/}" case $dir in extracted|@eaDir*) continue;; esac ARCHIVE="${dir}" # Remove tags from file names ARCHIVE="$( echo $ARCHIVE | sed -e "s,\[SaHa\] ,,g" )" ARCHIVE="$( echo $ARCHIVE | sed 's/([^)]*)//g' )" ARCHIVE="$( echo $ARCHIVE | sed -e "s,_, ,g" )" ARCHIVE="$( echo $ARCHIVE | sed -e 's/[ \t]*$//' )" # Decide, whether "," or "-" separates writer and series # Get series and author from directory name WRITER="$( echo ${ARCHIVE} | cut -d, -f1 | sed "s,./,," )" SERIES="$( echo ${ARCHIVE} | cut -d, -f2- | sed -e 's/^[ \t]*//' )" # Check if the pictures are directly beyond the subdirectory. Otherwise # report the directory and skip it. HAS_PICTURES="$( find "$dir" -mindepth 1 -maxdepth 1 -type f -regex ".*\.\(PNG\|png\|jpg\|JPG\|jpeg\|JPG\)" | wc -l )" if [ "$HAS_PICTURES" -lt 1 ] ; then echo echo "Attention: $dir" echo "has no pictures in the immediate directory. Please move the pictures" echo "from the subdirectory to the immediate directory." echo continue fi # Create a bare ComicInfo.xml cat > "$dir/ComicInfo.xml" << EOF <?xml version="1.0"?> <ComicInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Series>$SERIES</Series> <Writer>$WRITER</Writer> <Genre>Adult</Genre> <LanguageISO>en</LanguageISO> <AgeRating>Adults Only 18+</AgeRating> </ComicInfo> EOF if [ -f "$ORIG_DIR/$ARCHIVE.cb7" ] ; then echo "$ARCHIVE.cb7: Skipping, since the new archive already exists ?" continue else cd "$dir" # Create the cb7 archive echo "Creating $ARCHIVE.cb7" ret=$( $ZIP a "$ORIG_DIR/$ARCHIVE.cb7" * &>/dev/null && echo 0 || echo 1 ) cd $ORIG_DIR if [ $ret -eq 0 -a -f "$ORIG_DIR/$ARCHIVE.cb7" ] ; then rm -rf "$dir" &>/dev/null fi fi done # restore $IFS IFS=$SAVEIFS

August 31, 2014 · 3 min · 448 words · christian

Hetzner, Debian, KVM and IPv6

Well, I’ve had my share of troubles with Hetzner, Debian, KVM and IPv6 addresses. After figuring out how to get around the IPv6 neighbor stuff (npd6 for teh win!), I battled with the problem that after restarting (rebooting/resetting - doesn’t really matter) a domain it’s IPv6 address would no longer work. Well, today I decided to take a closer look. After the reboot, the guest comes up with this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 pinguinfuss:(thanatos.heimdaheim.de/webs) PWD:~ Mon Sep 09, 19:01:27 [0] > ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:96:ed:35 brd ff:ff:ff:ff:ff:ff inet 78.46.37.114 peer 78.46.37.118/32 brd 78.46.37.114 scope global eth0 inet6 2a01:4f8:110:3148::5/64 scope global tentative dadfailed valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe96:ed35/64 scope link valid_lft forever preferred_lft forever A quick peek into ip 6 neigh show reveals this: ...

August 25, 2014 · 2 min · 377 words · christian

Nagios: Integrating Cisco switches

Well, as I wrote recently, we received a new BladeCenter a few weeks back. Now, as we slowly take it into service I was interested in watching the utilization of the back planes as well as the CPU utilization of the Cisco Catalyst 3012 network switches. The first mistake I made, was to trust Cisco with their guide about how to get the utilization from the device using SNMP. They stated some OID’s, which I tried with snmpwalk and got a result from. 1 2 snmpwalk -v1 -c public -O n 10.0.0.35 .1.3.6.1.4.1.9.5.1.1.8 .1.3.6.1.4.1.9.5.1.1.8.0 = INTEGER: 0 Now, as I tried retrieving the SNMP data by means of the check_snmp plugin, I got some flaky results: 1 2 3 4 /usr/lib/nagios/plugins/check_snmp -H 10.0.0.35 -C public .1.3.6.1.4.1.9.5.1.1.8 SNMP problem - No data received from host CMD: /usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 10.0.0.35:161 Those of you, who read the excerpts carefully will notice the difference between snmpwalk and the OID I passed on to check_snmp. The point being, the OID’s Cisco gave in their Design tech notes are either old, or just not accurate at all. After passing on the .0 to each value given by Cisco, the check_snmp is all honky dory and integrated into Nagios. As usual, the Nagios definitions are further down, for those interested.

August 20, 2014 · 2 min · 423 words · christian

Summer - finally

Well it’s mid of July and the weather seems to be my friend. 25°C ain’t that bad. I really liked the weather last week (although everyone at work was bitching about it being tooo warm 😛) and would like to keep it (for the rest of the year of course!). Hrm, for everyone who loved the music within Kill Bill - Volume 1: Tomoyasu Hotei really rocks (playing Battle without Honor or Humanity). ...

August 16, 2014 · 2 min · 265 words · christian

SLES-9-2

Hrm, today I tried to install some extra programs I need for devel-stuff (quilt, git, subversion) on an ancient (not sooo ancient) SuSE Linux Enterprise Server 9.2. Did I already mention I hate rpm-based distros ? Ah and I missed to tell you, that I really love USE-flags … Ok, so it took me half the afternoon, to rebuild half of all installed packages (heh, kde* depends upon expat*; but who need X or even KDE on a server-machine?) and figured that everything was for nothing. ...

August 16, 2014 · 1 min · 184 words · christian

portage / eselect-compiler

On Monday I helped Ned fixing ebuilds using the following DEPEND/RDEPEND: 1 *DEPEND=" || ( app-admin/eselect-compiler >=sys-devel/gcc-config-1.3.1 )" Problems only popped up because app-admin/eselect-compiler got masked due to numerous, unresolved bugs (and Jeremy/eradicator being MIA again). But that also revealed a bug within portage on handling the || ( a b ), where a is being masked. So solar and I had being working on updating those ebuilds that use the above syntax (or something similar, some are using other versions, thanks Sven for the hint/reminder). ...

August 16, 2014 · 1 min · 155 words · christian