Skip to content

Instantly share code, notes, and snippets.

View tommyvn's full-sized avatar
💭
loading...

Tom van Neerijnen tommyvn

💭
loading...
View GitHub Profile
@tommyvn
tommyvn / testing
Last active September 15, 2017 10:02
testing
#!/usr/bin/python
@tommyvn
tommyvn / yuyug
Created September 15, 2017 12:27
hjgsahjfds
hjghgdfa
@tommyvn
tommyvn / XD84____.kbd.json
Last active February 9, 2018 14:58 — forked from xiudi/XD84____.kbd.json
XD84默认配列
[
{
"name": "XD84默认配列",
"author": "xiudi"
},
[
{
"c": "#0075ad"
},
"Esc\n\n\n\nsleep",
@tommyvn
tommyvn / cmd.sh
Last active March 12, 2019 09:50
pandoc variable tex
pandoc --template test.tex --variable NAME=tom --variable checkedvar -o test.pdf /dev/null
@tommyvn
tommyvn / README.md
Created March 22, 2022 22:10
nginx server name path routing

nginx server name path routing

This example nginx configuration will enable subdomain routing to a single backend path based on the subdomain.

It shows both catch-all routing and specific subdomain routing.

@tommyvn
tommyvn / app.js
Last active June 16, 2022 07:11
mve slack's bolt to test with localhost.run
const { App, LogLevel, ExpressReceiver } = require('@slack/bolt');
// this app is by default listening for events/commands/messages/etc on the /slack/events path
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
logLevel: LogLevel.DEBUG,
signingSecret: process.env.SLACK_SIGNING_SECRET,
});
/* Add functionality here */
@tommyvn
tommyvn / README.md
Last active June 26, 2023 09:16
tunneling arbitrary TCP protocols like ssh or postgresql over localhost.run custom domains
  1. instal stunnel from your package manager. This allows you to wrap any TCP protocol (ssh, postgresql, mysql) in TLS.

  2. download the stunnel.conf from this gist and replace the example.com host with your custom domain (also in the ssh command below).

  3. run stunnel stunnel.conf in a terminal

  4. connect your localhost.run tunnel on port 80 to your backend service.

    ssh -R example.com:80:localhost:5432 plan@localhost.run connects a tunnel to a local postgres on port 5432, change the port for other services

  5. connect your client to port 9999 (or what ever port you specified in stunnel.conf), for eg:.

    • psql postgresql://localhost:9999/dbname
    • mysql -h localhost -P9999
  • ssh localhost -p 9999