Skip to content

Instantly share code, notes, and snippets.

@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"
@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 / 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 / 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 / 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 / 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 / sftp.py
Last active February 5, 2021 15:28
Airflow DAG copy GCS file with SFTP
import copy
import os
import airflow
from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.google.cloud.transfers.gcs_to_local import GCSToLocalFilesystemOperator
from airflow.contrib.operators.sftp_operator import SFTPOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators import bash_operator
@hambster
hambster / sample_stream_ingest_pubsub_bq.py
Created June 3, 2021 14:47
Streaming Ingestion from GCP Pub/Sub to BigQuery with Dataflow
from apache_beam.options.pipeline_options import PipelineOptions
from google.cloud import pubsub_v1
from google.cloud import bigquery
import apache_beam as beam
import logging
import argparse
import sys
import re
import time
import json
#!/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 / 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: