Skip to content

Instantly share code, notes, and snippets.

@Lucho00Cuba
Lucho00Cuba / ss.sh
Created January 4, 2024 14:22
bad ss alternative (linux)
#!/usr/bin/env bash
PERL_FILE='ss.perl'
cat << EOF > ./$PERL_FILE
#!/usr/bin/perl
my \$hexip=\$ARGV[0];
my \$hexport=\$ARGV[1];
#print "HEX_IP: \$hexip HEX_PORT: \$hexport\n";
@Lucho00Cuba
Lucho00Cuba / dump_ssl.py
Created June 28, 2023 16:28
Dump Data SSL
#!/usr/bin/env python3
import ssl
import OpenSSL
from OpenSSL import crypto
hostname = 'HOSTNAME'
port = PORT
print(f"Hostname: {hostname}")
#!/bin/bash
SOCKS_PID_FILE="/tmp/socat.pid"
start_socat() {
socat TCP4-LISTEN:1080,fork SOCKS4A:localhost:www.example.com:80,socksport=1080 &
echo $! > "$SOCKS_PID_FILE"
echo "socat started with PID $!"
}
@Lucho00Cuba
Lucho00Cuba / prom.py
Created May 21, 2023 21:08
Prometheus API PY
#!/usr/bin/env python3
import sys
import configparser
import argparse
import json
import requests
monitoring = {}
configs = {}
@Lucho00Cuba
Lucho00Cuba / prom.sh
Created May 21, 2023 19:57
Prometheus API cURL
#!/usr/bin/env bash
PROTOCOL="http"
PROMETHEUS="192.168.1.203:9090"
OPTIONS="-sL"
query_http(){
name=$1; request=$2; args=$3
echo $name
echo "Requests: curl $OPTIONS -G $request $args 2>/dev/null"
@Lucho00Cuba
Lucho00Cuba / .vimrc
Created April 1, 2023 15:17
ConfigFile Vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗
" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝
" ██║ ██║██║██╔████╔██║██████╔╝██║
" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║
" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╗
" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@Lucho00Cuba
Lucho00Cuba / get_xampp.sh
Created March 28, 2023 19:02
GetXamppLinux
#!/usr/bin/env bash
PLATFORM="linux"
ARCH="x64"
VERSION="8.0.25"
INSTALLER="xampp-${PLATFORM}-${ARCH}-${VERSION}-0-installer.run"
cmd(){
if [[ "$($1 &>/dev/null; echo $?)" == "0" ]]; then
logger "info" "$2"
@Lucho00Cuba
Lucho00Cuba / openssl_self_signed.md
Created March 25, 2023 17:55
Creating Self Signed Certificate

Create self-signed certificates with OpenSSL

Root CA

Create Root CA key (enable password with '-des3' or '-aes' option)

$ openssl genrsa -des3 -out root.key 4096
$ openssl genrsa -aes256 -out root.key 4096
@Lucho00Cuba
Lucho00Cuba / ftp.sh
Created March 25, 2023 17:53
iFP FTP Server
#!/usr/bin/env bash
# Author: Lucho00Cuba (JustMe)
# VARS
FTP_USER="ftpuser"
CFG="/etc/vsftpd.conf"
SSL_ENABLED="true"
SSL_CRT=""
SSL_KEY=""
@Lucho00Cuba
Lucho00Cuba / cloudflare-ddns.py
Created January 1, 2023 18:34
CloudFlare DDNS
#!/usr/bin/env python
"""Cloudflare API code - example"""
import os
import sys
import requests
from time import sleep
sys.path.insert(0, os.path.abspath('..'))
import CloudFlare