Skip to content

Instantly share code, notes, and snippets.

View doromones's full-sized avatar
🚀
per rectum ad astrum

Anton doromones

🚀
per rectum ad astrum
  • Starladder
  • Ukraine, Kiev
  • 07:26 (UTC +02:00)
View GitHub Profile
#!/bin/bash
# Define the current working directory and maximum file size (70 MB in bytes)
directory_path=$(pwd)
max_file_size=$((70 * 1024 * 1024))
# Iterate over all .mp3 files in the directory
for file in "$directory_path"/*.mp3; do
# Check if the file exists
if [[ -f "$file" ]]; then
$ sudo apt install build-essential checkinstall zlib1g-dev
$ cd ~/Downloads
$ wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
$ tar xf openssl-1.1.1o.tar.gz
$ cd ~/Downloads/openssl-1.1.1o
$ ./config --prefix=/opt/openssl-1.1.1o --openssldir=/opt/openssl-1.1.1o shared zlib
$ make
$ make test
@doromones
doromones / yubikey-windows10.md
Created August 4, 2021 19:41 — forked from andreibosco/yubikey-windows10.md
Setting up Yubikey with SSH and Git on Windows 10 + Powershell
require 'net/http'
require 'json'
require 'open-uri'
require 'fileutils'
HEROES_URI = "https://mapi.mobilelegends.com/hero/list"
HERO_URI = "https://mapi.mobilelegends.com/hero/detail?id=%s"
heroes_json = JSON.parse(Net::HTTP.get_response(URI(HEROES_URI)).body)
heroes_json['data'].each do |hero_short|
@doromones
doromones / run.sh
Last active February 11, 2020 11:36
pg dump restore
/usr/bin/pg_dump --dbname=DB_NAME --file=/home/user/BACKUPS/localhost/DB_NAME-2020_02_11_13_30_27-dump.sql.tar.gz \
--format=c --compress=9 --no-owner --clean \
--exclude-table-data=activities --exclude-table-data=activity_logs \
--username=postgres --host=127.0.0.1 --port=5432
/usr/bin/pg_restore --dbname=DB_NAME --clean --format=c \
--username=postgres --host=127.0.0.1 --port=5432 \
/home/user/BACKUPS/localhost/starladder_dev-2020_02_11_13_30_27-dump.sql.tar.gz
sudo wget -O /usr/share/anycable-go-v0.6.4-linux-amd64 https://github.com/anycable/anycable-go/releases/download/v0.6.4/anycable-go-v0.6.4-linux-amd64
sudo chmod +x /usr/share/anycable-go-v0.6.4-linux-amd64
sudo ln -s /usr/share/anycable-go-v0.6.4-linux-amd64 /usr/bin/anycable-go
@doromones
doromones / Dockerfile
Created December 10, 2019 16:14 — forked from erdostom/Dockerfile
Good starter Dockerfile + docker-compose.yml for Rails 6.
FROM ruby:2.6.3-alpine
RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn
RUN gem install bundler:2
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --check-files
#!/bin/bash
protected_branches=(develop master)
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [[ " ${protected_branches[@]} " =~ " ${current_branch} " ]]
then
echo "Push to $current_branch is disabled"
exit 1 # push will not execute
else
# Running:
saved_changes
{
"status" => [
[0] 0,
[1] 3
],
"updated_at" => [
[0] 2019-06-07 16:27:36 UTC,
@doromones
doromones / geonames_postgres.rb
Last active June 3, 2019 16:57 — forked from kaspergrubbe/geonames_postgres.rb
Import files from Geonames.com into a PostgreSQL database that runs Postgis
#!/usr/bin/env ruby
require 'open3'
require 'fileutils'
require 'tempfile'
CITIES_POPULATION = 500
LANGS = %w(ru en uk zh tr)
IN_LANGS_QUERY_STR = LANGS.map{|w| "'#{w}'"}.join(',')
def run_command(command)