Skip to content

Instantly share code, notes, and snippets.

View bersace's full-sized avatar

Étienne BERSAC bersace

View GitHub Profile
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@elijahmanor
elijahmanor / .zshrc
Created February 18, 2018 01:09
aliases
function npmReset() {
folder="$(pwd | rev | cut -d '/' -f1 | rev)"
cowsay "Starting to reinstall node_modules for $folder"
rm -rf node_modules
npm install -s
cowsay "Finished reinstalling node_modules for $folder"
npx node-notifier-cli -m 'npm modules reinstalled' -s Glass
say "Finished reinstalling node modules for $folder"
}
alias npm-reset="npmReset"
@Informatic
Informatic / README.md
Last active May 23, 2024 02:47
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.

@tcotav
tcotav / prom_nodex_coreos.md
Created April 18, 2016 19:44
Running Prometheus's node_exporter in Docker container for use with CoreOS nodes

ref: (prometheus/node_exporter#66)

docker pull prom/node-exporter
docker run -d -p 9100:9100 -v "/proc:/host/proc" -v "/sys:/host/sys" -v "/:/rootfs" --net="host" prom/node-exporter -collector.procfs /host/proc -collector.sysfs /host/proc -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
import sys, marshal, functools, subprocess
child_script = """
import marshal, sys, types;
fn, args, kwargs = marshal.load(sys.stdin)
marshal.dump(
types.FunctionType(fn, globals())(*args, **kwargs),
sys.stdout)
"""
@p3t3r67x0
p3t3r67x0 / openssl_commands.md
Last active May 22, 2024 02:19
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@ramnes
ramnes / config
Last active January 23, 2020 10:42
Modeless Uzbl config, à la Emacs
# Default locations
set cache_home = @(echo $XDG_CACHE_HOME)@
set config_home = @(echo $XDG_CONFIG_HOME)@
set data_home = @(echo $XDG_DATA_HOME)@
set prefix = @(echo $PREFIX)@
set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts
# Default variables
set default_mode = insert
set fifo_dir = /tmp

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@kived
kived / aptly-process-incoming.py
Created March 3, 2015 22:44
aptly: import from .changes files
#!/usr/bin/env python3
REPO_FORMAT = 'eepa-{dist}-build'
import sys
import os, os.path
import hashlib
import subprocess
def parse_changes(filename):