Skip to content

Instantly share code, notes, and snippets.

View non7top's full-sized avatar

non7top non7top

  • Pattaya
  • 09:10 (UTC +07:00)
View GitHub Profile
@non7top
non7top / with_backoff.sh
Created April 11, 2016 19:07
bash function to retry with backoff
function with_backoff {
# http://stackoverflow.com/questions/8350942/how-to-re-run-the-curl-command-automatically-when-the-error-occurs
# by phs
#
# The retry count is given by ATTEMPTS (default 5), the initial backoff
# timeout is given by TIMEOUT in seconds (default 1.)
#
# Successive backoffs double the timeout.
local max_attempts=${ATTEMPTS-5}
@non7top
non7top / rdiffweb.conf
Last active January 15, 2017 00:43
Example configuration for nginx
location /rdiffweb {
rewrite ^([^\?#]*/)([^\?#\./]+)([\?#].*)?$ $1$2/$3 permanent;
# substitute with rdiffweb url
proxy_pass http://127.0.0.1:18080/;
# for https
#proxy_redirect http://example.com https://example.com/rdiffweb;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@non7top
non7top / upload.php
Created February 5, 2016 12:56
simple upload script
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-utf-8">
<title>utf</title>
</head>
<body>
<?php
print "<h1>#p@$c@#</h1>\n";
echo "Your IP: ";
echo $_SERVER['REMOTE_ADDR'];
@non7top
non7top / sni-sniff.py
Last active March 17, 2019 05:12
Allows to dump the hostname header from sni handshake
import os
import BaseHTTPServer, SimpleHTTPServer
import ssl, socket
CERTIFICATE_PATH = os.getcwd() + '/server.crt'
KEY_PATH = os.getcwd() + '/server.key'
def verify_tls(socket, hostname, context, as_callback=True):
print "SNI hostname: ", hostname
# Purpose : System backup
# Modified 14 Feb 2011
echo "Initializing backup process - " `date`
logger -t backup "System Backup started"
backvol=/bkpv
#
# Sanity Check
#
@non7top
non7top / sysctl.conf
Last active September 14, 2015 07:48 — forked from kfox/sysctl.conf
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
#palemoon
prompts.tab_modal.focusSwitch;false
gfx.downloadable_fonts.enabled;false
@non7top
non7top / notaries
Last active January 17, 2017 11:58
https://non7top.tk/notary/
-----BEGIN PUBLIC KEY-----
MIHKMA0GCSqGSIb3DQEBAQUAA4G4ADCBtAKBrAHNEJQiiQdn5xTMJ3201H9wbR+Y
3VCFGGtrxmGQw5Os7zz+fpmtNxmVr68Yz7s3LfNgWiJDpTiCt+buFwcSY8RuUp7p
1Cv3RSHsivh7VJO+m2Wm/wfl7rXJELAyoP36WcK9SK/RLJqFxTYcTJPs+bSknot9
cP7MHZmsBJ8090Yy5WJqLnPTekhEIFbtIElbW6aHaXN6Obk9wtqDR69d3ztBLTsj
YmTxy9V/g2MCAwEAAQ==
-----END PUBLIC KEY-----
http://ec2-52-213-71-206.eu-west-1.compute.amazonaws.com:8080/
@non7top
non7top / install_local.sh
Last active January 30, 2016 17:34
Install local version of openssl/curl/python2
#!/bin/bash
set -e
source $HOME/local.env
PKGS_FILE=$LOCAL_PATH/.packages
install_openssl() {
VERSION="${1:-1.0.2d}"
cd $TMP
wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile
echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.bash_profile
cpanm