Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / developing_with_nix.md
Last active March 29, 2019 11:03
Developing with Nix (Nodejs, Haskell, Python, PHP, Emscripten) #nix #nixpkgs #nixos #python
@CrackerJackMack
CrackerJackMack / 01_README.md
Created June 4, 2017 05:33
systemd # workaround

This is my take on a systemd#2741 work-around. The lack of native namespace joining makes it so you have to do a dance with systemd's version of private namespaces and iproute2's version. The portal_network.sh is my rendition of iproute2.
Credit to ian-kelling's code and comment in the systemd issue that inspired me to research this further. Looking at iproute2's source the bash script should be identical, including the private mount and bind mounts. This level of compatibility gives the administrator the ability to use ip -n portal ... for any subsequent commands.

Files are dash separated due to this being a gist (slashes aren't allowed). PLace the files in the correct locations then run the following:

  1. systemctl enable portal.target portal.network.service whatever.service
  2. systemctl restart systemd-networkd # if using the vlan files and such
@zimbatm
zimbatm / README.md
Created March 29, 2017 09:32
Nixpkgs pinning example

Nixpkgs pinning example

This is an example of how to pin the version of nixpkgs in a package repo. The goal is to improve reproducibility, make sure all the developers use the same version of nixpkgs and also allow to share binary caches.

Usage

Put all these files in a nixpkgs folder and then in other derivations, instead of import <nixpkgs> {} use import ./path/to/nixpkgs {}

Keeping nixpkgs up to date

@jdeathe
jdeathe / openssl-self-signed-san-certificate.md
Last active June 24, 2022 03:48
How to generate a self-signed SAN SSL/TLS certificate using openssl

How to generate a self-signed SAN SSL/TLS certificate using openssl

Generating a self-signed certificate is a common task and the command to generate one with openssl is well known and well documented. Generating a certificate that includes subjectAltName is not so straght forward however. The following example demonstrates how to generate a SAN certificate without making a permanent change to the openssl configuration.

Generate a list of all required DNS names, (Note: CN will be discarded).

$ export SAN="DNS:www.domain.localdomain,DNS:domain.localdomain"
@cryzed
cryzed / fix-infinality.md
Last active May 8, 2024 17:00
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

Build Rust with Emscripten support

For more up2date information: http://www.hellorust.com/emscripten/

Emscripten is the LLVM-based project to compile stuff into JavaScript. Luckily, Rust already uses LLVM and just recently got an upgrade to the used version of LLVM. Now emscripten uses a fork of LLVM, which is on the way to use more or less the same base LLVM as Rust. See the next-merge branch.

Simple 13 step recipe to build Rust with Emscripten support

@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
set nocompatible " be iMproved, required
set hidden
filetype off " required
" line numbers
set number
set relativenumber
set backspace=2 "allow deleting any chars in insert mode
set laststatus=2
set ruler " show the cursor position all the time
@jethrolarson
jethrolarson / _usage.js
Last active April 25, 2016 01:10
xface - Functional Interface library for typed common apis
//Some fantasy implementations
const Just = require('./just')
const Cant = require('./cant')
const List = require('./list')
//Spec file that defines what arguments are used for type identification
const fantasy = require('./fantasy')
//The magic.
const {chain, map, index} = require('../../src/xface')(fantasy, [Just, Cant])
@raine
raine / ramda
Last active May 4, 2020 12:14
Browse Ramda documentation in Terminal
#!/usr/bin/env bash
# Browse Ramda documentation in Terminal
# Requires jq and a tool such as fzf or peco for interactive filtering
LATEST="http://raine.github.io/ramda-json-docs/latest.json"
DOCS_URL="http://ramdajs.com/docs/"
json=$(curl -s $LATEST)
functions=$(echo "$json" | jq -r '.[] | if .sig and (.sig | length > 0) then .name + " :: " + .sig else .name end')