Skip to content

Instantly share code, notes, and snippets.

@AriPerkkio
AriPerkkio / ipleak.sh
Last active December 31, 2024 19:45
ipleak.net CLI
#!/bin/bash
echo "IP"
curl -s https://ipv4.ipleak.net/json/ | grep -E 'country|city|region|continent|ip'
echo -e "\nDNS"
for i in {1..5}
do
HASH=$(head /dev/urandom | tr -dc a-z0-9 | head -c 39 ; echo '')
echo $(curl -s https://1$HASH.ipleak.net/dnsdetect/) &
@posener
posener / go-shebang-story.md
Last active April 24, 2025 16:41
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@EvgenyOrekhov
EvgenyOrekhov / Docker Compose files for PHP development.md
Last active April 16, 2024 18:03
Simple Docker Compose files for PHP development

Simple Docker Compose files for PHP development

Apache + PostgreSQL + MySQL

docker-compose -f docker-compose.apache.yml up

nginx + Apache + PostgreSQL + MySQL

docker-compose -f docker-compose.nginx+apache.yml up

nginx + PHP-FPM + PostgreSQL + MySQL

docker-compose -f docker-compose.nginx+php-fpm.yml up

@t9md
t9md / go-tour-select.go
Last active May 29, 2021 07:46
Go's Channel and select {} illustrated
package main
/*
Channel and select {} illustrated by t9md
===========================================================
sample program to understand goroutine communication via channel.
based on go-tour's example
https://tour.golang.org/concurrency/5
*/
@tjmw
tjmw / gist:6113202
Last active January 10, 2021 18:03
Migrate a MySQL DB to Postgres on Heroku

Migrating a MySQL DB to a Heroku Postgres Instance

1. Create a MySQL Dump

mysqldump -h<host> --compatible=postgresql -u<user> -p <database_name> > /tmp/my_dump.sql

2. Import MySQL dump locally

cat my_dump.sql | mysql -h<host> -u<user> -p <database_name>
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 29, 2025 02:42
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@steos
steos / client.conf
Created November 9, 2011 18:26
openvpn config with lan gaming support
client
# specify server ip address here
remote <SERVER-IP>
dev tap
# name of the windows network connection
dev-node openVPN