Skip to content

Instantly share code, notes, and snippets.

@hambster
hambster / traffic-control.sh
Created September 24, 2021 09:01 — forked from magnific0/traffic-control.sh
Traffic control script for incoming and outgoing packages using TC (on a specific ip address)
#!/bin/bash
VERSION="1.0.2"
# Interface connect to out lan
INTERFACE="eth0"
# Interface virtual for incomming traffic
VIRTUAL="ifb0"
# set the direction (1 = outgoing only, 2 = incoming only 3 = both)
DIRECTION=3
# Speed
@hambster
hambster / GitConfigHttpProxy.md
Last active August 15, 2021 08:44 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@hambster
hambster / tmux-cheatsheet.markdown
Created March 23, 2020 03:48 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hambster
hambster / app.py
Created March 11, 2020 06:55 — forked from fanzeyi/app.py
Simple stream file proxy with Flask and Requests
# -*- coding: utf-8 -*-
from flask import Flask
from flask import Response
from flask import stream_with_context
import requests
app = Flask(__name__)
@hambster
hambster / main.go
Created March 29, 2017 16:14 — forked from walm/main.go
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@hambster
hambster / pc6248-routing
Created December 2, 2016 14:31 — forked from skarllot/pc6248-routing
Powerconnect 6248 Routing
!Current Configuration:
!System Description "PowerConnect 6248, 3.3.7.2, VxWorks 6.5"
!System Software Version 3.3.7.2
!Cut-through mode is configured as disabled
!
configure
vlan database
vlan 100,200
vlan routing 100 1
vlan routing 200 2
@hambster
hambster / pc6248-dhcp-relay
Created December 2, 2016 14:30 — forked from skarllot/pc6248-dhcp-relay
Powerconnect 6248 DHCP relay thru VLAN
!Current Configuration:
!System Description "Powerconnect 6248, 3.2.0.7, VxWorks 6.5"
!System Software Version 3.2.0.7
!Cut-through mode is configured as disabled
!
configure
vlan database
vlan 10,20,30,40
vlan routing 10 1
vlan routing 20 2
@hambster
hambster / udpProxy.go
Created November 5, 2015 02:28 — forked from mike-zhang/udpProxy.go
Implementation of a UDP proxy in Golang
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"