Skip to content

Instantly share code, notes, and snippets.

View datatypevoid's full-sized avatar

Null Void datatypevoid

View GitHub Profile
@datatypevoid
datatypevoid / Makefile
Created February 15, 2021 16:18 — forked from maxymania/Makefile
secmalloc.c: Small, Secure Malloc implementation.
secmalloc.o: secmalloc.c
gcc -c -fPIC secmalloc.c -o secmalloc.o
secmalloc.so: secmalloc.o
gcc -shared -Wl,-soname,secmalloc.so -o secmalloc.so secmalloc.o
@datatypevoid
datatypevoid / getMoonPhase.ts
Last active September 11, 2022 15:42 — forked from endel/getMoonPhase.js
Get moon phase by Date, written in TypeScript. Accurate from year 1900 to 2199 inclusive.
export { EMoonPhase, EMoonPhaseName, MOON_PHASE_NAMES, moonPhase }
const { round, trunc: truncate } = Math
enum EMoonPhase {
New = 0,
WaxingCrescent,
@datatypevoid
datatypevoid / ssh-tunnel@.service
Created April 17, 2020 22:31 — forked from guettli/ssh-tunnel@.service
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@datatypevoid
datatypevoid / git-tag-delete-local-and-remote.sh
Created February 24, 2020 14:53 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@datatypevoid
datatypevoid / vagrant-qubes.md
Created September 1, 2019 10:55 — forked from xahare/vagrant-qubes.md
Vagrant on Qubes-OS

Vagrant on Qubes-OS

(Vagrant)[https://www.vagrantup.com] "Development Environments Made Easy"

(Qubes-OS)[https://www.qubes-os.org] "A Reasonably Secure Operating System."

This is a guide on to using vagrant on qubes-os with qemu using the libvirt provider. Because qubes-os does not support nested virtualization, you'r stuck with emulation. If you want performance, use a system with a proper vagrant setup.

Template Setup

/**
Code copyright Dustin Diaz and Ross Harmes, Pro JavaScript Design Patterns.
**/
// Constructor.
var Interface = function (name, methods) {
if (arguments.length != 2) {
throw new Error("Interface constructor called with " + arguments.length + "arguments, but expected exactly 2.");
}
this.name = name;
@datatypevoid
datatypevoid / Docker-on-qubes.md
Created March 11, 2019 19:23 — forked from xahare/Docker-on-qubes.md
How to run docker on Qubes-OS

Docker on Qubes

(Docker)[https://www.docker.com] a software container platform. You may have heard of it.

(Qubes-OS)[https://www.qubes-os.org] "A Reasonably Secure Operating System"

It takes a little work to get Docker running on qubes because you have to modify a templatevm. But, once you do it, you have the ease of compartmentalization qubes is famous for.

As of this writing the versions im using are,

@datatypevoid
datatypevoid / README.md
Created December 16, 2018 09:28 — forked from bvis/README.md
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@datatypevoid
datatypevoid / bind.wren
Created November 10, 2018 23:17
The bind method returns a new function that is called with a given sequence of arguments preceding any provided when the new function is called. Requires use of lists for arguments.
var concat = Fn.new { |l0, l1|
l1.each{|item| l0.add(item) }
return l0
}
var bind = Fn.new { |fn, args0|
args0 = args0 || []
return Fn.new { |args1|

NEXUS 5X: Fix lineage 14.1 OS vendor mismatch error (N2G47F)

Issue is due to the fact that lineage 14.1 bullhead nightlies are based on the 7.1.2 N2G47F (Apr 2017) monthly update from google.

More explanations in xda-developers.

PREREQUISITE

This assumes:

  • you already know a bit about flashing you android device and you already installed TWRP.