Skip to content

Instantly share code, notes, and snippets.

View MartinJohns's full-sized avatar

Martin Johns MartinJohns

  • Hamburg, Germany
View GitHub Profile
@mgedmin
mgedmin / gist:9547214
Created March 14, 2014 12:59
Setting up a Jenkins slave on Linux
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
@jakesays-old
jakesays-old / GuardedReaderWriterLock.cs
Last active December 21, 2015 16:29
Reader/writer lock with auto guard support
using System;
using System.Threading;
/// <summary>
/// Simple ReaderWriterLockShim wrapper that exposes read and write
/// guards.
/// </summary>
public class GuardedReaderWriterLock
{
@jarrettmeyer
jarrettmeyer / HttpSession.cs
Created February 17, 2013 14:58
How to work with sessions in .NET
public abstract class HttpSession : IHttpSession
{
protected IKeyValueStore storage;
public virtual int UserId
{
get { return Get<int>("user_id"); }
set { storage["user_id"] = value; }
}