Skip to content

Instantly share code, notes, and snippets.

View fortunto2's full-sized avatar

Rustam Salavatov fortunto2

View GitHub Profile
@fortunto2
fortunto2 / index.html
Last active February 23, 2022 17:24
map
{% load static %}
<!doctype html>
<html lang="en">
<head>
<title>Markers Map</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{% static 'map.css' %}">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
@fortunto2
fortunto2 / influx.yaml
Last active February 15, 2022 16:13
config influx 2 kube
## @section Global parameters
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
## @param global.storageClass Global storage class for dynamic provisioning
##
global:
mongodump --host localhost --port 27017 --username root --password XXXX --authenticationDatabase admin -d XXXX --gzip --archive > dump_`date "+%Y-%m-%d"`.gz
mongorestore --archive="mongodump-test-db" --nsFrom='test.*' --nsTo='examples.*'
#### build mongo dumper
git clone https://github.com/mongodb/mongo-tools
cd mongo-tools
sudo apt-get install -y libkrb5-dev
./make build -tools=mongodump,mongorestore
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help
vpn: ## Запускает
@wg-quick up /etc/wireguard/wg0.conf
@fortunto2
fortunto2 / runDSLR.sh
Created October 17, 2020 12:29
RUN canon DSLR as web-camera
#!/bin/sh
# https://askubuntu.com/questions/856460/using-a-digital-camera-canon-as-webcam
sudo modprobe v4l2loopback
gphoto2 --abilities
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
@fortunto2
fortunto2 / 1json_pydantic_django.py
Last active September 15, 2021 23:50
Use pydantic with django jsonfield and custom classes
import json
from fractions import Fraction
from pprint import pprint
from django.core import exceptions
from django.contrib.postgres.fields import JSONField
from psycopg2.extras import Json
import orjson
from pydantic.json import custom_pydantic_encoder
@fortunto2
fortunto2 / Dockerfile
Created March 16, 2020 15:57 — forked from 50Bytes-dev/Dockerfile
ACME traefik get manual dns challenge
FROM traefik:v2.2
RUN touch acme.json
RUN chmod 600 acme.json
@fortunto2
fortunto2 / clear.sh
Created March 6, 2020 18:25
очистка убунту от хлама
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@fortunto2
fortunto2 / index.html
Created July 26, 2019 20:30
life2film.com new logo pattern
<div>
<svg width="100%" viewBox="-2000 -2000 4000 4000"
preserveAspectRatio="xMidYMin meet"
style='stroke-width: 0px; background-color: black;'
>
<g class="g-circles" fill="none"
stroke-width="40"
stroke="url(#paint1)"
stroke-linecap="round"
@fortunto2
fortunto2 / vk_community_sender.py
Created December 29, 2018 10:22
Рассылка сообщений через группу пользователям
# -*- coding: utf-8 -*-
import requests
import os
import vk_api
# from vk_api import VkUpload
# from vk_api.utils import get_random_id
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
def get_random_id():