Skip to content

Instantly share code, notes, and snippets.

View ddmitov's full-sized avatar

Dimitar D. Mitov ddmitov

View GitHub Profile
@ddmitov
ddmitov / rss-meter
Last active June 6, 2022 07:33
Linux RSS Memory Meter
#!/usr/bin/perl
# Linux RSS Memory Meter version 2.0.
# MIT 2019 Dimitar D. Mitov
# https://github.com/ddmitov
# Linux RSS Memory Meter can measure
# the combined RSS memory usage of several processes
# together with their child processes
# providing every second a total in megabytes.
#!/usr/bin/env python3
# Snake Works 2020.
# https://github.com/ddmitov/
#
# /^\/^\
# _| O| O|
# \/ / \_/\_/ \
# \____|____ \
# \_______ \ ______
import os
import json
def lambda_handler(event, context):
json_region = os.environ['AWS_REGION']
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
@ddmitov
ddmitov / selenium.py
Created August 29, 2020 10:47
Minimal testing script for the Selenium Python package
#!/usr/bin/python3
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--window-size=1920x1080')
@ddmitov
ddmitov / initials-maker.py
Last active August 28, 2020 20:33
Extracts Initials from any name that can be written in Latin letters
#!/usr/bin/python3
# Initials Maker v.1.0
# by Dimitar D. Mitov
# https://github.com/ddmitov
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
@ddmitov
ddmitov / turtle-chessboard.py
Last active May 28, 2020 20:02
Implementation of the famous Python Turtle Chessboard task
#!/usr/bin/python3
# Turtle Chessboard v.1.0
# by Dimitar D. Mitov
# https://github.com/ddmitov
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
@ddmitov
ddmitov / check-urls.py
Last active October 6, 2018 18:34
Simple Python URL Tester for my Markdown files
#! /usr/bin/python
###############################################################################
# URL Tester
# Version 0.2
#
# Usage:
# python check-urls.py CREDITS.md
#
# CREDITS
@ddmitov
ddmitov / sshexec.pl
Created August 16, 2018 11:37
Execute remote commands using Perl5, Net::OpenSSH and a private key
#!/usr/bin/perl
use Net::OpenSSH;
my $ssh = Net::OpenSSH->new('root@server.domain.name', key_path => '/path/to/private_key');
$ssh->error and die "Couldn't establish SSH connection: ".$ssh->error;
my ($stdin, $stdout, $stderr, $pid) = $ssh->open3("ls -l");
my @output = <$stdout>;
@ddmitov
ddmitov / opera-session-converter.sh
Last active June 25, 2017 20:21
Opera Session Converter, v.0.1 will convert all your Opera session files in the current folder to plain text files with URLs only."
#!/usr/bin/env bash
# Welcome message:
echo " "
echo "Opera Session Converter, v.0.1."
echo "Will convert all your Opera session files in the current folder to"
echo "plain text files with URLs only."
echo "Old files will be preserved and new files with"
echo "a .win.txt extension will be created."
echo "Input files must be without spaces!"