Skip to content

Instantly share code, notes, and snippets.

View jonathands's full-sized avatar
🏠
Working from home

Jonathan DS jonathands

🏠
Working from home
  • Brazil
View GitHub Profile
@jonathands
jonathands / bashrc
Last active June 2, 2025 16:54
merge a feature branch and get back
# On ~/.bashrc or equivalent
# usage
# gmergehml tries to merge current branch and gets back
# gmergehml name/ofbranch specify a branch
gmergehml() {
local feature_branch="${1:-$(git rev-parse --abbrev-ref HEAD)}"
read -p "Merge branch '$feature_branch' into 'homolog'? [y/N] " answer
case "$answer" in
[Yy]* )
@jonathands
jonathands / warp-toggler-install
Created May 30, 2025 13:17
Script to install an Easy to access button to toggle CloudFlare Warp VPN
#!/bin/bash
# Create toggle script in /usr/bin
echo "Creating /usr/bin/warp-toggle..."
sudo tee /usr/bin/warp-toggle > /dev/null << 'EOF'
#!/bin/bash
STATUS=$(warp-cli -j status | grep -o '"status":[ ]*"[^"]*"' | cut -d'"' -f4)
if [ "$STATUS" = "Connected" ]; then
warp-cli -j disconnect
@jonathands
jonathands / checklist-pt_br.md
Last active May 9, 2025 16:54
Understanding and Mitigating the Androxgh0st and similar malware threat

🔐 Entendendo e Mitigando a Ameaça do Malware Androxgh0st

Como o Androxgh0st Funciona

O Androxgh0st atinge principalmente aplicações Laravel, um dos principais frameworks PHP usados em muitos sites. Ao escanear arquivos .env, o malware consegue identificar e extrair informações sensíveis, especialmente credenciais de acesso a plataformas como a Amazon Web Services (AWS).

O funcionamento do Androxgh0st ocorre em várias fases:

Etapa 1: Varredura com Botnet

O Androxgh0st utiliza uma botnet para procurar por sites que utilizam Laravel. Isso gera uma lista de possíveis alvos.

@jonathands
jonathands / gist:d48d22aaebc54dac5415a7c6cfca0e6c
Last active May 4, 2025 00:44
install cloudflare warp on mint
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ jammy main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
## force Jammy
sudo apt-get update && sudo apt-get install cloudflare-warp
warp-cli registration new
warp-cli connect

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@jonathands
jonathands / gist:03a449740ce72acbc68b8d1e6f6aa7ef
Last active September 27, 2024 01:22
extrair dados registro.br
// === Global Variables ===
var siteResults = {};
var isPaused = false;
var pausePromiseResolve;
// === Function to Export siteResults as CSV ===
function exportSiteResultsAsCSV(siteResults) {
// Create the CSV headers
var csvContent = 'Site,Domain Info,DNS Info,Error\n';
@jonathands
jonathands / README.md
Created September 20, 2024 12:59 — forked from dpaluy/README.md
Download view only protected PDF from Google Drive

Step by step guide to downloading protected PDF from Google Drive

  1. Open the document in Google Docs
  2. Scroll to the bottom of the document, so all the pages are present
  3. Open Developer Tools on separate window and choose the Console tab
  4. Paste the code
  5. Have fun!
@jonathands
jonathands / gist:c0554be97d6e103f65f2c8cdf1bd8c25
Created December 11, 2023 20:01
composer install with www-data user
sudo su -l www-data -s /bin/bash -c "cd $PWD; composer install"
@jonathands
jonathands / gmail-stats.gs
Created June 24, 2023 12:23 — forked from leodevbro/gmail-stats.gs
In Gmail inbox, Find sender with most mail threads
// Original script: https://gist.github.com/leodevbro/2987e8874a18b2086ea6cc1aa3c494e8
// v2.5
// Google Apps Script is a coding language based on JavaScript.
// This Apps Script code helps us to sort addresses by most threads.
// A thread is a group of messages, as a conversation.
const modes = {
inbox: "inbox", // to analyze threads in the "Inbox" folder
outbox: "outbox", // to analyze threads in the "Sent" folder