Skip to content

Instantly share code, notes, and snippets.

View yuchdev's full-sized avatar
💭
Open for new opportunities

Yurii Cherkasov yuchdev

💭
Open for new opportunities
  • Open for new opportunities
  • Nibiru
View GitHub Profile
@yuchdev
yuchdev / random_protonvpn.py
Last active March 18, 2022 08:03
Choose random ProtonVPN server
import os
import sys
import time
import random
import argparse
# Key is country code, value is the number of servers to use
SERVER_LIST = {
"AR": [*range(1, 8)],
"AU": [*range(13, 44)],
@yuchdev
yuchdev / bash-snippets.sh
Created June 23, 2022 10:06
Bash Code Snippets
#!/bin/sh
# Backup Partititon
dd if=/dev/sda of=/mnt/backup/sda.img conv=noerror
fdisk -l /dev/sda > /mnt/backup/sda.info
dd if=/dev/sdb of=/mnt/backup/sdb.img conv=noerror
fdisk -l /dev/sdb > /mnt/backup/sdb.info
# execute "git pull" in every dir
for dir in ~/projects/git/*
@yuchdev
yuchdev / create_venv.sh
Created July 10, 2022 05:15
Create venv
#!/bin/bash
# Install
pip3 install --user virtualenv
virtualenv –version
# Activate
virtualenv venv
source venv/bin/activate
@yuchdev
yuchdev / disable-serv.cmd
Created August 7, 2022 18:19
Disable unnecessary Windows services
rem 1.
sc config "Name of Service" start= disabled
sc stop "Name of Service"
rem 2.
wmic service where name='SQLWriter' call ChangeStartmode Disabled
rem https://www.minitool.com/news/windows-10-services-to-disable.html
rem https://helpdeskgeek.com/windows-10/windows-10-unnecessary-services-you-can-disable-safely/
rem https://www.groovypost.com/howto/12-windows-10-services-that-are-safe-to-disable/
@yuchdev
yuchdev / exclusive_product.cpp
Created July 18, 2023 05:43
Exclusive product, little test assignment on C++
#include <iostream>
#include <numeric>
#include <vector>
/// @brief: Calculates array of same size, where each element is the product
/// of all elements excluding corresponding by index
/// Algorithm: O(n) time, O(n) space
/// @param: array of int
/// @return: array of same size
/// @example: {1,2,3,4} => {24, 12, 8, 6}, {1, 2, 3, 4, 5} => {120, 60, 40, 30, 24}