Skip to content

Instantly share code, notes, and snippets.

View Ara4Sh's full-sized avatar

Arash Shams Ara4Sh

View GitHub Profile

Monolith

The Monolithic Ball of Mud

  • The Ball Of Mud represents the worst case scenario for a Monolith. Also called as Spaghetti Code.
  • No clear isolation in the application.
  • Complex dependencies where everything depends on every other thing.
  • Hard to understand and harder to modify.

Cleaning Up The Ball Of Mud

  • To clean up the ball of mud we introduce isolation into the application by dividing the application along clear domain boundaries.
  • We introduce packages and libraries that help isolate related pieces of code. They provide a clean and consistent interface.
@Ara4Sh
Ara4Sh / workflow.md
Created March 23, 2020 22:26 — forked from stuartsaunders/workflow.md
Versioning and Git Workflow

Semantic Versioning

Details:

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

@Ara4Sh
Ara4Sh / resize.md
Created February 21, 2020 17:30 — forked from b1naryth1ef/resize.md

Pillow

(64, 64)
        0.217446804047 total time
        217446.804047 ns / op
(128, 128)
        0.085732460022 total time
 85732.460022 ns / op
#! /bin/sh -u
networksetup -listallnetworkservices | awk 'NR>1' | while read SERVICE ; do
if networksetup -getautoproxyurl "$SERVICE" | grep '^Enabled: Yes' >/dev/null; then
networksetup -setautoproxystate "$SERVICE" off
sleep 2
networksetup -setautoproxystate "$SERVICE" on
echo "$SERVICE" bounced.
fi
done
@Ara4Sh
Ara4Sh / slack-proxy.pac
Last active February 2, 2020 12:02
slack-proxy.pac
function FindProxyForURL(url, host) {
if (shExpMatch(host, "slack.com") ||
shExpMatch(host, "*.slack.com") ||
shExpMatch(host, "*.slack-msgs.com") ||
shExpMatch(host, "*.slack-files.com") ||
shExpMatch(host, "*.slack-imgs.com") ||
shExpMatch(host, "*.slack-edge.com") ||
shExpMatch(host, "*.slack-core.com") ||
shExpMatch(host, "*.slack-redir.net")) {
@Ara4Sh
Ara4Sh / disable-hyperthreading.sh
Created January 30, 2020 11:32 — forked from johanburati/disable-hyperthreading.sh
Disable hyperthreading
#!/bin/bash
for cpu in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list)
do
echo 0 > /sys/devices/system/cpu/cpu${cpu}/online
done
@Ara4Sh
Ara4Sh / virt-install-ubuntu.sh
Created December 11, 2019 09:20
sample script to install ubuntu cloud with virt-install and cloud-init
#!/bin/bash
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
# Check if domain already exists
virsh dominfo $1 > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
@Ara4Sh
Ara4Sh / statsd-client.sh
Created December 11, 2019 09:15
Very simple bash client to send metrics to a statsd server https://github.com/statsd/statsd/blob/master/examples/statsd-client.sh
#!/usr/bin/env bash
#
# Very simple bash client to send metrics to a statsd server
# Example with gauge: ./statsd-client.sh 'my_metric:100|g'
#
# Alexander Fortin <alexander.fortin@gmail.com>
#
host="${STATSD_HOST:-127.0.0.1}"
port="${STATSD_PORT:-8125}"
@Ara4Sh
Ara4Sh / check_gzip.sh
Created December 11, 2019 09:12
check gzip is enabled on the website or not
#!/bin/bash
URL=$1
PLAIN="$(curl $URL --silent --write-out "%{size_download}\n" --output /dev/null)"
GZIPPED="$(curl $URL --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null)"
if test $PLAIN -gt $GZIPPED
then
echo "supported"
else
@Ara4Sh
Ara4Sh / nginx.conf
Created August 28, 2019 18:01 — forked from justincormack/nginx.conf
Using Lua and Nginx to proxy Amazon web services example
# example location parts of nginx.conf
# add your own AWS keys, server lines etc, and set your aws domains, paths
http {
# you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/
lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;";
server {
listen 80;