Skip to content

Instantly share code, notes, and snippets.

View lavie's full-sized avatar

assaf lavie

View GitHub Profile
dudde mansa puvve dabme tipve lusfe mikla likdi vetma bibne laste lema lokpa leppi vebpi papne fokta fobmi fedfi sifpi fopsa fespa sopbi baple lunda lufni nokne padbi temvi sampa modpe tamsa momfe bamfa dovta lobde pidvi pomni vobpi bolna kupli sofka sufde fumbi lifta pevne vake kisfi dosmi felfi sotmi tuvli sibna pakdi fasla tabla livle fikpi mipke vavpi peka fodpe sadme lavve nodve mukka musti numde nedle fakmi bikli dudbi samti lodle todba lubmi lofne fitti tadke nifne dindi mivbe timbi dekme kadme fidme fibfe vospe bunli kette setsa nedke laski savpa lodpi pafve modni kepta fanpa nokna suvma kunfa lidma vifki fetsa vumbe dutka kidme temfa mudke pebfa kufti dovte lesla badki kebla tesfa kubli nofve tonba tinta nefta lodti kutfe fame daspi pudsa sitka pevka telda vesla bisi bepbi vefla melpe dodfe totda nipka sopki letpi visbi fula meldi matki felni numsa fevpa tava difa tesfi lilli dopne lebsi fokpa sebli sokda oki nunve futti fomka penve lalpe sodpi siba dodna fovma fapde simde lutsi nibbe talmi lembi pek
@lavie
lavie / get_pod_interface.sh
Created July 29, 2019 07:47
how to tcpdump traffic from a specific kubernetes pod
#!/bin/bash -eu
POD_NAME="$1"
IFACE="$(kubectl exec -t "$POD_NAME" -- bash -c "cat /sys/class/net/eth0/iflink")"
echo "Internal interface index: $IFACE. Searching for it on host..."
for i in /sys/class/net/veth*/ifindex; do
if grep "$IFACE" <$i >/dev/null; then
echo -n "Host interface: "
echo "$i" | grep -o -E "veth[^/]*"
@lavie
lavie / hodls.sh
Last active August 31, 2018 15:27
$ grep -v '^old$' < old.txt | ./unique.py
bold
cold
cuckold
dippold
fold
forold
frampold
garold
gold
#!/usr/bin/env python
import sys
words = [line.strip() for line in sys.stdin]
for hay in words:
if len([needle for needle in words if needle in hay]) == 1:
print hay
base=wordlist[0] #consider the first word in the list
for word in wordlist: #loop through the entire list checking if
if not word.startswith(base): # the word we're considering starts with the base
print base #If not... we have a new base, print the current
base=word # one and move to this new one
#else word starts with base
#don't output word, and go on to the next item in the list
print base
$ grep -E 'hold$' < old.txt | head -10
afterhold
ahold
anchorhold
ankerhold
athold
barthold
behold
berthold
bondhold
@lavie
lavie / old.sh
Last active August 31, 2018 15:30
$ awk '/^[a-zA-Z]+$/{ print tolower($0) }' < words.txt | grep -E 'old$' | head -10
acold
afterhold
ahold
akenbold
anchorhold
ankerhold
anticold
archbold
archibold
@lavie
lavie / lower.sh
Last active August 31, 2018 15:26
$ awk '/^[a-zA-Z]+$/{ print tolower($0) }' < words.txt | head -10
a
aa
aaa
aaaa
aaaaaa
aaal
aaas
aaberg
aachen
$ grep -E '^[a-zA-Z]+$' < words.txt | head -10
a
AA
AAA
AAAA
AAAAAA
AAAL
AAAS
Aaberg
Aachen
@lavie
lavie / 1.sh
Last active August 31, 2018 15:25
$ head -10 < words.txt
2
1080
&c
10-point
10th
11-point
12-point
16-point
18-point