Skip to content

Instantly share code, notes, and snippets.

View askbow's full-sized avatar

Denis Borchev askbow

View GitHub Profile
@askbow
askbow / mini.sh
Created April 6, 2024 09:37
install minikube
## docker / kubernetes
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt-get update
sudo apt install docker docker-compose docker-ce docker-ce-cli conntrack containerd.io -y
sudo usermod -aG docker $USER
newgrp docker
cd ~
VERSION="v1.26.0"
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-amd64.tar.gz
@askbow
askbow / spinner.py
Created December 26, 2021 15:56 — forked from cevaris/spinner.py
Simple Python CLI Spinner
#!/usr/bin/env python
import itertools
import sys
import time
import threading
class Spinner(object):
spinner_cycle = itertools.cycle(['-', '/', '|', '\\'])
@echo off
REM this script performs a hard reset of local CiscoJabber profile data
echo #Stop CiscoJabber.exe...
taskkill /f /im CiscoJabber.exe
echo #Clear Roaming Profile
cd "%APPDATA%\Cisco\Unified Communications"
rd /s /q "Jabber"
echo #Clear Local Profile
cd "..\Local\Cisco\Unified Communications"
rd /s /q "Jabber"
# -*- coding: utf-8 -*-
data = '''
# put your html data here (e.g. with requests or from file)
'''
import bs4
soup = bs4.BeautifulSoup(data)
# if you're tired of a mere print, try this:
# not perfect, but works
def log(m="\n", l=1):
__VERBOSE__ = 0
if __VERBOSE__ > l-1: print "M:"," "*l , m
# this is a simple construct for debugging purposes
log("foo", 5)
log("bar", 3)
log("="*80, 2)
@askbow
askbow / linecompare.py
Created July 31, 2018 11:52
a weak file comparator - seeks for presence of the same lines
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
try:
from future_builtins import *
except ImportError:
pass
#!/bin/python
# -*- coding: utf-8 -*-
from random import triangular
# useful for some experiments
def biasrandint(low=0, hi=100, bias=75):
return int(triangular(low, hi, bias)) #triangular itself returns a float
if __name__ == '__main__':
print(biasrandint())
@askbow
askbow / tcpdump.sh
Created June 13, 2018 13:59
quick grab traffic sample in two formats
#!/bin/bash
today=`date +%Y%m%d.%H%M%S`
# same will work with tshark:
tcpdump -c 10240 -w /tmp/t$today.pcap &
tcpdump -c 10240 > /tmp/t$today.txt
@askbow
askbow / outlooklib.py
Created June 13, 2018 12:49
useful class to work with MS Outlook
# author: Tom Lichtenberg
# http://softwaretestautomationnotes.blogspot.com/2011/11/reading-outlook-email-with-python.html
import win32com.client
class OutlookLib:
def __init__(self, settings={}):
self.settings = settings
@askbow
askbow / katrielalex.latex
Created June 12, 2018 09:00
a list of little LaTex snippets that make documents look better by @katrielalex
https://twitter.com/katrielalex/status/984373545248706560
Katriel
‏ @katrielalex
Here begins a list of little LaTex snippets that make documents look better. What's that you say, I should be writing my thesis? Naaaaaah
0/x