Skip to content

Instantly share code, notes, and snippets.

@thirdwheel
thirdwheel / ipsec.conf
Created December 23, 2018 04:01
IPSec connection from behind NAT
# 10.0.0.21 is the "public" IP address - local is 10.40.180.50 (DHCP)
ike esp from 10.0.0.21 to 10.0.0.23
# 10.255.255.253 is the IP on this side of a gif(4) tunnel, the other is the other side
ike esp from 10.255.255.253 to 10.255.255.252 peer 10.0.0.23
# ifconfig output at https://pasteboard.co/HT0kGu7.png
# tcpdump output at https://pasteboard.co/HT0m2JA.png
@thirdwheel
thirdwheel / main.go
Created December 15, 2019 08:28
GWT Sessions Package - new session for each request
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)
@thirdwheel
thirdwheel / Recover_Deleted_Data_Proc.sql
Created October 14, 2020 22:43
Recover deleted data in a SQL Database from 2005 onwards
-- Script Name: Recover_Deleted_Data_Proc
-- Script Type : Recovery Procedure
-- Develop By: Muhammad Imran
-- Date Created: 15 Oct 2011
-- Modify Date: 7 Oct 2020
-- Version : 3.1
-- Notes : Included BLOB data types for recovery.& Compatibile with Default , CS collation , Arabic_CI_AS.
-- Changed 7 Oct 2020 - Add support for using transaction log backups
IF OBJECT_ID('dbo.Recover_Deleted_Data_Proc') is not null
@thirdwheel
thirdwheel / tsql-lets-you-create-tables-like-this.sql
Created July 28, 2021 00:37
TSQL lets you create tables like this
select cast(null as varchar(75)) test_id, cast(null as varchar(150)) test_item, cast(null as int) test_value
into test_table
where 1=0
@thirdwheel
thirdwheel / Dockerfile
Last active October 24, 2022 01:35
PHP build environment
FROM alpine:3.14.2
RUN apk add --no-cache alpine-sdk xmlrpc-c-dev bzip2-dev talloc-dev sqlite-dev icu-dev jpeg-dev net-snmp-dev heimdal-dev db-dev \
cyrus-sasl-dev openldap-dev libxpm-dev tdb-dev zlib-dev tevent-dev openssl-dev libxcb-dev readline-dev \
brotli-dev recode-dev freetds-dev libedit-dev tidyhtml-dev musl-dev freetype-dev imagemagick-dev gdbm-dev \
argon2-dev aspell-dev imap-dev libjpeg-turbo-dev e2fsprogs-dev gmp-dev unixodbc-dev curl-dev libsodium-dev \
postgresql-dev libc-dev libx11-dev oniguruma-dev libwebp-dev gd-dev pcre2-dev libxml2-dev libxau-dev \
util-linux-dev libxdmcp-dev libpng-dev pcre-dev ncurses-dev libxslt-dev xz-dev libzip-dev gettext-dev ldb-dev \
nghttp2-dev openssl-dev sqlite-dev nano
RUN rm -f build.sh
RUN wget -O build.sh https://gist.github.com/thirdwheel/057af38cf8384dd3184cea8a28a9dd8a/raw/build.sh