Skip to content

Instantly share code, notes, and snippets.

View fortunto2's full-sized avatar

Rust fortunto2

View GitHub Profile
@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():
@fortunto2
fortunto2 / cuda_installation_on_ubuntu_18.04
Last active December 5, 2018 14:50 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@fortunto2
fortunto2 / Makefile
Created November 15, 2018 21:18 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@fortunto2
fortunto2 / init.toml
Created October 8, 2018 20:38
~/.SpaceVim.d/init.toml
[options]
default_indent = 4
enable_debug = 1
enable_ale = 0
# enable_ycm = 1
# snippet_engine = "ultisnips"
line_on_the_fly = 0
realtime_leader_guide = 1
enable_tabline_filetype_icon = 1
enable_os_fileformat_icon = 1