Skip to content

Instantly share code, notes, and snippets.

View gaukas's full-sized avatar
🫖
I’m NOT a teapot

Gaukas Wang gaukas

🫖
I’m NOT a teapot
View GitHub Profile
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@rishavpandey43
rishavpandey43 / git-commit-styleguide.md
Last active June 24, 2024 12:35
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

@mpalpha
mpalpha / default.pa
Last active January 8, 2021 19:28
Atomic Pi HDMI working audio Pulse Audio Configuration file /etc/pulse/default.pa from https://www.reddit.com/r/Atomic_Pi/wiki/index#wiki_fix_for_hdmi_audio
#!/usr/bin/pulseaudio -nF
#
# check if you are missing pavucontrol. run "which pavucontrol"
# If so, install it and Download a working Atomic Pi HDMI audio configuration file.
# run "sudo apt install -y pavucontrol && sudo curl -o /etc/pulse/default.pa -L https://gist.githubusercontent.com/mpalpha/5e0d87f514bca0f87769864655300c99/raw"
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
@xavierfoucrier
xavierfoucrier / gpg-signing.md
Last active June 21, 2024 13:14
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key
@ankanch
ankanch / getlocalIP.go
Created October 25, 2017 13:13
[Golang] Get Public IP address via Public IP API
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.ipify.org?format=text" // we are using a pulib IP API, we're using ipify here, below are some others
// https://www.ipify.org
// http://myexternalip.com
@MarkBaggett
MarkBaggett / scapy_helper.py
Last active March 25, 2024 21:59
Python - SCAPY - Full Packet Session Reassembly
#From here https://pen-testing.sans.org/blog/2017/10/13/scapy-full-duplex-stream-reassembly
def full_duplex(p):
sess = "Other"
if 'Ether' in p:
if 'IP' in p:
if 'TCP' in p:
sess = str(sorted(["TCP", p[IP].src, p[TCP].sport, p[IP].dst, p[TCP].dport],key=str))
elif 'UDP' in p:
sess = str(sorted(["UDP", p[IP].src, p[UDP].sport, p[IP].dst, p[UDP].dport] ,key=str))
@er1chu
er1chu / gist:d27d89e3f9e27a157b69fd716b8b8aba
Last active October 31, 2021 06:14
china friendly jquery cdn snippet
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!-- If jQuery object returns an error (e.g. blocked in Google CDN blocked in China) fallback to this CDN -->
<script> window.jQuery || document.write('<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"><\/script>');</script>
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@arsham
arsham / go_cpu_memory_profiling_benchmarks.sh
Last active June 26, 2024 13:32
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt
@elico
elico / client.go
Created July 26, 2016 00:21
golang tcp client connection alive check
package main
import (
"fmt"
"io"
"net"
"time"
)
func main() {