Skip to content

Instantly share code, notes, and snippets.

@efrecon
efrecon / run.tpl
Last active May 15, 2024 09:06
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@adymo
adymo / gist:7b1e6db801ed6ae5c36f
Last active May 3, 2019 13:07
Kubuntu 15.04 Linux on Dell XPS 13 2015 High DPI Setup

Xorg resolution [works]

  • not detected automatically from edid
  • check physical screen dimensions with xrandr
  • put those into /etc/X11/xorg.conf.d/90-monitor.conf
      Section "Monitor"
        Identifier ""
        DisplaySize 293 165 # xrandr reports 294, but 293 makes it 277x277dpi instead of 276x277
      EndSection
    
    
@k33g
k33g / RaspBerry_Pi.md
Created August 17, 2012 12:01
RaspBerry Pi
@rbraband
rbraband / example 1
Created February 24, 2012 14:12
Howto implement stored procedures within Redis
# Step 0 -- create test data
redis-cli HSET :object:30343552:data foo bar
# Step 1 -- store sample function 'sampleFunction'
redis-cli SET :functions:sample "redis.call('SELECT', 0);local data=redis.call('HGETALL',':object:' .. ARGV[1] .. ':data');return data"
# Step 2 -- create function loader
redis-cli SCRIPT LOAD "f=loadstring(redis.call('get',':functions:' .. KEYS[1]));return f()"
# Step 3 -- test
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@robcowie
robcowie / mongo_mapreduce_by_week.js
Created May 4, 2010 15:18
mongodb map-reduce to group by week
m = function() {
var getWeek = function(d) {
/*getWeek() was developed by Nick Baicoianu at MeanFreePath: http://www.meanfreepath.com */
dowOffset = 1;
var newYear = new Date(d.getFullYear(),0,1);
var day = newYear.getDay() - dowOffset;
day = (day >= 0 ? day : day + 7);
var daynum = Math.floor((d.getTime() - newYear.getTime() - (d.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1;
var weeknum;
if (day < 4) {