Skip to content

Instantly share code, notes, and snippets.

View iKalin's full-sized avatar
🎯
Focusing

Kalin Tsekov iKalin

🎯
Focusing
View GitHub Profile
@iKalin
iKalin / fix_exfat_drive.md
Last active November 7, 2023 20:43 — forked from scottopell/fix_exfat_drive.md
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 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')
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
#!/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


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

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.
# 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
# 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
import asyncio
import socket
SERVER_ADDRESS = (HOST, PORT) = '', 8888
REQUEST_QUEUE_SIZE = 5
http_response = b"""\
HTTP/1.1 200 OK
Hello, World!
"""