Skip to content

Instantly share code, notes, and snippets.

@vistrcm
vistrcm / k8s_dump_namespace
Created March 31, 2021 22:51
dump kubernetes objects for the namespace
#!/usr/bin/env bash
set -euo pipefail
context=$1
namespace=$2
for rtype in $(kubectl --context "${context}" api-resources --verbs=list --namespaced -o name)
do
echo "rtype: ${rtype}"
for resource in $(kubectl --context "${context}" -n "${namespace}" get "${rtype}" -o name)
@vistrcm
vistrcm / fortigate_tricks.txt
Last active November 9, 2022 01:45
useful fortigate commands
# packet sniff
# # diag sniffer packet <interface> <'filter'> <verbose> <count> a
# example sniff for port 9004 on all interfaces. Verbosity 4.
diag sniffer packet any 'port 9004' 4
# link: https://kb.fortinet.com/kb/viewContent.do?externalId=11186
# ipsec.

Keybase proof

I hereby claim:

  • I am vistrcm on github.
  • I am vistrcm (https://keybase.io/vistrcm) on keybase.
  • I have a public key ASDHFVcHpb21OJgv33oOiBxU_kEvvX7P5-1MwIJ9_1xTcwo

To claim this, I am signing this object:

@vistrcm
vistrcm / notwoself.py
Created September 16, 2013 15:51
Do not use two self.
import new
class A(object):
class InsideA(object):
def __init__(self, func=None):
self.func = new.instancemethod(func, self, A.InsideA)
def run(self):
if self.func: self.func()