Skip to content

Instantly share code, notes, and snippets.

View ddmitov's full-sized avatar

Dimitar D. Mitov ddmitov

View GitHub Profile
import os
import json
def lambda_handler(event, context):
json_region = os.environ['AWS_REGION']
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
#!/usr/bin/env python3
# Snake Works 2020.
# https://github.com/ddmitov/
#
# /^\/^\
# _| O| O|
# \/ / \_/\_/ \
# \____|____ \
# \_______ \ ______
@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 / 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.
@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 / 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 / jpg-resizer.pl
Created March 20, 2016 08:22
Simple resizer for multiple JPG images based on the 'convert' binary from ImageMagick. Full path to a directory containing JPG files is the first and only command line argument needed. Original files are not overwritten! Resized images are saved in a subfolder.
#!/usr/bin/perl -w
use strict;
use warnings;
my $FOLDER_TO_OPEN = $ARGV[0];
opendir (my $directory_handle, $FOLDER_TO_OPEN) or die $!;
my $output_directory_name = "converted-images";