Skip to content

Instantly share code, notes, and snippets.

Daniel Lo Nigro Daniel15

Block or report user

Report or block Daniel15

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Daniel15
Daniel15 / _README.md
Last active Dec 6, 2018
Routing scripts for Tinc
View _README.md

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: https://www.tinc-vpn.org/pipermail/tinc/2018-December/005340.html

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

View moricons.py
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
names
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active Sep 7, 2019
A Gentle Introduction to Prepack, Part 1
View prepack-gentle-intro-1.md

Note:

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
cherti / alert.sh
Created Dec 9, 2016
send a dummy alert to prometheus-alertmanager
View alert.sh
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@iamarcel
iamarcel / Structuring Neat .NET Core Command Line Apps Neatly.org
Created Sep 7, 2016
Structuring Neat .NET Core Command Line Apps Neatly
View Structuring Neat .NET Core Command Line Apps Neatly.org
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active Aug 8, 2019
Creating Neat .NET Core Command Line Apps
View Creating Neat .NET Core Command Line Apps.md

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
julianlam / gist:07abef272136ea14a627
Last active Jul 30, 2019
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
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
Array.prototype.forEach.call(document.querySelectorAll('[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);
hovercardLink.style.background = 'hsl(' + hue + ',55%,60%)';
@prabirshrestha
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
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);
});
You can’t perform that action at this time.