Skip to content

Instantly share code, notes, and snippets.

@wirewc
wirewc / x2go-cron-cleanup.sh
Last active July 12, 2018 23:58
Closes idle X2Go sessions that are open over 1 week.
#!/bin/bash
LIMIT_DAYS=7
TIME_ZONE=$(date +%Z)
DEBUG=false
for session in $(x2golistsessions_root); do
#Get state
state=$(echo $session|awk -F \| '{print $5}')
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
#!/bin/sh
# Replacement for raw "ksu" in kerberized environments;
# behaves more like "su -", and retains xauth data.
if [ $# -lt 1 ]
then
echo "Usage: `basename $0` <target user> [ <command> [ <arg> ] ... ]"
exit 2
fi