Skip to content

Instantly share code, notes, and snippets.

@ste-fan
ste-fan / ntpdate
Last active February 26, 2016 22:27
ntpdate-debian configuration file that screens NetworkManager's latest DHCP leases for NTP servers
# The settings in this file are used by the program ntpdate-debian, but not
# by the upstream program ntpdate.
# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=yes
# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.
NTPSERVERS="ntp.ubuntu.com"
@ste-fan
ste-fan / inhibit-shutdown-sleep-wrapper.py
Last active November 30, 2017 03:23
Manage app dependant suspend / hibernate and shutdown actions (example: Pidgin disconnecting IM accounts), easily adaptable
#!/usr/bin/env python
## /usr/local/share/functions/inhibit-shutdown-sleep-wrapper.py
##
## inhibit shutdown and sleep as long as program is running (using delay mode)
## so that linked app can do necessary stuff before shutdown and sleep
##
## make symbolic link to this file named as the program executable
## that shall be run between DBus calls and put it in /usr/local/...
## directory that is in the PATH
@ste-fan
ste-fan / switchDisplay.sh
Created June 11, 2014 12:52
Script to toggle display configuration on a laptop
#!/bin/sh
# Script to toggle display configuration on a laptop
# authors: Ruben Verhack, ste-fan
config="/tmp/display.conf"
# get output names with `xrandr -q`
external=VGA1
extMode='--mode 800x600'
internal=LVDS1
intMode='--auto'
@ste-fan
ste-fan / s_dplyr.R
Last active August 29, 2015 14:01 — forked from jknowles/s_dplyr.R
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc.
# Author: Sebastian Kranz
# Examples are below
#' Modified version of dplyr's filter that uses string arguments
#' @export
s_filter = function(.data, ...) {
eval.string.dplyr(.data,"filter", ...)
}