Skip to content

Instantly share code, notes, and snippets.

View wellbercabral's full-sized avatar

Wellber Cabral wellbercabral

View GitHub Profile
@djfdyuruiry
djfdyuruiry / README.md
Last active October 8, 2024 04:54
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@guerzon
guerzon / openssl_commands.sh
Last active February 18, 2024 23:48
Useful OpenSSL comands for testing, troubleshooting, and information gathering
# Test an SSL connection
openssl s_client -connect <IP>:<PORT>
# Test if SSLv3 is supported
# Expected result if TLSv1.0 is not supported: ssl handshake failure
openssl s_client -connect <IP>:<PORT> -ssl3
# Test if TLSv1.0 is supported
# Expected result if TLSv1.0 is not supported: ssl handshake failure
@jkatz
jkatz / setup.sh
Last active September 9, 2023 03:00
Install PostgreSQL 10 & pgAdmin 4 with Docker
#!/bin/bash
mkdir postgres
cd postgres
docker volume create --driver local --name=pgvolume
docker volume create --driver local --name=pga4volume
docker network create --driver bridge pgnetwork
@gregjhogan
gregjhogan / wireshark-tls-sni-http-filter
Last active October 20, 2022 00:32
wireshark tls sni and http filter
ssl.handshake.extension.type == "server_name" || http.host
@Eng-Fouad
Eng-Fouad / ssl-certs.md
Last active June 23, 2024 05:50
Generate self-signed PKCS#12 SSL certificate and export its keys using Java keytool and openssl.

Steps to generate self-signed PKCS#12 SSL certificate and export its keys:

1- Create PKCS#12 keystore (.p12 or .pfx file)

keytool -genkeypair -keystore myKeystore.p12 -storetype PKCS12 -storepass MY_PASSWORD -alias KEYSTORE_ENTRY -keyalg RSA -keysize 2048 -validity 99999 -dname "CN=My SSL Certificate, OU=My Team, O=My Company, L=My City, ST=My State, C=SA" -ext san=dns:mydomain.com,dns:localhost,ip:127.0.0.1
  • myKeystore.p12 = keystore filename. It can with .pfx extension as well.
  • MY_PASSWORD = password used for the keystore and the private key as well.
  • CN = commonName, it will be shown as certiciate name in certificates list.
  • OU = organizationUnit, department name for example.
@tiagofaustino
tiagofaustino / atualizaProducao.sh
Last active December 11, 2020 12:32
Shell Script usado para fazer deploy de arquivos WAR no Tomcat (usando versão 6 no exemplo). E que foram colocados em uma determinada pasta. Ideal para ser executado num robô toda a noite por exemplo.
#!/bin/bash
PASTA_ORIGEM=/usr/share/deploy_producao/deploy_novo
TOMCAT_HOME=/usr/local/tomcat
TEMPO_SLEEP=20
PASTA_EXECUTADOS=/usr/share/deploy_producao/deploy_executado
LOG_FILE=/usr/share/deploy_producao/deploy_producao.log
#Verifica se foi passado algum nome de war por parametro.
#Quando isso acontecer, só será feito deploy deste war.
@namklabs
namklabs / lorem-ipsum.sh
Last active October 31, 2018 19:22
bash lorem ipsum osx terminal
function lorem(){
# Copy lorem ipsum to your clipboard in OS X
# usage:
# $ lorem <int> <htmlflag>
# where <int> is how many paragraphs of lorem ipsum you want, each separated by 2 newlines
# and <htmlflag> is anything, indicating you want each paragraph surrounded by <p></p>. Omit if you don't want this.
@pixeline
pixeline / mirror_remote_directory_to_local_directory
Last active May 21, 2024 19:36
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure