Skip to content

Instantly share code, notes, and snippets.

@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@headius
headius / irb.txt
Created February 12, 2013 21:08
Example of Binding.of_caller in JRuby
ext-jruby-local ~/projects/jruby $ jruby -X-C -S irb
irb(main):001:0> def foo
irb(main):002:1> a = 1
irb(main):003:1> bar
irb(main):004:1> puts a
irb(main):005:1> end
=> nil
irb(main):006:0> def bar
irb(main):007:1> eval 'a = 2', Binding.of_caller(1)
irb(main):008:1> end
@pezz
pezz / crypto-pi-root.md
Last active December 17, 2020 15:40
Archlinux ARM encrypted root

Intro

Just some FYI, to get started:

  • I'm using a 16 GB Sandisk SD card.
  • I have a model B Pi, 512 MB RAM (not really relevant, thought I'd mention it).
  • Monitor and keyboard connected to the Pi itself, for now.
  • Network working, internet access.
@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@ArnisL
ArnisL / tmux_24_bit_colours.c
Last active November 2, 2019 18:59
tmux 24 bit colour support
From 9bc0f9402df5155065e4c31eed0e986b700df717 Mon Sep 17 00:00:00 2001
From: Arnis Lapsa <arnis.lapsa@gmail.com>
Date: Fri, 2 Aug 2013 16:15:46 +0300
Subject: [PATCH] 24bit colour support
---
colour.c | 6 ---
input.c | 30 +++++++++++++-
screen-write.c | 85 +++++++++++++++++++++++++++++++++++++-
tmux.h | 11 +++++
@JanBe
JanBe / github.com.js
Last active October 25, 2016 16:14
Some improvements for GitHub's pull request view (using https://github.com/defunkt/dotjs)
$(function() {
addProgressBar = function() {
checked = $('.discussion-timeline input:checkbox:checked.task-list-item-checkbox').length
total = $('.discussion-timeline .task-list-item-checkbox').length
progress = (checked / total) * 100.0
bar = '<div class="discussion-sidebar-item progress">'
bar += '<h3 class="discussion-sidebar-heading">Progress</h3>'
bar += '<span class="progress-bar">'
bar += '<span class="progress" style="width: ' + progress + '%">'
bar += '&nbsp;'
@soellman
soellman / easy-k8s-coreos.md
Last active July 22, 2019 14:10
Easy Kubernetes on CoreOS

Easy Kubernetes Installation on CoreOS

At Timeline Labs, we are continuously looking at new technologies to see what fits our needs. We are especially excited about Kubernetes from Google to manage our services atop Docker and CoreOS.

This process for installing Kubernetes on CoreOS uses Flannel for Kubernetes networking and should be cloud provider agnostic. To deploy the Kubernetes master functionality into the cluster, it uses fleetctl.

Thanks to Kelsey Hightower and his blog posts! They served as a great starting point for this process.

How do I get this running?

Add the cloud config below to your own and bring up your cluster using a CoreOS version with Docker 1.3 (currently v472.0.0 in alpha). During that initial boot, the download-kubernetes and download-flannel units will download binaries from the latest project release and use those.

@romaninsh
romaninsh / swapon.service
Created December 1, 2014 10:05
Set up swap on CoreOS
create this file in your /root folder
$ fleetctl load swapon.service
$ fleetctl start swapon.service
This will create swap file on all nodes of your CoreOS cluster without prior setup.
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted
@mganeko
mganeko / signaling_mqtt.html
Last active June 6, 2023 07:30
WebRTC signaling over MQTT
<!DOCTYPE html>
<html>
<head>
<title>MQTT signaling</title>
<meta charset="urt-8"/>
<script src="http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.javascript.git/plain/src/mqttws31.js"></script>
</head>
<body>
<button type="button" onclick="startVideo();">Start video</button>
<button type="button" onclick="stopVideo();">Stop video</button>
@Stono
Stono / create-docker-tls.sh
Last active February 27, 2024 08:17
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#