Skip to content

Instantly share code, notes, and snippets.

View echr's full-sized avatar
🎯
Focusing

Eddy Christiandy echr

🎯
Focusing
View GitHub Profile
@echr
echr / README.md
Created June 10, 2021 15:13 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots

This script can help you find and remove unused AWS snapshots and volumes.

There is hardcoded list of regions that it searches, adjust the value to suit your needs.

Use snapshot.py snapshot-report to generate report.csv containing information about all snapshots.

snapshot.py snapshot-cleanup lets you interactively delete snapshot if it finds it is referencing unexisting resources.

./snapshots.py --help
@echr
echr / Media.blade.php
Created November 6, 2020 11:57 — forked from tanthammar/Media.blade.php
LiveWire Spatie Media Image upload with VueCroppa
<div id="media-comp" class="display-contents">
<media inline-template>
<form>
<div v-for="(image, index) in form" :key="index" @touchstart.stop @mousedown.stop class="col-span-6">
<h3 class="text-3xl font-medium">@{{ image.label }}</h3>
<p class="py-3">Allowed Width @{{image.width}}px, Height @{{image.height}}px, Max file size @{{image.maxFileSize}}</p>
<input v-model="image.value" wire:model="@{{ image.name }}" type="hidden">
<croppa v-model="image.model" :width="image.width" :height="image.height"
:placeholder="locale == 'sv' ? 'Välj en bild' : 'Choose an image'"
:accept="'image/*'" :file-size-limit="image.maxByte" :zoom-speed="3" :disable-drag-and-drop="false"
@echr
echr / forge.sh
Created April 14, 2020 07:48
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
package auth
import (
"context"
"net/http"
"strings"
"google.golang.org/grpc/metadata"
"github.com/andela/micro-api-gateway/pb/authorization"
@echr
echr / connections.sh
Created August 17, 2019 04:52 — forked from fideloper/connections.sh
Quick and dirty monitoring of mysql connections
#!/usr/bin/env bash
# 5 minutes between alerts
SECONDS_BETWEEN_ALERTS=300
# Track when we sent the last alert
LAST_ALERT=0
while true; do
NUMBER_CONNECTIONS=$(mysql --defaults-extra-file=/data/.prod.cnf -sNe "select count(*) as connection_count from INFORMATION_SCHEMA.PROCESSLIST;")
@echr
echr / composer.json
Created July 29, 2019 06:11 — forked from woozy/composer.json
Git hook to validate modified code against PSR-2 code standard
{
"require-dev": {
"squizlabs/php_codesniffer": "^3.2",
"exussum12/coverage-checker": "^0.10.0"
}
}
@echr
echr / webhook.php
Created July 7, 2019 15:31 — forked from jplitza/webhook.php
A basic PHP webhook handler for Github, just verifying the signature and some variables before calling another command to do the actual work
<?php
// where to log errors and successful requests
define('LOGFILE', '/tmp/github-webhook.log');
// what command to execute upon retrieval of a valid push event
$cmd = 'update-jekyll.sh 2>&1';
// the shared secret, used to sign the POST data (using HMAC with SHA1)
$secret = '00000000000000000000000000000000';
@echr
echr / update-openfire.sh
Created March 13, 2019 01:06 — forked from fabiomontefuscolo/update-openfire.sh
Update openfire keystore with Letsencrypt stuff
#!/bin/bash
#
# @author https://github.com/guusdk
#
# Checks for a known location where Let's Encrypt keys/certificates will be spontaneously exist.
# When files are detected, they're used to generate a new keystore, which is then used
# to replace the Openfire keystore.
set -e
@echr
echr / nginx-ssl-config
Created August 18, 2018 20:26 — forked from apollolm/nginx-ssl-config
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}