Skip to content

Instantly share code, notes, and snippets.

View madduci's full-sized avatar

Michele Adduci madduci

View GitHub Profile
@pdp7
pdp7 / torrc
Created September 6, 2014 06:47
DigitalOcean non-exit relay /etc/tor/torrc
ORPort 443
Exitpolicy reject *:*
Nickname EFFisMyHero
ContactInfo <pdp7pdp7 AT gmail dot com> GPG: 0x84D44A9317F1138E
Log notice file /var/log/tor/notices.log
RelayBandwidthRate 1024 KB
RelayBandwidthBurst 1024 KB
MaxAdvertisedBandwidth 1024 KB
DisableDebuggerAttachment 0
@draeath
draeath / gpg-agent.conf
Last active May 24, 2017 22:19
environment: homedir/.gnupg
pinentry-program /usr/bin/pinentry-gtk-2
default-cache-ttl 600
max-cache-ttl 7200
#enable-putty-support
enable-ssh-support
@NikoWoot
NikoWoot / reduce-size.dockerimage
Created December 19, 2014 08:37
Reduce size of Docker image
=================================================
After software installation
=================================================
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
=================================================
Docker on build process, include all files on directory build (include .git with old build)
Solution for reduce size of docker image (but for reuse is not good solution)
=================================================
@pdp7
pdp7 / install-tor.txt
Last active February 1, 2019 21:39
install tor non-exit relay on digital ocean
# My steps for creating a DigitalOcean server to run non-exit Tor node for just $5/mo
# Screen shots of my setup process: https://plus.google.com/photos/+DrewFustini/albums/6057260188204970945
# Create Digital Ocean account: https://www.digitalocean.com/
# Create Droplet on Digital Ocean: select $5/mo, and select Debian 7.0 64-bit
# This instructions are based on Tor Project: https://www.torproject.org/docs/tor-relay-debian.html.en
afustini@lappy486:~$ ssh root@107.170.203.104
root@107.170.203.104's password:
You are required to change your password immediately (root enforced)
Linux Tor300SoF 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
@dinobei
dinobei / nodejs.sh
Last active September 18, 2019 06:49 — forked from Gioyik/nodejs.sh
Script to cross compile NodeJS for ARMv7, Cortex-a5
#!/bin/sh -e
#Define our target device
export TARGET_ARCH="-march=armv7-a"
export TARGET_TUNE="-mtune=cortex-a5 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb"
#Define the cross compilators on your system
export AR="arm-none-linux-gnueabi-ar"
export CC="arm-none-linux-gnueabi-gcc"
export CXX="arm-none-linux-gnueabi-g++"
@bjornblissing
bjornblissing / CMakeManifest.txt
Last active February 22, 2022 08:27
CMake script to add manifest to exe-file
# Amend manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_TARGETNAME}
POST_BUILD
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaleing.manifest\" -inputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1
COMMENT "Adding display aware manifest..."
@chgeuer
chgeuer / brainpoolp256r1.cs
Last active April 22, 2022 11:17
Demonstrates how to use BouncyCastle with brainpoolp256r1 curve
namespace microsoft.chgeuer.crypto
{
// compile this baby against https://github.com/bcgit/bc-csharp
// or against NuGet <package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;
@WhisperingChaos
WhisperingChaos / ngnix.conf
Last active November 12, 2022 21:42
NGINX SSL/TLS Reverse Proxy to Upstream SSL servers.
events {
# nginx requires this section even when applying all default values
}
http {
# Upstream keyword is followed by a url (domain name/IP). This reference encapsulates
# the list of backend servers defined for a virtual proxy. When autnenticating
# a certificate from a backend server, the upstream url is supplied to the
# certificate authentication process instead of the backend server name. See
# the comments associated with proxy_pass below for a detailed discussion.
@bagder
bagder / trrprefs.md
Last active December 27, 2022 05:17
This once held TRR prefs. Now it has moved.

NOTE

This content has moved.

Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!

@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active June 28, 2023 15:12
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40