Skip to content

Instantly share code, notes, and snippets.

View mgedmin's full-sized avatar

Marius Gedminas mgedmin

View GitHub Profile
@FauxFaux
FauxFaux / do-release-upgrade.md
Last active May 13, 2023 20:43
What does Ubuntu's do-release-upgrade script actually do?

Ubuntu encourage upgrading between releases by running a command, instead of by manually editing sources and getting on with it. This tool's name is do-release-upgrade, and I believe it should just be doing:

sed -i 's/wily/xenial/g' /etc/apt/sources.list /etc/apt/sources.list.d/*

This command does not explain what it wants to do, or why it is doing anything. It has, in the past:

  • Disabled repos I was using, and hence broken the software in them.
@anjohnson
anjohnson / triangle-workflow.md
Last active April 25, 2023 15:27
Triangle workflows

Triangle Workflows

A triangle workflow involves an upstream project and a personal fork containing a development branch of the project. This configuration makes git pull merge changes from the upstream but git push send local commits to the personal fork. However those config settings only work on relatively recent versions of git; 1.7.9 doesn't support the required remote.pushdefault config setting so you will have to explicitly tell git push which remote to push to.

This gist does not attempt to explain exactly what these commands do, it's intended as a cheat-sheet/reminder.

To set up a project area

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mgedmin
mgedmin / disk-inventory.py
Created June 22, 2012 11:17
disk-inventory
#!/usr/bin/python
"""
Produce a disk inventory for fridge:
- how many hard disks and how large
- how are they partitioned
- how are the RAID devices defined
- where are they mounted
- how much space is used and how much is free
@mgedmin
mgedmin / github_mirror.py
Last active January 13, 2022 07:46
Mirror all my github repositories and gists
#!/usr/bin/env python3
# See http://stackoverflow.com/questions/3581031/backup-mirror-github-repositories/13917251#13917251
# You can find the latest version of this script at
# https://gist.github.com/4319265
import os
import sys
import json
import urllib.request
import subprocess
@mgedmin
mgedmin / update-tcp-ports-html.py
Created January 14, 2012 00:49
Script to convert netstat -tln output into pretty HTML
#!/usr/bin/python
"""
Update TCP port assignments page in /var/www/HOSTNAME/ports/index.html.
"""
import datetime
import optparse
import os
import pwd
import socket
@mgedmin
mgedmin / conf.py.rst
Created July 22, 2013 10:37
HOWTO add "Show on GitHub" and "Edit on GitHub" links to the Sphinx sidebar

Edit on GitHub links for Sphinx

Create _ext/ and _templates/ subdirectories.

Move edit_on_github.py into the _ext/ subdirectory.

Move sourcelink.html into the _templates/ subdirectory.

Add the following after the import sys, os line :

if [ $EUID != 0 ]; then
echo "It's a weird tree."
else
echo ' _ __'
echo ' / `\ (~._ ./ )'
echo ' \__/ __`-_\__/ ./'
echo ' _ \ \/ \ \ |_ __'
echo ' ( ) \__/ -^ \ / \'
echo ' \_/ " \ | o o |.. / __'
echo " \\. --' ==== / || / \\ "
@joejulian
joejulian / set_gnome-terminal_transparency.sh
Last active March 25, 2021 15:01 — forked from nirbheek/set_gnome-terminal_transparency.sh
A tiny script to set the transparency of the current X window. If "all" is specified, it tries to find all gnome-terminal windows and applies the transparency to all of them.
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
: ${XWININFO:=$(type -P xwininfo)}
[[ -z ${XWININFO} ]] && { echo "You need to install xwininfo"; exit 1; }
: ${XPROP:=$(type -P xprop)}
[[ -z ${XPROP} ]] && { echo "You need to install xprop"; exit 1; }
@juliepagano
juliepagano / 101_off_limits.md
Last active December 16, 2020 09:37
101 conversations I generally don't want to have...

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.