Skip to content

Instantly share code, notes, and snippets.

View prikid's full-sized avatar

Serhii Riabcheniuk prikid

View GitHub Profile
@prikid
prikid / cleanup_ubuntu.md
Last active October 11, 2025 13:35
Cleaning up disk space on Ubuntu

Cleaning up disk space on Ubuntu is a common task to keep your system running smoothly and prevent "disk full" errors. Here's a comprehensive guide, starting with identifying what's taking up space:

1. Inspect Disk Usage

Before you start deleting, it's good to know where your disk space is being used.

  • Graphical Tool (Disk Usage Analyzer - Baobab):
    • If you have a desktop environment, the "Disk Usage Analyzer" (often called Baobab) is a great visual tool. You can usually find it by searching in your applications menu. If not installed, you can install it with:

sudo apt install baobab

@prikid
prikid / clean_ubuntu.md
Last active March 21, 2024 18:43
Clean up free space on Ubuntu

shows top 10 biggest subdirs in the current dir

du -sk * | sort -nr | head -10

sudo apt-get clean
sudo apt autoremove
sudo apt autoclean
@prikid
prikid / no_russia.js
Last active October 10, 2023 19:29
Prevent contact form submitting in BigCommerce for .ru email addresses.
// Just add this script to you BigCommerce store using Scripts Manager
// and it will prevent submiting the contact form for all email addresses nding on .ru
document.addEventListener("DOMContentLoaded", function(event) {
const form = document.querySelector('form[data-contact-form]');
if (form) {
form.addEventListener("submit", e=>{
const email_input=document.getElementById('contact_email');
if (email_input && email_input.value.trim().endsWith('.ru')){
console.log('russia is a terrorist state!');
@prikid
prikid / run_mhddos_proxy_apple_silicon_m1_m2.md
Last active April 21, 2023 10:46
How to run the MHDDOS_PROXY (the IT Army of Ukraine official tool) on Mac Apple Silicone M1 or M2

How to run the MHDDOS_PROXY (the IT Army of Ukraine official tool) on Mac Apple Silicone M1 or M2

There are builds of MHDDOS_PROXY only for Linux and Windows, for all other systems the Docker solution is recommend. But for some reason the Docker solution does not work on my Macbook Air with Apple Silicone M1 processor.

So, as a workaround I use the virtual machine with Ubuntu created by using Multipass

Here are the steps I made:

  1. Install Multipass by the command brew install multipass or download and run the installer
@prikid
prikid / enable_swapfile_ubuntu_20_04.sh
Created April 19, 2022 20:38
Swap file enable on Ubuntu 20.04
sudo fallocate -l 4G /swapfile # allocating 4 Gb for swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# enable swapfile on startup
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
#optional tuning
sudo sysctl vm.swappiness=10
@prikid
prikid / aws_ec2_swap.sh
Last active April 19, 2022 19:15
AWS EC2 swap enable
# 4 GB
sudo dd if=/dev/zero of=/swapfile bs=128M count=32
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
# Start the swap file at System Startup
echo "swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
@prikid
prikid / build_geckodriver_linux_aarch64.sh
Last active April 19, 2022 18:57
Build geckodriver from source on linux aarch64/arm64
apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu libc6-armhf-cross libc6-dev-armhf-cross
curl https://sh.rustup.rs -sSf | sh -s -- -y
. $HOME/.cargo/env
rustup target install aarch64-unknown-linux-gnu
GECKODRIVER_VERSION=`curl https://github.com/mozilla/geckodriver/releases/latest | grep -Po '[0-9]+.[0-9]+.[0-9]+'`
wget https://github.com/mozilla/geckodriver/archive/refs/tags/v$GECKODRIVER_VERSION.tar.gz -O geckodriver.tar.gz
tar -zxf geckodriver.tar.gz && rm geckodriver.tar.gz
cd geckodriver-$GECKODRIVER_VERSION
printf "[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" > .cargo/config
@prikid
prikid / install_docker_ubuntu.sh
Last active June 24, 2022 02:12
Install docker and docker compose 2 on Ubuntu
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release \
wget
wget -O - https://get.docker.com/ | bash
@prikid
prikid / install_uashield.sh
Last active April 17, 2022 06:42
Script for installing and running uashied headless on Ubuntu 20
#!/bin/sh
sudo apt-get update
sudo apt-get -y install wget git htop
cd ~
#installing nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
export NVM_DIR="$HOME/.nvm"
@prikid
prikid / AdocWriter.py
Last active August 7, 2021 13:20
Generates AsciiDoc files using the data extracted from the UML Model XML file (it is a part of the project for ASAM written by Serhii Riabcheniuk https://www.fiverr.com/serhii_rb)
import re
import uuid
from pathlib import Path
from typing import List, Union
from faker import Faker
from lib import DataClasses
from lib.DataClasses import MainClassData, ClassData, ClassAttrData, EnumData, EnumAttrData