Skip to content

Instantly share code, notes, and snippets.

🔥

Gonzalo Trenco gonzalo-trenco

🔥
Block or report user

Report or block gonzalo-trenco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gonzalo-trenco
gonzalo-trenco / setFileType.js
Last active May 26, 2017
function to override FileReader API object type property
View setFileType.js
function setFileType(file, type) {
Object.defineProperties(file, {
'type': {
writable: true
}
});
file.type = type;
return file;
}
@gonzalo-trenco
gonzalo-trenco / centos_iptables_setup.sh
Created May 26, 2017
CentOS iptables setup for common webserver
View centos_iptables_setup.sh
#!/usr/bin/env bash
## IPTABLES SETUP
iptables -F;
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP;
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP;
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP;
@gonzalo-trenco
gonzalo-trenco / clean.sh
Created Aug 10, 2018
Clean releases directories over 4 days old
View clean.sh
#!/bin/bash
# releases should be name after formatted timestamp
# date "+%Y%m%d%H%M%S" in order to work
time_margin=$(date -d "4 days ago" "+%Y%m%d%H%M%S")
for i in $( ls releases ); do
if [ "$time_margin" -gt "$i" ]; then
echo "$i will be removed"
rm -rf releases/$i
@gonzalo-trenco
gonzalo-trenco / copyToVagrant.sh
Created Aug 13, 2018
Copy file from local to vagrant VM
View copyToVagrant.sh
#!/bin/sh
OPTIONS=`vagrant ssh-config | tail -n +2 | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} /File/To/Copy vagrant@YourServer:/Where/To/Put/File
You can’t perform that action at this time.