runnane Everything that matters ++


Accessing Shared Mailboxes in Office365 with PHP

After a lot of trying&failing, this setup worked for me when connecting to a shared mailbox in office365:

  1. As the username, use "your_username\shared_mailbox_alias" (your_username needs access to the shared mailbox of course)
  2. Add the extended option 'DISABLE_AUTHENTICATOR' => 'PLAIN'

$conn = imap_open(


Altibox without mediaconverter and ZyXEL


Much power consuming equipment and unnecessary hops in my rack pushed me to eliminating the Altibox mediaconverter and ZyXEL 2812 router.

The setup is usually:

Altibox BiDi 1310/1550 SM fiber -> SC Mediaconverter (tx1310 rx1550) -> ZyXEL 2812 router.

What I did was first tagging through the Internet VLAN from the mediaconverter via my switch to my ZyWALL USG-50. Step two will be to add a SFP to the switch to eliminate the mediaconverter. I used port 24 (dual personality GE copper/SFP) for the incoming trunk, and port 22 (GE copper) for the downlink to the switch.

Since i have my fibers terminated in a patch panel, I can use a SC-LC cable directly into a SFP.

I _could_ have added a WAN vlan on my ZyWALL USG-50 to route the traffic directly here, but that would mean having to reconfigure to an additional interface.

Tagged VLANS incoming from Altibox to 2812:

101: TV


  1. Enable bridging mode for your subscription on partnerpage (not sure if this is needed)
  2. Configure vlan 102 on the switch
  3. Add tagged 102 to port 24
  4. Add untagged 102 to port 22
  5. Connect mediaconverter to 24
  6. Connect your own router to port 22
  7. (optional) Add SFP BiDi BX-D (tx1310 rx 1550) to port 24. If you have a SC port on your mediaconverter, you may need a SC to LC adapter, or SC-SC adapter with a SC-LC cable.


Not sure if it is possible to tag vlans for TV, since I do not have these services, I am unable to experiment. Since VoIP require som sort of SIP user/pwd and reg server, this most certantly is impossible. TV should work if your switch is multicast enabled or "unaware".

Perhaps it is needed to to some MAC spoofing, but since bridging is possible, I will try without and see how it works.




Check_MK bleeding edge

I have been doing som OMD/Check_MK bleeding edge testing and development, aswell as collecting interesting plugins and locals. Running a Debian Wheezy box on ESXi

My notes:

Get and install the last omd package (as of 3 june 2014):

wget ""
dpkg -i omd-1.11.20140601.wheezy.i386.deb

Stop and upgrade the site:

omd stop <sitename>
omd update <sitename>
omd start  sitename>

Check for errors and reload

omd su <sitename>
cmk -R

Once in a while I've had some settings that do not upgrade successfully, and I've had to hunt bugs. One error that occurs, is the reset of NagVis rights when using MultisiteRights ( This document has not been updated to reflect the latest changes, the file is now defined by a variable called "authorisation_multisite_file", which is placed at ~/var/check_mk/wato/auth/auth.php. This variable also must be set.

To fix this, i have to set these properties each time i upgrade:

omd su <sitename>
vim ~/etc/nagvis/conf.d/auth.ini.php




The new OMD packages has native support for ESXi host monitoring (and automatic mapping VM<->Hosts). See Check up on the section about piggybacking for mapping vm-names with wato-host-names if these are not identical.

Plugins that I use besides the automaticly installed ones:

lm-sensors package, neatly packed by BenV:

apache_status (update the servers variable to hardcode which servers to monitor - autodetect is not working as intended for multiple servers. I usually set it to "servers = [ ( 'http', '::1', 80 ),( 'https', '::1', 443 ) ]"

check_apt (for checking debian packages)

mk_mysql - needs username/pwd in configfile, so watch out.


Monitoring Raspberry Pi fw versions with check_mk

Modified to work with my omd/check_mk setup for monitoring firmware versions on rpi farm.


raw_firmware=`/opt/vc/bin/vcgencmd version`
date_version=`echo $raw_firmware | awk '{print $1,$2,$3,$4}'`
git_version=`echo $raw_firmware | awk '{print $10}'`
echo "0 RpiFirmwareVersion hash=($git_version) $date_version ($git_version)"
exit 0


vim /usr/lib/check_mk_agent/local/RpiFirmwareVersion
chmod +x /usr/lib/check_mk_agent/local/RpiFirmwareVersion



New pet project up:

This is a pure javascript offline projects where i try to implement a tool for commuters and tourists in western Norway.

  1. Manually (sigh..) create xml objects from routes on the ferryoperator's webpage
  2. jquery parse these and create a live webpage
  3. use localStorage (for the most part) to do the settings-bit

What I plan is to use phonegap to create native android and ios apps for full offline functionality. I have to a certain extent implemented a warning/notification system - but this is an online function.

Dev builds are being pushed @ (courtesy of trusty jenkins)

git repo:

Tagged as: , , , No Comments

Setting up relay for an Axis IP-camera

I tried googling how to set up a relay for an internal IP-camera on a public webserver.  I have an Axis 211M with username/password root:root on ip The source is MJPEG, and after some packet inspection i identified the boundary to be "--myboundary" for the multipart.

Not much (useful) showed up on google, so I ended up doing this:


header('Content-Type: multipart/x-mixed-replace; boundary=--myboundary');


Keep in mind, this is only a 1:1 relay, and no caching is enabled. It will also choke your webserver if you do a lot (?) of connections.


RiksTV in Windows 7

I just changed from Altibox (IPTV) to RiksTV (DVB-T) and wanted to get this to work on Windows and Linux. Windows was easy enough:

DVBViewer Pro v4.8.1.0

Hauppauge! WinTV-HVR-1300
Hauppauge! WinTV-CI-USB2

Installation without any problems. Drivers found by windows by default, but downloaded official drivers on Hauppauge! webpage and installed just in case. All encrypted channels decode great, and watching TVNorge in full hd is nice 🙂
Now going to try getting it to work in Linux, but since the CI is not supported in Linux, I will try with softcams and some SC readers. I have a SmartCard USB reader from Norsk Tipping ready, aswell as ordered a SMARGO SmartCard Reader off ebay. It would be nice to be able to watch RiksTV in XMBC on my HTPC. Perhaps with tvheadend?



Installing ESXi 4.1 on a Whitebox

Installing ESXi 4.1 on a Whitebox:

* System: Gigabyte EP45-DS3L with Intel Core2Duo Quad Q6600. (no VT-d implementation on NB)
* NIC: RTL8139 onboard
* Raid: 3ware 9650 PCIe x4 4-port version.

1) Make a bootable installation USB-pen/drive. [1] I used a 320gb usb 5400rpm drive from some laptop.

2) Format it with fat32.
3) Get Syslinux, not the version 4, but an older version. I used 3.86 from here [2] Version 4 can give you an error on boot, "invalid c32 image".
4) Run syslinux: syslinux.exe -m -f -a S: (S: being the drive letter).
6) Extract the iso, copy contents to usb drive
7) Rename isolinux.cfg to syslinux.cfg.

8 ) Add custom drivers to boot-disc

9) Identify the drivers you need, and get them. You may need to find vendor-id and device-id and do some googling. See this [4] page for a good list
10) Customize an oem.tgz file using the instructions here [5]
11) Copy oem.tgz to usb drive.
12) Modify syslinux.cfg to include loading the oem.tgz: add " --- oem.tgz" to the end of the following line:
append vmkboot.gz --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

13) Optional: kickstart file. I had an issue with not being able to use my keyboard, so used a kickstart file.

13.1) Add a file called ks.cfg on the usb-drive with the following contents:
rootpw password
autopart --firstdisk --overwritevmfs
install usb
network --bootproto=dhcp --device=vmnic0
13.2) Modify the syslinux.cfg, add "ks=usb" after vmkboot.gz:
append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- oem.tgz

14) Add custom drivers to esxi installation.

15) Modify the oem.tgz on the running installation to include the drivers. This file is located in /bootbank/oem.tgz. I booted with a rescue disk, mounted the
root partition and copied the oem.tgz to another machine. THere i modified it using the same procedures as described in [5] and copied it back.



Vektorspillet (no-nb)

I got dared to make a pc version of some game. so i did. mostly.

Get it here (XNA 4.0)

You will need the redistributable for xna4 aswell:

Filed under: .NET, Programming, XNA 1 Comment

Syncing Exchange with iPad does weird things to my appointments

After importing an US iPad, and syncing it to my Exchange my appointments were 10 hours off. Due to some weird US city name being default, I overlooked one setting that put everything right. Why it's not set to automatic beats me: