Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
: "${2:?Version} ${1:?Package name}"
# e.g. fftw
name=${1}
# e.g. 3.3.10
ver=${2}
arch=${3:-big_sur}
outfile="${name}_${ver}-${arch}.tar.gz"
echo Downloading ${outfile}
@OlliV
OlliV / paste.js
Created January 11, 2021 09:56
Allow pasting in Chromium when a site blocks it
var allowPaste = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('paste', allowPaste, true);
@OlliV
OlliV / cloudflare-azure_app.md
Created April 3, 2020 06:42
Use CloudFlare Origin certs with Azure App Services
  1. Create an origin certificate in CloudFlare

SSL/TLS -> Origin Server -> Create Certificate

  1. Convert the PEM cert to PFX
openssl pkcs12 -export -out domain.pfx -inkey domain.key -in domain.crt
@OlliV
OlliV / gist:c3da17db65b820007f36ed5b4e3725c7
Created December 25, 2019 21:40
MacOS low priority IO throtling
sudo sysctl debug.lowpri\_throttle_enabled
sudo sysctl debug.lowpri\_throttle_enabled=0
sudo sysctl debug.lowpri\_throttle_enabled=1
@OlliV
OlliV / table.cbl
Last active August 19, 2016 00:32
x[1] in COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INDX PIC 9(1) VALUE 1.
01 WS-TABLE.
05 Nmbrs OCCURS 5 TIMES PIC 9(1).
@OlliV
OlliV / gist:abcfd5879efe1c1ebe5026fd9912c1fc
Created May 8, 2016 16:03
Root shell access with Docker
% groups
docker
% docker run --privileged=true --volume /:/root -it ubuntu sh
# ls root
bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv swapfile sys tmp usr var
@OlliV
OlliV / gist:6deafc2a04e126e7c053
Created July 2, 2015 21:15
doubly linked list
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
struct node {
int x;
struct node * next;
};
void print(struct node * head)
@OlliV
OlliV / m0118.Xmodmap
Created January 15, 2015 13:56
xmodmap for Apple M0118
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam NoSymbol exclamdown
keycode 11 = 2 quotedbl 2 quotedbl at rightdoublequotemark at
keycode 12 = 3 numbersign 3 numbersign sterling guillemotright sterling
keycode 13 = 4 currency 4 currency dollar guillemotleft dollar
keycode 14 = 5 percent 5 percent U2030 leftdoublequotemark U2030
keycode 15 = 6 ampersand 6 ampersand singlelowquotemark doublelowquotemark singlelowquotemark
keycode 16 = 7 slash 7 slash braceleft NoSymbol braceleft
keycode 17 = 8 parenleft 8 parenleft bracketleft less bracketleft
@OlliV
OlliV / email.ini
Created January 15, 2015 13:52
Sailfish: Disable haptic notification for received emails
#/usr/share/ngfd/events.d/email.ini
[email => play.mode=short]
sound.profile = im_fg.alert.tone@general => sound.filename
sound.stream.event.id = event-in-call
#ffmemless.effect = NGF_SHORT
sound.stream.module-stream-restore.id = x-meego-ringing-volume
mce.led_pattern = PatternCommunicationEmail
#haptic.type = alarm
[email => play.mode=*,context@call_state.mode=active]
@OlliV
OlliV / emacs.patch
Created April 1, 2014 15:06
Add a new errno: EMACS - Editor too big.
From d8f85b3eeff44c31d21e987a4494ee1f8299322d Mon Sep 17 00:00:00 2001
From: Olli Vanhoja <olli.vanhoja@gmail.com>
Date: Tue, 1 Apr 2014 18:03:56 +0300
Subject: [PATCH] Add a new errno: EMACS - Editor too big.
Make a best-effort to detect that Emacs is about to executed and return the error.
---
fs/exec.c | 13 ++++++++++++-
include/uapi/asm-generic/errno.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)