Software Engineer. Stuff and nonsense. The usually short ramblings of Chris McKee.

Forcing SSLv3 Upstream in NGINX... fml

Sometimes you have to make sacrifices; often I wish I could place IT professionals at large Banks on a sodding Altar and cut their balls off. Anyway. In some rare horrible occasions, you need to force the type of SSL/TLS used for an upstream. You do that as follows. upstream shittyserver { server 8.8.8.8:443; } server { listen 443; server_name dodgyproxy.com; access_log /var/log/nginx/access.log; error_log /var/log/…

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

If you need a different version or are targeting a different version of Java, change version number accordingly the rest is the same. Going in hard; let's get some root on sudo su Enter password if you need to. If you prefer, you can enter sudo before each command. Install Java apt-get install openjdk-7-jre-headless Find Java Little tip: Installing locate helps a whole lot on Linux, in Ubuntu, it's usually installed by default (if it's not,…

Dear Umbraco… I Can Haz Content?!

Basic mission; code not my own. Create an advert type; consisting of URL and Image. Additional requirement created setting the type of advert (using uComponents) An AdvertContainer (Doc Type) With two 'types' of advert (i.e. 3rdparty/mpu) ThirdParty contains JS (no image/URL) MPU contains Image/URL var nodes = GetMultiNodeSelection(1101, "adverts"); Foists off into some god awful linq abuse… private IEnumerable<IContent> GetMultiNodeSelection(int id, string property) { var node = _contentService.…

Lowercase Routes in ASP.net MVC4

Back in MVC2 days I wrote a post on setting up a project with lowercase urls / redirecting and a workaround for IIS6. Luckily these days we have MVC4 which is a tad friendlier… to a degree. In the Route collection registration area (Most likely in App_Start lest you've moved it) you can now simply add routes.LowercaseUrls = true; (http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.lowercaseurls.aspx ) The big bugger about this…

Self Referencing Table Joins in FluentNHibernate

A common usage of the self-referencing joins is the use of 1 table for regions and subregions; its also the laziest example that comes to mind. Entity using System.Collections.Generic; using Domain.Base; public class Region : DomainObject<int, Region> { private IList<Region> _subRegion = new List<Region>(); public virtual string Name { get; set; } public virtual IList<Region> SubRegion { get { return _subRegion; } set { _subRegion = value; } } } ClassMap using Domain; using…