Skip to content

Instantly share code, notes, and snippets.

View osminogin's full-sized avatar
🇷🇺
Working from home

Vladimir Osintsev osminogin

🇷🇺
Working from home
View GitHub Profile
@osminogin
osminogin / clean_db_without_delete.sql
Created April 10, 2022 10:02
Cleaning up a PostgreSQL database without deleting it
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
@osminogin
osminogin / git-repo-mirror.md
Created December 31, 2021 12:50 — forked from schmich/git-repo-mirror.md
Mirroring a repo to BitBucket
  1. Create an empty repo in BitBucket
  2. git clone --bare git@github.com:user/repo.git
  3. cd repo.git
  4. git push --mirror git@bitbucket.org:user/repo.git
@osminogin
osminogin / docker-compose.yaml
Created July 28, 2020 07:57
Example compose file with Traefik settings
version: "3.3"
services:
traefik:
image: "traefik:v2.0.0-rc3"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
[Unit]
Description=MongoDB Server
Wants=network-online.target
Requires=docker.service
After=docker.service network.target
[Service]
TimeoutStartSec=120
Restart=always
RestartSec=15s
@osminogin
osminogin / pfx-convert.sh
Created February 16, 2018 09:04
Convert a PFX to a seperate key, cert and CA cert files
openssl pkcs12 -in $1 -nocerts -nodes | sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > output.key
openssl pkcs12 -in $1 -clcerts -nokeys | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > output.crt
openssl pkcs12 -in $1 -cacerts -nokeys -chain | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ca.crt
@osminogin
osminogin / settings.json
Last active November 19, 2017 13:32
Activate virtualenv for VS Code integrated terminal (no external dependencies, just env/ in project dir)
{
"terminal.integrated.shellArgs.linux": ["-c", "source ./env/bin/activate; zsh -i"]
}
@osminogin
osminogin / get_public_ip.sh
Created October 31, 2017 08:13
Get dynamic public IP from command shell
#!/bin/bash
public_ip=$(curl -s 'https://api.ipify.org/?format=text')
echo $public_ip
@osminogin
osminogin / output.txt
Created September 28, 2017 20:34 — forked from ei-grad/output.txt
Python multiprocessing.Queue sucks
zmq: 2.904726
queue: 12.812472
@osminogin
osminogin / gist:4e1c45b103c3e8eb06dc8779a900c3fd
Last active September 6, 2017 14:16
Set up command alias in the Debian way.
sudo update-alternatives --install /usr/bin/google-chrome chromium-browser /usr/bin/chromium-browser 10
@osminogin
osminogin / Dockerfile
Last active October 7, 2016 20:49
Docker electrum daemon with websocket enabled
FROM python:2.7-slim
ENV ELECTRUM_VERSION 2.7.2
RUN apt-get update && apt-get -y install --no-install-recommends \
python-qt4 \
git
RUN pip install \
https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz \