runnane Everything that matters ++

22Mar/160

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'

Example:
$conn = imap_open(
"{outlook.office365.com:993/imap/ssl}Inbox",
'username@domain.com\shared_mailbox_alias',
'mypassword',
OP_READONLY,
1,
array('DISABLE_AUTHENTICATOR' => 'PLAIN')
);

14Feb/140

Ferjeruta

New pet project up: ferjeruta.no

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 @ git.ferjeruta.no (courtesy of trusty jenkins)

git repo: https://bitbucket.org/runnane/ferjeruta

Tagged as: , , , No Comments
19May/130

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 172.20.100.15. 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:

<?php

set_time_limit(0);
header('Content-Type: multipart/x-mixed-replace; boundary=--myboundary');
readfile('http://root:root@172.20.100.15/mjpg/video.mjpg');

?>

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.

7Feb/111

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:

http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=A88C6DEC-AEAE-42CD-A108-D35C013C3B97

Filed under: .NET, Programming, XNA 1 Comment
18Jul/080

Checking checkboxes, not always a breeze

So, I was sitting here and debugging some code for more than three hours. And finally, I figured it out: You cannot set a checkbox as checked until you have appended it to a container.

Code that does not work:

var newEl = document.createElement('input');
newEl.type = 'checkbox';
newEl.value = 'yes';
if(value == '1'){
   newEl.checked = "checked";
}
                               
$('AttributeValue_Container').appendChild(newEl);

Working code:

var newEl = document.createElement('input');
newEl.type = 'checkbox';
newEl.value = 'yes';

$('AttributeValue_Container').appendChild(newEl);
if(value == '1'){
  newEl.checked = "checked";
}

Really annoying 😉

Filed under: HTML/JS No Comments
5Mar/080

HttpContext.Current.Items

Great method for sharing info in different layers in ASP.NET without passing anything between them.

http://www.mikeduncan.com/3-hot-uses-for-httpcontextcurrentitems-they-wont-tell-you-about

Filed under: .NET No Comments