Skip to content

Instantly share code, notes, and snippets.

View thiagomgo's full-sized avatar
💜

Thiago Gomes thiagomgo

💜
  • Brazil
View GitHub Profile
@thiagomgo
thiagomgo / php.ini
Created March 23, 2018 14:02
PHP suhosin config
[suhosin]
; Logging Configuration
suhosin.log.syslog.facility = 9
suhosin.log.use-x-forwarded-for = Off
; Executor Options
suhosin.executor.max_depth = 0
suhosin.executor.include.max_traversal = 4
suhosin.executor.disable_emodifier = On
suhosin.executor.allow_symlink = Off
@thiagomgo
thiagomgo / gist:16603603867c645df284a3eea72720c7
Last active March 1, 2018 14:55 — forked from weblancaster/gist:6e7f43fc02725ce747e224b0c4290906
Kill all container, remove all images and stop all containers
#stop all containers:
docker kill $(docker ps -q)
#remove all containers
docker rm $(docker ps -a -q)
#remove all old containers
docker rm $(docker ps --filter "status=exited" -q)
#remove all docker images
@thiagomgo
thiagomgo / install.sh
Created February 7, 2018 05:37
Configuration for Vsftpd on an EC2 Instance (Ubuntu)
#!/bin/bash
touch /etc/vsftpd.user_list
/etc/init.d/vsftpd restart
@thiagomgo
thiagomgo / openssh-7.3.sh
Last active January 2, 2018 14:30 — forked from stefansundin/openssh-7.3.sh
Install OpenSSH 7.3 in Ubuntu 16.04
ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
mkdir ssh-packages
cd ssh-packages
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i *.deb
@thiagomgo
thiagomgo / jmxremote_arguments.sh
Last active September 26, 2017 15:55 — forked from rponte/jmxremote_arguments.sh
Arguments to enable JMX on JVM - Example of setenv.sh file
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
@thiagomgo
thiagomgo / snapshots.py
Created June 12, 2017 22:08 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@thiagomgo
thiagomgo / zbx-exim-stats.sh
Last active March 11, 2017 21:08 — forked from crashdump/zbx-exim-stats.sh
A simple Zabbix statistics pusher. It check and report these values: - Number of running processes exim4 (trigger if 0) - Mails Queue Size (trigger if >500 and >1000) - Mails Received - Mails Error - Mails Received Size in Bytes - Mails Delivered - Mails Delivered Size in BytesImport the template. Assign to you hosts. Cron the .sh.. You're good …
#!/bin/bash
# Set Variables
EXIMLOG=/var/log/exim_mainlog
MYLOG=/tmp/exim_status.log
OFFSETFILE=/tmp/eximstatusoffset.dat
EXIMSTATS=/usr/sbin/eximstats
LOGTAIL=/usr/sbin/logtail
ZABBIX_SENDER=/usr/bin/zabbix_sender
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf
@thiagomgo
thiagomgo / mongo-recommendations
Last active April 15, 2022 06:51
MongoDB recommendations for CentOS 7 on AWS
vim /etc/udev/rules.d/85-ebs.rules
ACTION=="add|change", KERNEL=="xvdh", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="xvdi", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="xvdj", ATTR{queue/scheduler}="deadline"
vim /usr/lib/tuned/throughput-performance/tuned.conf
Change value "readahead" to 128
yum install -y numactl
chmod u+x /etc/rc.d/rc.local
@thiagomgo
thiagomgo / EC2-Tag-Assets-Lambda.py
Last active January 18, 2017 21:01 — forked from mlapida/EC2-Tag-Assets-Lambda.py
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site http://mlapida.com/thoughts/tagging-and-snapshotting-with-lambda
from __future__ import print_function
import json
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
@thiagomgo
thiagomgo / EC2-Start-Tagged-Lambda.py
Last active December 16, 2016 16:50 — forked from mlapida/EC2-Stopped-Tagged-Lambda.py
Using a lambda function, start/stop all instances that are tagged appropriately.
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')