Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kalin Tsekov iKalin

🎯
Focusing
View GitHub Profile
View redis_aws.py
# this file is library named utils.py
# in this article's example it will be imported
# import our dependencies
import boto3 # boto3 is an AWS SDK; the only library that needs installation
import urllib # urllib for http requests
import shutil # file and folder operations library
import re # regex library
def s3_upload(file_to_push, s3_path, bucket):
s3 = boto3.resource('s3')
View arch_redis.py
import urllib
# read in redis configuration file to parse ip addresses and ports
def readIn(confFile):
slotsPortArray = []
portRegex = re.compile("(?<=:)[0-9]*") # regex to match port in file
slotsRegex = re.compile("[0-9]+-[0-9]+") # regex to match hash-slot in file
addr = getIp() # ip address of machine
for line in confFile:
portMatch = re.search(portRegex, line) # match port to find dump file
slotsMatch = re.search(slotsRegex, line) # match hash-slots, only masters have hash-slots declared in conf file
@iKalin
iKalin / add_tag.sh
Created May 19, 2019 09:47
have 120 instances, which for this example translates to 235 volumes
View add_tag.sh
#!/bin/bash
volCheck() {
check="true"
count=1
# iterate through volumes, apply ec2 tags via tag()
while [ "$check" = "true" ]; do
vol=$(echo $blockDevices | awk -F ' ' -v item=$count '{print $item}')
if [ -n "$vol" ]; then #if vol exists, then call tag function
echo "vol $vol exists"
tag $vol
@iKalin
iKalin / aws-certification.md
Created February 24, 2019 08:43 — forked from miglen/aws-certification.md
AWS Certification guide and notes on how to prepare for the aws associate certification architect, sysops and developer exams
View aws-certification.md


AWS Certification notes

Those are my personal notes on AWS Solution Architect certification preparation. Hope you find them usefull.

To pass AWS certification, you should have:

  • Sound knowledge about most of the AWS services ( EC2, VPC, RDS, Cloudfront, S3, Route53 etc,)
  • Hands on experience with AWS services.
@iKalin
iKalin / docker-ce-17.05-ubuntu-16.04-LTS-install.md
Created August 15, 2018 06:35 — forked from spara/docker-ce-17.05-ubuntu-16.04-LTS-install.md
Install Docker CE 17.05 and Compose 1.13.0
View docker-ce-17.05-ubuntu-16.04-LTS-install.md

Installing Docker CE Edge for Ubuntu Linux

Remove previous versions of Docker and Compose

sudo apt-get purge docker-compose
sudo apt-get purge docker-ce

Install dependencies

@iKalin
iKalin / HLS_dvr.sh
Created July 15, 2017 19:13 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
View HLS_dvr.sh
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
@iKalin
iKalin / 0. nginx_setup.sh
Created August 19, 2016 09:50 — forked from mikhailov/0. nginx_setup.sh
Nginx + secure pseudo-streaming
View 0. nginx_setup.sh
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
@iKalin
iKalin / async-server.py
Created July 19, 2016 11:27 — forked from derekkwok/async-server.py
Python 3.5 async "Hello World" server
View async-server.py
import asyncio
import socket
SERVER_ADDRESS = (HOST, PORT) = '', 8888
REQUEST_QUEUE_SIZE = 5
http_response = b"""\
HTTP/1.1 200 OK
Hello, World!
"""
@iKalin
iKalin / stream_to_youtube.sh
Created January 29, 2016 03:46 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
View stream_to_youtube.sh
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube