Skip to content

Instantly share code, notes, and snippets.

@juliantaylor
juliantaylor / check-iptables-nodes.sh
Last active November 30, 2023 13:13
k8s iptable verify
#!/bin/bash
mkdir -p /tmp/data
while [[ $# -gt 0 ]]; do
node=$1
shift
proxy=$(kubectl -n kube-system get pods --no-headers -l app.kubernetes.io/name=kube-proxy --field-selector=spec.nodeName=$node | awk '{print $1}')
kubectl -n kube-system exec -c kube-proxy -t "$proxy" -- iptables-save > /tmp/data/$node.iptables
./check-iptables.py /tmp/data/$node.iptables $node | tee /tmp/data/$node.log | grep -B 1 ERROR && echo kubectl -n kube-system delete pod $proxy
done
This file has been truncated, but you can view the full file.
2021-04-29T12:20:24Z INF Kiali: Version: v1.32.0, Commit: 166ffcc9edfc6fdd8c6ce8e74eb5670414b949f5
2021-04-29T12:20:24Z INF Using authentication strategy [anonymous]
2021-04-29T12:20:24Z WRN Kiali auth strategy is configured for anonymous access - users will not be authenticated.
2021-04-29T12:20:24Z INF Kiali: Console version: 1.32.0
2021-04-29T12:20:24Z INF Generating env.js from config
2021-04-29T12:20:24Z INF Server endpoint will start at [:20001/]
2021-04-29T12:20:24Z INF Server endpoint will serve static content from [/opt/kiali/console]
2021-04-29T12:20:24Z INF Starting Metrics Server on [:9090]
2021-04-29T12:20:40Z INF Kiali Cache is active for namespaces [.*]
@juliantaylor
juliantaylor / pygil.stp
Created September 22, 2015 23:04
python gil stap
# stap -g pygil.stp <pid> <minlocktime-in-mus>
global init = 0
global gpid = $1
global lock_start = 0
global mintime = $2
# may need to be libpython on some systems
probe process("/usr/bin/python-dbg").function("PyThread_acquire_lock")
{
if (init == 0) {
@juliantaylor
juliantaylor / casa-logs.ipynb
Last active August 29, 2015 14:17
casa log parse
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juliantaylor
juliantaylor / avx.c
Created January 19, 2015 22:06
avx align bechmark
// gcc avx.c -mavx -std=c99 -O2
// while true; do ./a.out; done > log
// analyze via np.genfromtxt, e.g. min, 10th percentile, median
#include <stdio.h>
#include <string.h>
#include <x86intrin.h>
#include <avxintrin.h>
#define N 5000
void __attribute__((noinline)) add(double * a, int warmup)
#
# This is a valgrind suppression file that should be used when using valgrind.
#
# Here's an example of running valgrind:
#
# cd python/dist/src
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
#
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
@juliantaylor
juliantaylor / blocked_numpy.ipynb
Last active August 29, 2015 13:59
blocked threaded numpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juliantaylor
juliantaylor / numpy_compiler_bench.ipynb
Last active December 29, 2015 08:58
numpy compiler benchmark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juliantaylor
juliantaylor / gist:6642848
Last active December 23, 2015 13:29
generalized axis support for arbitraryy funcions
import numpy as np
def ureduce(a, func=np.median, **kwargs):
a = np.asarray(a)
axis = kwargs.get('axis', None)
keepdims = kwargs.pop('keepdims', False)
if axis is not None:
keepdim = list(a.shape)
nd = a.ndim
if np.isscalar(axis):
if axis >= nd or axis < -nd:
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -207,12 +207,15 @@ PyUFunc_handlefperr(int errmask, PyObject *errobj, int retstatus, int *first)
/*UFUNC_API*/
NPY_NO_EXPORT int
-PyUFunc_checkfperr(int errmask, PyObject *errobj, int *first)
+PyUFunc_checkfperr(int errmask, PyObject *errobj, int *first, int * pre)
{
int retstatus;