Skip to content

Instantly share code, notes, and snippets.


Daniel Lo Nigro Daniel15

View GitHub Profile
Daniel15 /
Last active Dec 6, 2018
Routing scripts for Tinc

This Gist contains some scripts for Tinc, in order to configure the routing tables for a remote subnet on Windows (ie. if a remote system wants to expose an entire subnet over the VPN). Tinc does not configure the routing tables by default, which is why these scripts are needed. See the mailing list thread here:

Place the files in the Tinc network directory (eg. C:\Program Files\Tinc\netname\) and change $interface in functions.ps1 to match the name of the Tinc interface configured in tinc.conf

import sys
import extract_icon
import os
import argparse
class MorIcons:
parses an ``APPS.INF`` file, dumps all icons from a PE binary and
generates an HTML file with all the icons and associated program
gaearon /
Last active Apr 8, 2021
A Gentle Introduction to Prepack, Part 1


When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
cherti /
Created Dec 9, 2016
send a dummy alert to prometheus-alertmanager
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
iamarcel / Structuring Neat .NET Core Command Line Apps
Created Sep 7, 2016
Structuring Neat .NET Core Command Line Apps Neatly
View Structuring Neat .NET Core Command Line Apps
iamarcel / Creating Neat .NET Core Command Line
Last active Mar 15, 2021
Creating Neat .NET Core Command Line Apps
View Creating Neat .NET Core Command Line

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat

julianlam / gist:07abef272136ea14a627
Last active Feb 23, 2021
Exposing a directory on the host machine to an LXC container
View gist:07abef272136ea14a627

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
    • Both of these paths are relative to the host machine.
adammw / facebook-anonymiser.js
Last active Aug 29, 2015
Remove names from Facebook posts and comments allow them to be screenshotted and posted to internet forums without exposing user identities.
View facebook-anonymiser.js
(function() {
var hash = {};
var anonymise = function() {
// Handle links to user profiles, e.g. those shown when someone likes a post'[data-hovercard*="user.php"], [data-hovercard*="hovercard.php"]'), function(hovercardLink) {
if (!hovercardLink.dataset.hovercard) return;
var id = /id=(\d+)/.exec(hovercardLink.dataset.hovercard)[1];
var hue = hash[id] = hash[id] || (Math.random() * 360); = 'hsl(' + hue + ',55%,60%)';
prabirshrestha / Bootstrapper.cs
Last active Mar 31, 2018
Server side reactjs rendering in Nancy with React.NET
View Bootstrapper.cs
public class Bootstrapper : DefaultNancyBootstrapper
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
base.RequestStartup(container, pipelines, context);
var react = new ReactEnvironment(
new JavaScriptEngineFactory(),
new ReactSiteConfiguration(),
new NullReactCache(),
bevacqua / gulp-npm-publish.js
Created Jan 18, 2014
Publish packages to `npm` using Gulp.
View gulp-npm-publish.js
var spawn = require('child_process').spawn;
gulp.task('npm', function (done) {
spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);