Skip to content

Instantly share code, notes, and snippets.

View itcrab's full-sized avatar
💭
We are self-made - our actions define us.

Arcady Usov itcrab

💭
We are self-made - our actions define us.
  • Kaliningrad, Russia
View GitHub Profile
@itcrab
itcrab / install_wireguard_on_openvz.md
Last active March 27, 2025 13:52
Install WireGuard on OpenVZ for Ubuntu 22.04 / 20.04

The problem

We have Ubuntu 22.04 / 20.04 VPS on OpenVZ and trying install WireGuard like this:

# curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
# bash ./wireguard-install.sh
OpenVZ is not supported

The solution

day_flow = lambda *actions: print('\n'.join(actions))
year_days = 365.25
max_days = 65 * year_days
cur_days = 0
i_am_developer = lambda: cur_days <= max_days
while i_am_developer():
day_flow('sleep', 'eat', 'develop', 'eat', 'develop', 'eat', 'family', 'develop')
@itcrab
itcrab / linkedin_relations_backup.py
Last active October 1, 2024 22:36
Backup relations from Linkedin
"""
For work you need: copy as cUrl (bash) any of `GET` http-requests in Network tab (Chrome Dev-Tools):
- https://www.linkedin.com/voyager/api/relationships/dash/connections?decorationId=com.linkedin.voyager.dash.deco.web.mynetwork.ConnectionListWithProfile-15&count=40&q=search&sortType=RECENTLY_ADDED&start=40
After paste press Enter twice :)
"""
import logging
import time
import requests
logging.basicConfig(level=logging.DEBUG)
@itcrab
itcrab / ya-disk-large-file-backuper.py
Last active June 26, 2016 17:25
Script for backup largest files (more than 10GB) to Yandex.Disk through WebDAV (10GB is limit on 06.2016).
#!/usr/bin/python3
import argparse
import os
import re
import sys
import subprocess
from datetime import datetime
# -*- coding: utf-8 -*-
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально
# (порт на ваше усмотрение), который показывает содержимое страниц Хабра.
# С одним исключением: после каждого слова из шести букв должен стоять
# значок «™». Примерно так:
#
# http://habrahabr.ru/company/yandex/blog/258673/
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают
# проблемы и особенности TLS. Я хочу воспользоваться этой возможностью, чтобы