Skip to content

Instantly share code, notes, and snippets.

View 11808s8's full-sized avatar
☁️

Adriano Gomes 11808s8

☁️
View GitHub Profile
@11808s8
11808s8 / display_brightness
Created July 25, 2021 05:22
Alias to set the Display Brightness at the OS level on Linux
alias display_brightness='xrandr --output $(xrandr -q | grep " connected" | cut -d" " -f1) --brightness $1'
@11808s8
11808s8 / configure-ec2-wordpress-nginx-php-mariadb.sh
Last active October 28, 2023 17:43
Script for setting up an AWS EC2 instance with LEMP + Wordpress. Can be run on the User Data setting while launching an instance.
#!/usr/bin/env bash
# Author: @11808s8 - Adriano
# Email: [email protected]
# Version: 1.1.0 - 07/04/2020
#
# @TODO: Refactor this, breaking parts into modules
# and include more comments/User feedbacks
#
# @TODO: Remove hardcoded credentials
@11808s8
11808s8 / project_file_transfer_from_tmp.sh
Created February 19, 2020 14:07
Bash script that moves a Controller/Model/DTO project from /tmp/ to it's /var/www/ project destiny using RSYNC.
#!/bin/bash
#
# Script for moving project generated files on the /tmp/ filesystem
# and put them into a web project folder in /var/www/
#
# Its base usage grabs, recursively, files inside a
# /tmp/<type of project: api, crud, ...> folder and
# follows a structure of Controller, Model and Data Transfer Object,
# sending to the destiny folder maintaining the same structure
#
#!/bin/bash
# Script to configure and the remote project updater
# Version 2.0.0
# author: Adriano Gomes da Silva <[email protected]>
clear
_VERSIONING_FOLDER="remoteversions"
_PROJECT_FOLDER="<local web app folder>"
@11808s8
11808s8 / remoteProjectUpdater.sh
Last active February 18, 2020 20:41
Base BashScript for updating a remote project using RSYNC and a local git repo. It also verifies if your local GIT REPO is up to date.
#!/bin/bash
# Base script for remote project updating
#
# What it does?
# - Make a versioning folder, if you don't have one
# - Create a .txt file in the specified versioning folder with the current git HEAD
# that will be uploaded to the remote server
# - uses rsync to connect to the remote and update the files there
#
@11808s8
11808s8 / localgitupdate.sh
Created February 18, 2020 19:54
Script to automatically run git update for a specified folder.
#!/bin/bash
#Script to update a local GIT repo in case it isn't updated.
#
# Version 1.0.0
# author: Adriano Gomes da Silva <[email protected]>
#
usage() {
cat << EOM
@11808s8
11808s8 / kill_postgres_at_port_5432.sh
Created December 30, 2019 04:07
Script that searches for the PostgreSQL server running at port 5432, grabs it's PID and kills it's process with the discovered PID.
#!/bin/bash
sudo kill $(sudo ss -lptn 'sport = :5432' | grep -o 'pid=[0-9]\+' | grep -o '[0-9]\+')
@11808s8
11808s8 / touchpad_revive.sh
Created August 3, 2019 13:18
Just a bash script that removes the touchpad kernel module and then loads it again. Why is it necessary? Sometimes after unlocking Ubuntu 18.04 touchpad just freezes.
#!/bin/bash
sudo rmmod i2c_hid && sudo modprobe i2c_hid