Skip to content

Instantly share code, notes, and snippets.

@afdalwahyu
afdalwahyu / main.go
Last active May 30, 2024 18:09
golang dynamic port forward ssh socks5 tunnel
package main
import (
"context"
"fmt"
"net"
"os"
"os/signal"
"syscall"
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active June 16, 2024 21:39
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active June 19, 2024 03:34
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@qhwa
qhwa / go_port_forwarding.go
Last active June 1, 2024 01:21
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
@ipedrazas
ipedrazas / gist:e3ae3ddb98b2e85c8370
Created July 30, 2015 10:20
Consul.io KV get value from bash
curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?dc=dc1 | jq -r '.[0].Value' | base64 --decode
@bulain
bulain / MethodInvoking.xml
Created August 11, 2011 14:55
calling static and instance method in spring
<!-- call static method -->
<bean id="test" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="demo.Test" />
<property name="targetMethod" value="staticmethod" />
<property name="arguments">
<list>
<value>test</value>
</list>
</property>
</bean>