Skip to content

Instantly share code, notes, and snippets.

View starhawking's full-sized avatar
😼
Current Mode: Depeche

Emma May starhawking

😼
Current Mode: Depeche
View GitHub Profile
@jonringer
jonringer / configuration.nix
Created November 27, 2018 21:29
Hyper-V nixos instance
# configuration.nix for work hyper-v instance
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
@dougbtv
dougbtv / !readme.md
Last active December 18, 2018 04:49
You had ONE JOB -- A Kubernetes job.

You had ONE JOB -- A Kubernetes job.

Let's take a look at how Kubernetes jobs are crafted. I had been jamming some kind of work-around shell scripts in the entrypoint* for some containers in the vnf-asterisk project that Leif and I have been working on. And that's not perfect when we can use Kubernetes jobs, or in their new parlance, "run to completion finite workloads" (I'll stick to calling them "jobs"). They're one-shot containers that do one thing, and then end (sort of like a "oneshot" of systemd units, at least how we'll use them today). I like the idea of using them to complete some service discovery for me when other pods are coming up. Today we'll fire up a pod, and spin up a job to discover that pod (by querying the API for info about it), and put info into etcd. Let's get the job done.

This post also exists as a [gist on github](https

@dstanek
dstanek / make-ics.py
Last active October 20, 2016 21:15
Create a personalized iCal for the OpenStack Newton Summit schedule
#!/usr/bin/env python3
# Download https://www.openstack.org/summit/austin-2016/summit-schedule/mine/?goback=1
# to mine.html and then run this script. The my.ics can be imported into your
# calendar.
#
# Common problems:
# - i've only tested against my calendar (and got feedback about bugs from others) so
# so you may find the parsing isn't quite right
@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@jineeshjohn
jineeshjohn / gist:2044414
Last active December 5, 2018 18:59
Dynamic html table rows and column creation with jQuery
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<style>
table{
width:500px;
height:500px;
}
table td{
padding:10px;
margin:10px;
border:1px solid #ccc;