Skip to content

Instantly share code, notes, and snippets.

View nepsilon's full-sized avatar

James Pudson nepsilon

View GitHub Profile
@kaimi-
kaimi- / gist:6b3c99538dce9e3d29ad647b325007c1
Last active November 6, 2024 16:08
Possible IP Bypass HTTP Headers
CACHE_INFO: 127.0.0.1
CF_CONNECTING_IP: 127.0.0.1
CF-Connecting-IP: 127.0.0.1
CLIENT_IP: 127.0.0.1
Client-IP: 127.0.0.1
COMING_FROM: 127.0.0.1
CONNECT_VIA_IP: 127.0.0.1
FORWARD_FOR: 127.0.0.1
FORWARD-FOR: 127.0.0.1
FORWARDED_FOR_IP: 127.0.0.1
@janbraiins
janbraiins / estimate-1-btc-mining-cost.py
Last active October 2, 2022 15:28
Estimates cost for mining 1 bitcoin on a recent hardware
#!/usr/bin/python
el_cost_usd = 0.035
# network difficulty
ndiff = 15958652328578.91
block_reward = 6.25
# S9 with AB enabled consumes ~13% less energy (assuming 4-midstates enabled for AB)
# Below is a favorite overclocked configuration (15.6 Th/s , 1331 W)
efficiency_w_per_ths = 85.3
# S9: heavily downclocked
# efficiency_w_per_ths = 71
@dmportella
dmportella / makefile
Last active May 25, 2020 10:00
GOLANG Makefile Template
APPNAME?="docker-beat"
REPONAME?="dmportella"
TEST?=$$(go list ./... | grep -v '/vendor/')
VETARGS?=-all
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
REV?=$$(git rev-parse --short HEAD)
BRANCH?=$$(git rev-parse --abbrev-ref HEAD)
BUILDFILES?=$$(find bin -mindepth 1 -maxdepth 1 -type f)
VERSION?="0.0.0"
DOCKER_REPO?="${REPONAME}/${APPNAME}"
@alekseykulikov
alekseykulikov / index.md
Last active October 12, 2024 17:02
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@floudet
floudet / telnet-rfc-5322-email.sh
Created July 17, 2016 14:45
Send a RFC 5322 compliant email using telnet
$ telnet mail.example.org 25
Trying XXX.XXX.XXX.XXX...
Connected to XXX.XXX.XXX.XXX.
Escape character is '^]'.
220 *********************************
ehlo server.example.org
250-mail.example.com
250-PIPELINING
250-SIZE 20480000
250-ETRN
@jay3sh
jay3sh / guard-my-mabook-when-i-am-away.sh
Created March 30, 2016 16:46
Guard My Macbook When I'm Away
#!/bin/bash
#
# When you are working on your macbook sitting in cafe and you have to go pee,
# you need some way to guard you machine.
#
# Start this script, remove any earphones, and go do the job.
# The assumption is the thief will close the lid of the laptop before taking it away.
# This script detects the closing of the lid and plays some loud audio that will
# likely distract the thief and/or grab attention of nearby people, making the
@nathanleclaire
nathanleclaire / ssh-tunnel-proxy-digitalocean.md
Last active September 2, 2021 08:53
A description of how to get started using SSH tunneling. Intended for subverting network shaping and other nasty things imposed on you by arbitrary networks.

This is a method to create a proxy which is pretty simple and does not involve using shady websites or proprietary applications, etc.

  1. First, create a server, such as a DigitalOcean droplet.

  2. Once the server is created, verify that you can login via SSH:

    $ ssh user@<ip>
    
  3. If that is working, creating a local [SOCKS5] proxy using OpenSSH is just one command. Here is one suggestion:

@nijikokun
nijikokun / about.md
Last active January 24, 2024 08:48
Cool ways to Diff two HTTP Requests in your terminal!

Basic diffing

  • Line by line
  • No colors
  • Able to be piped into vim (shown later on)
diff <(curl -vs https://reddit.com 2>&1) <(curl -vs https://reddit.com 2>&1)
@syhw
syhw / dnn.py
Last active October 19, 2024 08:20
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@adriengibrat
adriengibrat / Object.prototype.watch.js
Last active April 23, 2020 19:24
Object.prototype.watch "polyfill"
/**
* Object.prototype.watch polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch
*
* Known limitations:
* - `delete object[property]` will remove the watchpoint
*
* Based on Eli Grey gist https://gist.github.com/eligrey/384583
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176
* This version is optimized for minification