Skip to content

Instantly share code, notes, and snippets.

View iKalin's full-sized avatar

Kalin Tsekov iKalin

View GitHub Profile
iKalin /
Last active November 7, 2023 20:43 — forked from scottopell/
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
# this file is library named
# 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')
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 =, line) # match port to find dump file
slotsMatch =, line) # match hash-slots, only masters have hash-slots declared in conf file
iKalin /
Created May 19, 2019 09:47
have 120 instances, which for this example translates to 235 volumes
volCheck() {
# 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 /
Created February 24, 2019 08:43 — forked from miglen/
AWS Certification guide and notes on how to prepare for the aws associate certification architect, sysops and developer exams

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 /
Created August 15, 2018 06:35 — forked from spara/
Install Docker CE 17.05 and Compose 1.13.0

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 /
Created July 15, 2017 19:13 — forked from John07/
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.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from
# 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).
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
iKalin / 0.
Created August 19, 2016 09:50 — forked from mikhailov/0.
Nginx + secure pseudo-streaming
# 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:
cd /usr/src
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
iKalin /
Created July 19, 2016 11:27 — forked from derekkwok/
Python 3.5 async "Hello World" server
import asyncio
import socket
http_response = b"""\
HTTP/1.1 200 OK
Hello, World!