Skip to content

Instantly share code, notes, and snippets.

View datatypevoid's full-sized avatar

Null Void datatypevoid

View GitHub Profile
@jribal
jribal / install.sh
Last active December 24, 2019 10:29
RetroArch web player basic host installation script on docker nginx(ubuntu)
cd /usr/share/nginx/html
rm -r *
apt-get update && apt-get -y install wget nano git-core curl build-essential openssl libssl-dev python p7zip unzip
wget https://buildbot.libretro.com/nightly/emscripten/$(date +%Y-%m-%d -d "1 day ago")_RetroArch.7z
p7zip -d $(date +%Y-%m-%d -d "1 day ago")_RetroArch.7z
mkdir -p assets/frontend/bundle
mkdir -p assets/cores
chmod +x indexer
@guettli
guettli / [email protected]
Created December 22, 2017 11:40
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
@xameeramir
xameeramir / default nginx configuration file
Last active November 11, 2024 18:56
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@xahare
xahare / Docker-on-qubes.md
Last active October 16, 2024 15:30
How to run docker on Qubes-OS
@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@xahare
xahare / vagrant-qubes.md
Last active July 11, 2023 15:43
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

@bvis
bvis / README.md
Last active August 9, 2024 18:34
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:

@eliasdaler
eliasdaler / safe_reference.cpp
Last active June 5, 2021 03:40
Safe reference implementation. C++ part. See https://eliasdaler.github.io/game-object-references for details
#include <sol.hpp>
#include <string>
#include <iostream>
using EntityId = int;
class Entity {
public:
explicit Entity(EntityId id) :
name("John"), id(id)
@eliasdaler
eliasdaler / safe_reference.lua
Last active June 5, 2021 03:40
Safe reference implementation. Lua part. See https://eliasdaler.github.io/game-object-references for details
Handles = {}
local memoizedFuncs = {}
-- metatable which does magic
local mt = {}
mt.__index = function(handle, key)
if not handle.isValid then
print(debug.traceback())
error("Error: handle is not valid!", 2)
end
@joepie91
joepie91 / random.md
Last active November 16, 2024 19:07
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's