Skip to content

Instantly share code, notes, and snippets.

View wi1dcard's full-sized avatar
😀
live a simple life and be happy

Way Sun wi1dcard

😀
live a simple life and be happy
View GitHub Profile
@dcasati
dcasati / tcpdump-kubernetes
Created March 6, 2019 19:54
visualize a tcpdump capture from a Kubernetes POD on Wireshark in real time
run tcpdump on a POD and then (live) see that information through wireshark locally on my machine. the magic of ssh and fifo 
Topology
--------
[laptop with wireshark] ------> [AKS Node] ----> [POD (tcpdump is here)]. 
1. create the fifo on your local machine (where wireshark will run)
mkfifo /tmp/remote-capture.fifo
2. execute the following command to send traffic from within a POD to the stdout. This will then be redirected to the fifo locally
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active April 22, 2024 11:24
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@mumoshu
mumoshu / helmify-kustomize
Last active April 15, 2024 10:49
Run `helmify-kustomize build $chart $env` in order to generate a local helm chart at `$chart/`, from kustomize overlay at `${chart}-kustomize/overlays/$env`
#!/usr/bin/env bash
cmd=$1
chart=$2
env=$3
dir=${chart}-kustomize
chart=${chart/.\//}
build() {
@paulund
paulund / phpcs.xml
Created August 20, 2017 16:50
PHP PSR-2 CodeSniffer Config for Laravel
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<!--
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.
-->
@fntneves
fntneves / .php_cs
Last active January 9, 2020 00:24
Laravel Coding Standards
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_equals' => false],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active May 1, 2024 12:39
Partition, format, and mount a drive on Ubuntu
@nepsilon
nepsilon / git-change-commit-messages.md
Last active April 24, 2024 06:30
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@jmaxhu
jmaxhu / .git-commit-template.txt
Last active August 21, 2023 06:29 — forked from adeekshith/.git-commit-template.txt
一份建议的git commit模板
# <类型>: (类型的值见下面描述) <主题> (最多50个字)
# 解释为什么要做这些改动
# |<---- 请限制每行最多72个字 ---->|
# 提供相关文章和其它资源的链接和关键字
# 例如: Github issue #23
# --- 提交 结束 ---
# 类型值包含
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.