Skip to content

Instantly share code, notes, and snippets.

View lucasduete's full-sized avatar
🎯
Focusing

Lucas Duete lucasduete

🎯
Focusing
View GitHub Profile
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@jhass
jhass / dump_socket.sh
Last active June 11, 2024 13:15
Capture unix socket to pcap file with socat and tshark
#!/bin/bash
# Parameters
socket="/run/foo.sock"
dump="/tmp/capture.pcap"
# Extract repetition
port=9876
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig"
@mssola
mssola / singleton.rb
Created August 2, 2013 07:44
Different ways to create the Singleton pattern in Ruby.
##
# This files shows some possible implementations of the Singleton pattern
# in Ruby. I'm not a huge fan of the Singleton pattern, but it's nice
# in some cases. In this file I'm going to implement a simple logger.
#
##
# The first implementation that can come to our minds is to create a class
# that holds an instance as a class variable that can be accessed through
@rdeavila
rdeavila / jboss-redirect.sh
Last active December 2, 2017 23:22
Redireciona porta 8080 do JBoss para a porta 80, de forma permanente.
#!/bin/bash
# Fontes:
# http://glassonionblog.wordpress.com/2011/04/08/tomcat-redirecting-traffic-from-port-8080-to-80-using-iptables/
# http://stackoverflow.com/a/12454607
# Faz o redirecionamento
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
# Para remover o redirecionamento:
@facilita-tecnologia
facilita-tecnologia / Secure Admin must be enabled to access the DAS remotely.
Created February 24, 2014 05:58
Configuration Error Secure Admin must be enabled to access the DAS remotely.
Configuration Error Secure Admin must be enabled to access the DAS remotely.
Para corrigir a mensagem acima ao logar no console do Glassfish 4.0, execute os seguintes passo.
./asadmin change-admin-password
O assistente vai pedir um nome de usuário coloque Admin pressione enter
vai pedir uma senha atual deixe vazio pressione enter
em seguida vai pedir a nova senha.
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@douglasjunior
douglasjunior / TUTORIAL_LETSENCRYPT_GLASSFISH4.md
Last active February 24, 2022 17:15
Tutorial de instalação do Lets Encrypt no Glassfish 4.x

Tutorial de instalação do Lets Encrypt no Glassfish 4.x

Gerando certificado Lets Encrypt

Para gerar o certificado Lets Encrypt é muito simples, aqui as instruções estão baseadas em um tutorial publicado pela Locaweb. (Web archive)

Primeiro vamos criar um diretório para isso: