Monday, February 4, 2013

Add Twitter Bootstrap to MVC4

Unzip bootstrap files into the /Content directory.

Add the following lines to App_Start/BundleConfig.cs


bundles.Add(new StyleBundle("~/Content/bootstrap/css/bundle")
.Include("~/Content/bootstrap/css/bootstrap.css"));
bundles.Add(new ScriptBundle("~/Content/bootstrap/js/bundle")
.Include("~/Content/bootstrap/js/bootstrap.js"));


Add the following lines to View/Shared/_Layout.cshtml

@Styles.Render("~/Content/bootstrap/css/bundle")
@Scripts.Render("~/Content/bootstrap/js/bundle")

Note that jQuery must be included before the Bootstrap js-bundle.

Thursday, April 19, 2012

Using Thunderbird in Linux with Office 365

My company is using Office 365, but as a software developer with a passion for *nix I really can't live inside a windows environment. So for email use Thunderbird and the splendid Lightning addon together with a calendar provider for office 2010. It works great!

Thunderbird Lightning Calendar Office 2010
http://www.1st-setup.nl/wordpress/?page_id=133

Using calendars from Office 365
http://www.1st-setup.nl/wordpress/?wp_super_faq=add-a-microsoft-office-365-calendar

Wednesday, April 27, 2011

Installing rmagick on ubuntu 10.04

I just installed ruby and rmagick on an ubuntu 10.4 server. Got some errors during the installation and thought i should summarize the procedure here:

Install ruby

sudo apt-get install ruby1.9.1 rubygems1.9.1


Install imagemagick


sudo apt-get install imagemagick


Tried to install rmagick

sudo gem install rmagick


Got this error:

ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1:in `
'


Found this page, which pointed med to install ruby1.9.1-dev package.


sudo apt-get install ruby1.9.1-dev


Ok, trying again to install rmagick

sudo gem install rmagick


Got this error:

ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.


Found this question on superuser.com which pointed me to install the libmagickwand-dev-package.

sudo apt-get install libmagickwand-dev


Finally, another attempt to install rmagick

sudo gem install rmagick




Building native extensions. This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Updating class cache with 0 classes...
Installing RDoc documentation for rmagick-2.13.1...


Success!

Thursday, April 7, 2011

DavMail and microsoft online exchange

DavMail

URL: https://red002.mail.emea.microsoftonline.com/EWS/Exchange.asmx
Enable EWS - check

IMAP
Server name: localhost
Port: 1143
User name: username@domain.com

SMTP
Server name: localhost
Port: 1035
Connection security: none
Authentication method: Password, transmitted insecurely
User Name: username@domain.com

LDAP
Hostname: localhost
Base DN: ou=people
Port number: 1389
Bind DN: username@domain.com

Wednesday, February 23, 2011

Wireless streaming from Spotify to PS3


After many hours trying to get wireless streaming from Spotify to Playstation 3, I finally found a working solution on Linux (ubuntu).

My setup:


I used the solution described in this blog.

But I failed miserable with only streaming the echoes of silence...

Then I found another Spotify streaming blog post, only this time for squeezebox.

This inspired me to try the same trick creating a PulseAudio null-sink.

pactl load-module module-null-sink sink_name=spotify


Setting the sound output to the new sink:



install the lame encoding library to be able to stream mp3:


sudo aptitude install gstreamer10.0-plugins-ugly-multiverse


make sure icecast is running

/etc/init.d/icecast2 start


and then fire up a mp3 stream:

gst-launch-0.10 pulsesrc device=spotify.monitor ! audioconvert ! lame bitrate=320 mode=stereo ! shout2send ip=localhost port=8000 password=PASSWORD mount=spotify.mp3


I then added the following line to my WEB.conf in the ps3mediaserver root folder:

audiostream.Web=Spotify,http://localhost:8000/spotify.mp3


Now start up your PS3 and PS3 Media Server. On your PS3 go to the 'Audio' section, select 'PS3 Media Server', Web-folder and Spotify. Be patient it takes a couple of seconds before it starts.

Thursday, March 25, 2010

Basic authentication - CXF Tips and Tricks Part 1

I'm starting a new blog post series with Apache CXF tips and tricks. In this first post I'll show you how to do communicate with a Web Service together with HTTP Basic authentication.

Below is an example of HTTP Basic authentication with username 'johnsmith' and password 'sesame99'.


URL wsdl = getClass().getResource("myservice.wsdl.xml");
MyService service = new MyService(wsdl).getMyServicePort();
BindingProvider bp = (BindingProvider)service;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "johnsmith");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "sesame99");