Skip to content

Instantly share code, notes, and snippets.

View anton-petrov's full-sized avatar
:octocat:
🥷

Anton Petrov anton-petrov

:octocat:
🥷
View GitHub Profile
@anton-petrov
anton-petrov / response_23462456245634
Last active October 4, 2021 08:38
ответ службы моделирования
{
"task_id": "f979ee5f-f23a-4781-b4d7-e650240ac867",
"task_status": "SUCCESS",
"client_id": "3da0118b-869e-48e0-aeee-bb6ebb2bd8f8",
"result": {
"items": [
{
"field_id": "134ad57e-35e7-49c6-86b2-ba61b4f77e2d",
"real_crop_id": "d9007491-9e9f-4dc5-81f3-c6aa4392dcc2",
"start_date": "2022",
@anton-petrov
anton-petrov / generate-ssh-key.sh
Created September 14, 2021 10:32 — forked from denisgolius/generate-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@anton-petrov
anton-petrov / README.MD
Created August 8, 2021 08:14 — forked from RichardBronosky/README.MD
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@anton-petrov
anton-petrov / settings.json
Last active July 30, 2021 09:20
Settings for Windows Terminal
{
"$schema": "https://aka.ms/terminal-profiles-schema",
// Add custom actions and keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
"actions": [
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
{
@anton-petrov
anton-petrov / winfonts.sh
Created January 27, 2021 16:46
Install Windows fonts in Fedora
sudo dnf install curl cabextract xorg-x11-font-utils fontconfig
sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
sudo fc-cache -v
@anton-petrov
anton-petrov / App Indicator
Created January 26, 2021 04:18
App Indicator
https://extensions.gnome.org/extension/615/appindicator-support/
@anton-petrov
anton-petrov / python_environment_setup.md
Created December 30, 2020 05:44 — forked from wronk/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@anton-petrov
anton-petrov / home-brew_m1.sh
Created December 24, 2020 04:38
Homebrew for Apple M1
# We'll be installing Homebrew in the /opt directory.
cd /opt
# Create a directory for Homebrew. This requires root permissions.
sudo mkdir homebrew
# Make us the owner of the directory so that we no longer require root permissions.
sudo chown -R $(whoami) /opt/homebrew
# Download and unzip Homebrew. This command can be found at https://docs.brew.sh/Installation.
@anton-petrov
anton-petrov / heartbeat.py
Created September 4, 2020 12:58
Пульс по вебкамере
# https://habr.com/ru/post/517424/
import cv2
import io
import time
import numpy as np
from matplotlib import pyplot as plt
@anton-petrov
anton-petrov / actual_time_in_linux.sh
Created August 8, 2020 12:13
Update time in GNU/Linux OS to actual state.
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"