Skip to content

Instantly share code, notes, and snippets.

View dlsniper's full-sized avatar

Florin Pățan dlsniper

View GitHub Profile
#!/bin/bash
echo "This script will rebuild a Debian style package (deb) of latest stable"
echo "Nginx. The original deb is from nginx.org apt repository."
echo
echo "This will prompt you yes or no on a few changes to the build as well as"
echo "it will compile and package the latest Google NGX Pagespeed module."
echo
echo "This is built and tested on Ubuntu 12.04 LTS, fresh OS install."
echo "There are no guarantees, and I take no liability if it breaks, but it"
@dlsniper
dlsniper / tutorial.md
Last active February 28, 2020 07:56
How to build nginx from sources on Ubuntu
export LANGUAGE="en_US.UTF-8" 
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
locale-gen en_US.UTF-8 
dpkg-reconfigure locales

apt-get install unzip libpcre3 libpcre3-dev libssl-dev libpcrecpp0 zlib1g-dev debhelper dh-systemd libgeoip-dev autotools-dev libgd2-noxpm-dev libluajit-5.1-dev libmhash-dev libpam0g-dev libperl-dev po-debconf libexpat-dev libxslt1-dev
@dlsniper
dlsniper / example_parameters.go
Created February 11, 2015 21:36
Example on how to get URL parameters
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func demo(w http.ResponseWriter, r *http.Request) {
@dlsniper
dlsniper / main.go
Created March 29, 2015 11:19
HTTPS server in go using COMODO Wildcard SSL certificate (exported as nginx bundle)
package main
import (
"crypto/rand"
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
mr "math/rand"
"net/http"
@dlsniper
dlsniper / poor horse.json
Created July 19, 2015 21:29
just another attack
{
"remote_addr":"***",
"name":"home",
"status_code":200,
"method":"GET",
"request_uri":"/",
"headers":{
"Cache-Control":[
"no-cache"
],
@dlsniper
dlsniper / modifiedLog.java
Last active August 29, 2015 14:26
Modified Android Logging sample
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dlsniper
dlsniper / genpwd.sh
Last active September 1, 2015 20:30
Generate password with bash
#!/usr/bin/env bash
# This generates a password
# The MIT License (MIT)
#
# Copyright (c) 2015 Florin Patan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@dlsniper
dlsniper / sad2.php
Last active September 21, 2015 12:14
Inno solution for sadness
<?php
class human {
public function stop() {
print("https://youtu.be/DgvePeDIt3Y");
}
}
function sad() {
$return = isset($GLOBALS["sad_called"]) && $GLOBALS["sad_called"] === true ? new human() : true;
@dlsniper
dlsniper / cloc.txt
Last active July 2, 2016 18:45
cloc GOPATH
cloc $GOPATH/src
355977 text files.
146076 unique files.
265536 files ignored.
github.com/AlDanial/cloc v 1.70 T=1536.51 s (60.4 files/s, 22195.2 lines/s)
---------------------------------------------------------------------------------------
Language files blank comment code
---------------------------------------------------------------------------------------
Go 35916 1312637 1831205 8843502
@dlsniper
dlsniper / install go.ps
Created January 28, 2016 09:54
Install go
$cwd = $PSScriptRoot+"\"
$gosdk = $cwd+"go"
$zip7 = $cwd+"7z"
$mingw = $cwd+"mingw64"
$gitdir = $cwd+"git"
$gopath = $cwd+"gopath"
# Install Go
if (-Not (Test-Path $gosdk)) {
echo "Installing Go into: "$gosdk