Skip to content

Instantly share code, notes, and snippets.

View lionants02's full-sized avatar

Max Thanachai Thongkum lionants02

View GitHub Profile
@hussanhijazi
hussanhijazi / MqttClient.kt
Created November 29, 2018 13:02
Kotlin Mqtt Client
package br.com.hussan.mqttandroid
import android.content.Context
import android.util.Log
import org.eclipse.paho.android.service.MqttAndroidClient
import org.eclipse.paho.client.mqttv3.IMqttActionListener
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken
import org.eclipse.paho.client.mqttv3.IMqttToken
import org.eclipse.paho.client.mqttv3.MqttCallbackExtended
import org.eclipse.paho.client.mqttv3.MqttClient
@petitviolet
petitviolet / nginx_deployment.yaml
Created March 11, 2018 11:04
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
@jeepkd
jeepkd / thailand.json
Last active December 15, 2023 14:29
Simplified GeoJson for provinces of Thailand. Including new province Bueng Kan.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bwann
bwann / README.md
Last active June 22, 2024 20:20
Tunnelling SSH over SSL/TLS

How to tunnel SSH over SSL/TLS

laptop ssh -> laptop stunnel -> evil network -> internet -> your server -> your server ssh

Server (your shell server/home box/work box/whatever)

Sets up a stunnel process listening externally on port 2443/tcp, forwards to localhost 22/tcp

  • Install stunnel, e.g. yum install stunnel
  • Install server config snippet to /etc/stunnel/stunnel.conf
# create an UDP server using nc on port 11090
nc -ul 11090
# check whether an UDP server is listening on 11190
nc -vz -u <hostname> 11090
# send a packet to the UDP server
echo -n "hello" | nc -4u -w1 <hostname> 1118
@Nateowami
Nateowami / README.md
Last active May 6, 2023 14:59
Auto-Sync with Unison
Summery

This is a simple script for syncing Unison profiles. Basically, given a list of profiles (which must already be created in Unison), it will sync all files with non-conflicting states. It logs the time of start and completion to unison.log (change OUTPUT=$HOME/unison.log if you want it to output somewhere else), as well as listing the output Unison gives for each sync. Unison already knows the hosts to sync, because that's recorded by Unison in the profiles it stores in ~/.unison. And you'll need SSH keys already setup.

Automating

If you want to automate this script in Ubuntu, search the dash for "Startup Applications" and open it up, then click on "add" in the window that opens. You'll be prompted for a name and command. Name it anything you like and make the command the path to the script, e.g. `~/scr

@pdp7
pdp7 / install-tor.txt
Last active February 1, 2019 21:39
install tor non-exit relay on digital ocean
# My steps for creating a DigitalOcean server to run non-exit Tor node for just $5/mo
# Screen shots of my setup process: https://plus.google.com/photos/+DrewFustini/albums/6057260188204970945
# Create Digital Ocean account: https://www.digitalocean.com/
# Create Droplet on Digital Ocean: select $5/mo, and select Debian 7.0 64-bit
# This instructions are based on Tor Project: https://www.torproject.org/docs/tor-relay-debian.html.en
afustini@lappy486:~$ ssh root@107.170.203.104
root@107.170.203.104's password:
You are required to change your password immediately (root enforced)
Linux Tor300SoF 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
@jbonney
jbonney / jar_through_proxy
Created June 18, 2013 19:56
Execute Java jar program through a socks proxy.
java -jar -DsocksProxyHost=localhost -DsocksProxyPort=8080 program.jar