Skip to content

Instantly share code, notes, and snippets.

View junchaw's full-sized avatar
💭
Ze

JC junchaw

💭
Ze
View GitHub Profile
@seblegall
seblegall / reverseproxy.go
Last active November 10, 2024 08:08
A reverse proxy in Golang using Gin
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"github.com/gin-gonic/gin"
)
@attilahorvath
attilahorvath / dump_restore_mysql_utf8mb4.sh
Created March 13, 2015 13:33
Dump/restore MySQL database with utf8mb4 encoding
# dump
mysqldump -u user -p database --default-character-set=utf8mb4 --result-file=dump.sql
# restore
mysql -u user -p database < dump.sql
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@shirou
shirou / ssh_keyscan.yml
Last active March 14, 2024 12:16
run ssh-keyscan to add keys to known_hosts. This is a playbook for ansible
---
- hosts: all
gather_facts: no
sudo: no
tasks:
- name: run ssh-keyscan to add keys to known_hosts
local_action: shell ssh-keyscan {{ ansible_ssh_host }} >> ~/.ssh/known_hosts