Skip to content

Instantly share code, notes, and snippets.

View thiagomgo's full-sized avatar
💜

Thiago Gomes thiagomgo

💜
  • Brazil
View GitHub Profile
@thiagomgo
thiagomgo / post-install-mint-ubuntu.sh
Last active October 19, 2023 08:10
Post-installation script for Linux Mint/Ubuntu
# Sudo without password
sudo visudo
username ALL=(ALL) NOPASSWD: ALL # At the end of the file
# Get the latest updates
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get -y upgrade
# Manage the repositories that you install
@thiagomgo
thiagomgo / ec2cw.sh
Last active June 15, 2019 13:53
Cron to put load average values into Cloud Watch
* * * * * root /bin/aws --region <REGION> cloudwatch put-metric-data --namespace="<NAMESPACE>" --metric-name "CPULoad" --value $(cat /proc/loadavg | awk '{print $1}') --dimensions AutoScalingWebGroup="ASG-NAME" > /tmp/cpuload-lastrun.log 2>&1;
@thiagomgo
thiagomgo / proftpd.conf
Last active October 30, 2017 20:36
Configuration for Proftpd on an EC2 Instance (CentOS 7)
# This is the ProFTPD configuration file
#
# See: http://www.proftpd.org/docs/directives/linked/by-name.html
ServerName "ProFTPD server"
ServerIdent off
ServerAdmin root@localhost
ServerType standalone
DefaultServer on
@thiagomgo
thiagomgo / proftpd.conf
Last active October 30, 2017 20:37
Configuration for Proftpd on an EC2 Instance (CentOS 6)
# This is the ProFTPD configuration file
# $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $
ServerName "ProFTPD server"
ServerIdent off
ServerAdmin root@localhost
ServerType standalone
DefaultServer on
AccessGrantMsg "User %u logged in."
DeferWelcome off
@thiagomgo
thiagomgo / Strem.io.desktop
Last active August 30, 2016 20:07 — forked from claudiosanches/install.sh
Install Strem.io on Linux Mint
[Desktop Entry]
Comment=Strem.io
Terminal=false
Name=Strem.io
Exec=/opt/stremio/Stremio.sh %F
Type=Application
Icon=/opt/stremio/stremio-white-small.png
@thiagomgo
thiagomgo / EnableAudioCCE
Created September 15, 2016 18:02
Enable speakers on Linux Mint to CCE Notebooks.
amixer -c 0 sset Headphone 100% unmute
@thiagomgo
thiagomgo / Install-Docker-on-Linux-Mint.sh
Last active September 29, 2016 14:42 — forked from sirkkalap/Install-Docker-on-Linux-Mint.sh
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@thiagomgo
thiagomgo / Install-Redis-Desktop-Manager.sh
Created October 11, 2016 14:49
Install Redis Desktop Manager from source on Ubuntu
# Clone the repository from GitHub
git clone --recursive https://github.com/uglide/RedisDesktopManager.git -b 0.8.0 rdm && cd ./rdm
# Compile the source
cd src/
./configure
source /opt/qt56/bin/qt56-env.sh && qmake && make
sudo checkinstall -D --install
sudo gdebi /home/$USER/rdm/src/src_*.deb
cd /usr/share/redis-desktop-manager/bin
@thiagomgo
thiagomgo / lambda-curl.py
Created November 1, 2016 19:13
A simple lambda function written in python to execute a curl command
def lambda_handler(event, context):
import subprocess
result = subprocess.call("curl -I http://foo.bar", shell=True)
return result
@thiagomgo
thiagomgo / fix-pendrive.sh
Created November 14, 2016 12:45
Script to re-write the device blocks to the appropriate size.
#/bin/bash
# Issue: Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes.
#
DEVICE_USB=/dev/sdb
sudo dd if=/dev/zero of=$DEVICE_USB bs=2048 count=32