Skip to content

Instantly share code, notes, and snippets.

View lex64's full-sized avatar

Aleksandar Milosavljević lex64

View GitHub Profile
@lex64
lex64 / refresh-env.sh
Last active August 16, 2023 16:39
Generate Laravel .env file from AWS Parameters Store
#!/bin/bash
PARAMATER="laravel-env"
REGION="eu-central-1"
WEB_DIR="/var/www/laravel"
WEB_USER="www-data"
# Get parameters and put it into .env file inside application root
aws ssm get-parameter --with-decryption --name $PARAMATER --region $REGION --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' -e 's/\\n/\n/g' -e 's/\\//g' > $WEB_DIR/.env
@lex64
lex64 / supervisord
Last active April 29, 2020 21:16
/etc/rc.d/init.d/supervisord for Elastic Beanstalk AMI 1
#!/bin/bash
#
# supervisord Startup script for the Supervisor process control system
#
# Author: Mike McGrath <[email protected]> (based off yumupdatesd)
# Jason Koppe <[email protected]> adjusted to read sysconfig,
# use supervisord tools to start/stop, conditionally wait
# for child processes to shutdown, and startup later
# Erwan Queffelec <[email protected]>
# make script LSB-compliant
# supervisor
#
# Author: Günter Grodotzki <[email protected]>
# Version: 2015-04-25
#
# set param "SUPERVISE=enable" to activate
#
packages:
yum:
python27-setuptools: []
@lex64
lex64 / install_mysql_client.sh
Created October 20, 2021 08:56 — forked from sshymko/install_mysql_client.sh
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@lex64
lex64 / fixperms.sh
Created February 4, 2022 11:40 — forked from webspectyler/fixperms.sh
Fix permissions in cPanel when getting 500 errors and Forbidden 403 errors
#! /bin/bash
#
# Date: Jan 26th 2012
# Author: Colin R.
# Revisions: Jacob "Boom Shadow" Tirey (boomshadow.net)
# Fixperms script for ServInt
#
# Fixperms script for cPanel servers running suPHP or FastCGI.
# Written for ServInt.net
# Copyright (C) 2012 Colin R.
@lex64
lex64 / sonarqube-docker-compose.yml
Created March 31, 2022 18:28
sonarqube production ready docker compose
version: "3"
services:
sonarqube:
image: sonarqube:community
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@lex64
lex64 / install-redis-cli-alpine.sh
Created April 11, 2024 06:38
Install redis-cli on alpine linux
export REDIS_VERSION="7.2.4"
export REDIS_DOWNLOAD_URL="http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz"
apk add --update --no-cache --virtual build-deps gcc make linux-headers musl-dev tar openssl-dev pkgconfig
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"
mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
cd /usr/src/redis/src
make BUILD_TLS=yes MALLOC=libc redis-cli
cp redis-cli /usr/local/bin/
#!/bin/bash
set -e
# Usage check
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <bucket-name>"
exit 1
fi