Skip to content

Instantly share code, notes, and snippets.

View bashkirtsevich's full-sized avatar
:octocat:
bashkirtsevich.github.io

D.A.Bashkirtsev bashkirtsevich

:octocat:
bashkirtsevich.github.io
View GitHub Profile
@bashkirtsevich
bashkirtsevich / fix.sh
Created June 26, 2020 11:04
Fix ssl certs error in linux
apt-get install ca-certificates
update-ca-certificates
@bashkirtsevich
bashkirtsevich / md5.sh
Last active July 16, 2020 06:02
md5deep
md5deep -l -o f -r folder1 -r folder2
# equals to
find folder1 -type f -exec md5sum {} \;
@bashkirtsevich
bashkirtsevich / load.sh
Last active July 3, 2020 16:00
apt-get recursive download debs
package=$1
apt-get download $package 2>>errors.txt
depends=$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances $package | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/ -e 's/ //' | sort | uniq)
for i in $depends
do
apt-get download $i 2>>errors.txt
done
@bashkirtsevich
bashkirtsevich / readme.txt
Created May 28, 2020 13:09
Docker save/load tgz image
docker image save redis | gzip > redis.tgz
docker image save rabbitmq | gzip > rabbitmq.tgz
gunzip -c rabbitmq.tgz | docker load
gunzip -c redis.tgz | docker load
git clone -c core.sshCommand="ssh -i /path/to/id_rsa" [email protected]:user/repo.git
@bashkirtsevich
bashkirtsevich / history
Created May 21, 2020 10:42
CentOS 8 Supervisor install
yum update
yum install epel-release
yum install supervisor
systemctl enable supervisord
systemctl start supervisord
cd /etc/supervisord.d
@bashkirtsevich
bashkirtsevich / asyncio_shutdown_loop.py
Created May 18, 2020 15:43 — forked from nvgoldin/asyncio_shutdown_loop.py
Python 3.5 asyncio - shutdown all tasks safely using signal handler
import signal
import functools
async def looping_task(loop, task_num):
try:
while True:
print('{0}:in looping_task'.format(task_num))
await asyncio.sleep(5.0, loop=loop)
except asyncio.CancelledError:
return "{0}: I was cancelled!".format(task_num)
@bashkirtsevich
bashkirtsevich / clock.yml
Last active November 22, 2019 20:13
Vector images
surface:
size: [500, 500]
mode: "L"
background: [255]
position: [250, 250]
zoom: 0.5
discreet: 10
elements:
face:
docker run --rm \
-p 8888:8888 \
-v $PWD:/home/jovyan/pwd \
--env JUPYTER_ENABLE_LAB=yes \
--env JUPYTER_TOKEN=asd \
--name ihaskell_notebook \
crosscompass/ihaskell-notebook:latest
@bashkirtsevich
bashkirtsevich / qsort.py
Created November 5, 2019 16:29
Quicksort
from itertools import tee, chain
def sort_c(it):
xs = iter(it)
x = next(xs)
xs1, xs2 = tee(xs)
yield from chain(
sort_c(filter(lambda i: i < x, xs1)),
[x],