Skip to content

Instantly share code, notes, and snippets.

View szobov's full-sized avatar

Sergei Zobov szobov

View GitHub Profile
#!/home/szobov/.nix-profile/bin/python3
import re
import sys
from subprocess import check_output, CalledProcessError
JIRA_PROJECT_PREFIX = 'JIRA-'
def append_branch_number(prefix):
@szobov
szobov / add_fixture_to_tests.py
Last active February 9, 2023 13:08
Add a fixture parameters to pytest's test function definitions
"""
Copyright © 2023 Sergei Zobov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@szobov
szobov / download_and_bake.sh
Last active July 15, 2022 12:35
PointNet: extract .ply files
wget https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip --no-check-certificate
unzip modelnet40_ply_hdf5_2048.zip
cd modelnet40_ply_hdf5_2048
wget https://gist.githubusercontent.com/szobov/4fe7e6cba08be7044426bedaae67b206/raw/2f79acb796b3860aef81d9e96521c26593f87607/split_to_ply.py
python3 -m pip install h5py
python3 split_to_ply.py
cd dataset
wget https://github.com/fxia22/pointnet.pytorch/files/3659189/trainval.txt
wget https://github.com/fxia22/pointnet.pytorch/files/3914859/test.txt
wget https://github.com/fxia22/pointnet.pytorch/files/3914860/train.txt
@szobov
szobov / config.el
Created January 18, 2021 07:48
emacs: Google-style docstring in python
(defun python-google-docstring ()
"Generate google-style docstring for python."
(interactive)
(if (region-active-p)
(progn
(call-process-region (region-beginning) (region-end) "python3" nil t t "/home/szobov/bin/scripts/format-g-docs.py")
(message "Docs are generated")
(deactivate-mark))
(message "No region active; can't generate docs!"))
)
@szobov
szobov / haproxy.cfg
Created September 20, 2019 16:21 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@szobov
szobov / MAV_1_MODE=Normal
Created July 29, 2019 15:40
Pixhawk CUBE, px4 1.9.2, Onboard communication problems
$ rostopic echo -n1 /diagnostics
header:
seq: 16
stamp:
secs: 1564406373
nsecs: 813920028
frame_id: ''
status:
-
level: 0
@pytest.fixture
def mock_utcnow(monkeypatch):
def wrapped(now=datetime.min):
monkeypatch.setattr(utils, "get_utcnow", lambda: now)
return wrapped
@szobov
szobov / .gitlab-ci.yaml
Created April 23, 2018 08:44
gitlab-ci.yaml elixir deploy
stages:
- init
- test
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- deps/
- _build/
@szobov
szobov / .spacemacs
Created March 25, 2018 16:27
Copy/paste to xclip using emacs -nw
(defun copy-to-clipboard ()
"Copies selection to x-clipboard."
(interactive)
(if (display-graphic-p)
(progn
(message "Yanked region to x-clipboard!")
(call-interactively 'clipboard-kill-ring-save)
)
(if (region-active-p)
(progn
FROM ubuntu:16.04
ENV ANDROID_HOME /opt/android-sdk
RUN apt-get update && apt-get install -y lib32stdc++6 lib32z1 nodejs npm openjdk-8-jdk unzip wget && \
ln -s /usr/bin/nodejs /usr/bin/node && \
wget -q https://dl.google.com/android/repository/tools_r25.2.3-linux.zip -O /tmp/android-sdk.zip && \
unzip /tmp/android-sdk.zip -d ${ANDROID_HOME} && rm /tmp/android-sdk.zip
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools