Skip to content

Instantly share code, notes, and snippets.

View esmiz's full-sized avatar

Marcos Labad esmiz

View GitHub Profile
@esmiz
esmiz / git-branching-diagram.md
Created March 29, 2022 17:39 — forked from bryanbraun/git-branching-diagram.md
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml
  4. Customize as needed for your team.

@esmiz
esmiz / gist:9f50ff866ca75b9f68ad53d5eea78254
Created October 1, 2017 09:10 — forked from fduran/gist:1870507
Apache find IPs with most connections
# www.fduran.com
# Number of top 10 current TCP connections per IP
netstat -tan| grep -v 'LISTEN'| awk '{print $5}'| grep -v 'and' |grep -v 'Address' |cut -d':' -f1 |sort -n | uniq -c | sort -rn | head -n10
# Top 10 IPs in Apache log files
cd /var/log/apache2; for i in ./access.log*; do echo $i; cat $i | awk '{print $1}'| sort -n | uniq -c | sort -rn | head -n10; done
@esmiz
esmiz / gist:11da34306b96de5599409e186b15b841
Created September 12, 2017 12:59
Delete files found with grep
sudo egrep -Rli "Goya" . | sudo xargs rm
apt-get install htop
apt-get install nginx
apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
apt-get install libguestfs-tools
apt-get install curl
apt-get install iptables
<VirtualHost *:80>
DocumentRoot /home/<project>/www/current/web
ServerName www.<project>.com
ServerAlias preview..<project>.com
DirectoryIndex app.php
ErrorLog /var/log/apache2/<project>-error.log
LogLevel warn
CustomLog /var/log/apache2/<project>-access.log combined
<Directory /home/<project>/www/current/web>
@esmiz
esmiz / backup.sh
Last active February 6, 2017 10:15
Simple backup script
#!/bin/bash
echo "OK, starting now..."
#######################
# Set environment variables
#######################
SOURCE_FILES="/home/* /etc/*"
SOURCE_TEMPDIR=<temporary_files_directory>
TARGET_USER=<target_backup_server_user>
@esmiz
esmiz / iptables-web.sh
Last active January 20, 2017 11:21
base iptables script for web server
#!/bin/bash
# Mainly based on https://gist.github.com/thomasfr/9712418
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
@esmiz
esmiz / iptables.sh
Last active July 13, 2020 12:49 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@esmiz
esmiz / uruguayanToSpanish
Last active November 13, 2015 16:06
uruguayanToSpanish
$uruguayanToSpanish = [ 'frutilla' => 'fresa',
'durazno' => 'melocoton',
'viejo de la bolsa' => 'hombre del saco',
'alcancía' => 'hucha',
'musculosa' => 'camiseta de tirantes',
'papas' => 'patatas',
'choclo' => 'mazorca de maíz',
'refuerzo' => 'bocadillo',
'pancho' => 'perrito caliente',