Skip to content

Instantly share code, notes, and snippets.

View miglen's full-sized avatar
👨‍💻

Miglen Evlogiev miglen

👨‍💻
View GitHub Profile
@miglen
miglen / .aws_bash_functions.sh
Created May 2, 2018 11:46
AWS Helper dotfiles
# Export AWS Credentials File
function export_aws(){
# usage: export_aws filename.csv
# default will be set to credentials.csv if not specified
file="${1:-credentials.csv}"
export AWS_ACCESS_KEY_ID=$(tail -1 ${file} | cut -d, -f 3)
export AWS_SECRET_ACCESS_KEY=$(tail -1 ${file} | cut -d, -f 4)
}
@miglen
miglen / ephemeral_tweets.py
Last active April 18, 2018 13:38
Ephemeral tweets - python implementation
from datetime import datetime, timedelta
import os
import twitter
'''
Ephermal twitter tweets written in python
Inspired by bit.ly/2JXNkpI
Relies on: github.com/bear/python-twitter
Runs easily as AWS Lambda: amzn.to/2oif6Wv
You may set environment variables to control
@miglen
miglen / hosts
Last active December 8, 2018 21:18
Bulgarian hosts configuration to block propaganda media (pi-hole)
# Peevski media group
# Source: https://github.com/openmediabg/dancewithme/blob/master/common/blocked_domains.js
0.0.0.0 monitor.bg
0.0.0.0 telegraph.bg
0.0.0.0 politika.bg
0.0.0.0 europost.eu
0.0.0.0 europost.bg
0.0.0.0 borbabg.com
0.0.0.0 tv7.bg
0.0.0.0 news7.bg
@miglen
miglen / osx_wifi_strenght_command_line.sh
Created January 14, 2018 18:46
Mac OS X Wifi Signal strength meter command line
#!/bin/bash
# Simple command to display the wireless strenght signal
#
clear
while x=1
do /System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I \
| grep CtlRSSI \
| sed -e 's/^.*://g' \
| xargs -I SIGNAL printf "\rWifi dBm: SIGNAL"
sleep 0.5
@miglen
miglen / my-books.md
Last active May 8, 2017 13:13
My Books

Legend

🏆 - Best Of

Fiction (24)

  • John Green - The Fault in Our Stars (Джон Грийн - Вината в нашите звезди) 🏆
  • Stephen King - 11/22/63 (Стивън Кинг - 22 ноември 1963) 🏆
  • Suzanne Collins - The Hunger Games (Сюзан Колинс - Игрите на глада) 🏆
  • Aldous Huxley - Brave New World (Олдъс Хъксли - Прекрасният нов свят)
@miglen
miglen / linux-networking-tools.md
Last active April 23, 2024 11:39
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
@miglen
miglen / better-ssh-authorized-keys-management.md
Last active September 14, 2021 05:07 — forked from sivel/better-ssh-authorized-keys-management.md
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@miglen
miglen / 2016-devops-conf-playlist.md
Last active June 23, 2018 10:08
2016 DevOps Conferences - Video playlists
@miglen
miglen / service-checklist.md
Last active April 8, 2017 22:42 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@miglen
miglen / change_instance.sh
Created February 15, 2016 16:33 — forked from nicosnyman/change_instance.sh
Easily change instance types on AWS EC2 with a bash script
#!/bin/bash
# Nico Snyman, nico@gammafly.com, 14/05/2015
# Change an instance type, while keeping snapshots
# This script will stop an instance identified by instance ID,
# take snapshots of all atached volumes, and restart it
# Use:
# -i instance ID - REQUIRED - stored in instance_id
# -t instance new instance type - REQUIRED - stored in instance_type
# -s if set to 0, no snapshot will be taken, dafault is 1
# (take snapshot of attached volumes) - stored in snapshot