Skip to content

Instantly share code, notes, and snippets.

View joaociocca's full-sized avatar
❤️‍🔥
Working from home

João Ciocca joaociocca

❤️‍🔥
Working from home
View GitHub Profile
@joaociocca
joaociocca / steamos_unlock.sh
Last active March 14, 2024 18:38
Johnny SteamOS Steamdeck - enable package install via pacman/paru and install my basics
sudo steamos-readonly disable
sudo sed -i 's/Required DatabaseOptional/Optional TrustAll/' /etc/pacman.conf
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo
sudo pacman -S holo-keyring archlinux-keyring
pacman -S fakeroot vivaldi vivaldi-ffmpeg-codecs telegram-desktop neofetch code code-marketplace
@joaociocca
joaociocca / prep-pit.sh
Created January 27, 2024 22:00
process print-pit file from Heimdall to flash Samsung Galaxy devices
#!/usr/bin/env bash
heimdall print-pit > print-pit.txt
grep -Poz "(?<=Partition Name: ).*\nFlash Filename:.*" print-pit.txt | sed ':a;N;$!ba;s#\n##g;s#Flash Filename:##g;s#\x00#\n#g' > prep-pit.1
while read line; do file=$(echo "$line" | cut -d' ' -f2); if [[ -f $file ]]; then echo "$line" >> prep-pit.2; fi; done < prep-pit.1
sudo heimdall flash "$(cat -p prep-pit.2 | sort -u | tr '\n' ' ')"
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGYgbDwCjVMAYQ6Hm5ckidJGbbG5n5hwnMZrSO357rOBBB4X2z8KVWqfXfdJLTXoHGMWZp/K0wcwpP9KvfHwsV1eo8CoZT0foNQRCuGsHm51wT6D8Q4Xs8av8AiLYRbzzUQIGhyjVIl6xdAWaj5JGTIRdbVaaLmJJvfDywAeDdcsv0mjjYlM23KNbelt/i9pz3gFnly60f9jKAB1/xC8VKpJ5SAc8Ptzk6daeM22sqMRY6FSop1wu6i0OFO23194l2hdU/X5YdYpaR13F0uxseQQ2L8MxHZTHNh/OGwoRnEbVEOrqwlCqoDVGcx6nrOUxPFJOEmUduBM1DzO45VrHCciYGnBqIClktR+Hx5hRSHBl83S6U1Oq9hi5BF1pVstrf/LRzeusVgDQM9nBH14k5vsLecNGOzFrlW/+vDFODYQrcoP1F0Q5JQR0dslDqlgpL8KVlL/WLTooooKQYff3u1Da3R+9yj0ExWdJgkuNXnIjP7tDR+pToxNooQA1yRW0= johnnyc
@joaociocca
joaociocca / extrato_C6_PDF-CSV.r
Last active September 5, 2023 04:40
código em R para transformar o PDF horrível do C6 em um CSV com data, descrição e valor.
# Verifique se foram fornecidos argumentos pela linha de comando
if (length(commandArgs(trailingOnly = TRUE)) < 1) {
cat("Uso: Rscript extrato_C6_PDF-CSV.r <arquivo_PDF>\n")
quit(status = 1)
}
# Obtenha o nome do arquivo PDF e a senha dos argumentos
arquivo_pdf <- commandArgs(trailingOnly = TRUE)[1]
# password <- commandArgs(trailingOnly = TRUE)[2]
@joaociocca
joaociocca / 25UM65_ddcprobe.txt
Created April 11, 2023 15:11
LG 25UM65 DDC probe
sudo ddcutil -b 12 probe
EDID version: 1.3
Mfg id: GSM, model: LG ULTRAWIDE, sn:
Product code: 23025, binary serial number 16843009 (0x01010101)
How display reports unsupported feature: DREF_DDC_USES_MH_ML_SH_SL_ZERO_FOR_UNSUPPORTED
Capabilities for display on bus /dev/i2c-12
Unparsed capabilities string: (prot(monitor)type(LED)model(25UM65)cmds(01 02 03 0C E3 F3)vcp(0203(10 00)0405080B0C101214(05 07 08 0B) 16181A5260(03 04)6C6E7087ACAEB6C0C6C8C9D6(01 04)DFE4E5E6E7E8E9EAEBED(00 10 20 40)EE(00 01)FE(01 02 03)FF)mswhql(1)mccs_ver(2.1))
@joaociocca
joaociocca / readline_evilwinrm.sh
Last active March 14, 2023 14:21
Little snippet to grab ruby's readline for evil-winrm
readline_evilwinrm() {
if [[ $(command -v evil-winrm) ]]; then
if [[ ! $(dpkg-query -l libreadline-dev) ]]; then
sudo apt install libreadline-dev -y
fi
ruby_version=$(ruby --version | awk -F'[ p]' '{print $2}')
ruby_mid=${ruby_version/%.[0-9]/}
wget https://ftp.ruby-lang.org/pub/ruby/${ruby_mid}/ruby-${ruby_version}.tar.gz &>/dev/null
tar -xf "ruby-${ruby_version}.tar.gz"
curdir="$PWD"
@joaociocca
joaociocca / pwk_ips.sh
Created June 2, 2022 19:44
Quick snippet to list IPs used during PWK!
pwk_ips() {
cyan=$(tput setaf 6)
magenta=$(tput setaf 5)
bold=$(tput bold)
normal=$(tput sgr0)
localIP=$(ip -br a s dev tun0 | sed -r 's#( )+|/# #g' | awk '{print $3}')
winClientIP=$(awk -F'.' '{print $1"."$2"."$4".10"}' <<< "$localIP")
winServerIP=$(awk -F'.' '{print "172.16."$4".5"}' <<< "$localIP")
linuxClientIP=$(awk -F'.' '{print $1"."$2"."$4".44"}' <<< "$localIP")
linuxTargetIP=$(awk -F'.' '{print $1"."$2"."$4".52"}' <<< "$localIP")
@joaociocca
joaociocca / whodisc.sh
Created January 4, 2022 12:45
whodis for getting less info on whois, whodisc for comparing two IP ownership
#!/bin/bash
whois_fields='inetnum|netrange|netname|mnt-by|nic-hdl|CIDR|orgname|orgid|role'
whodis() { whois $1 | grep -Ei $whois_fields; }
whodisc() {
whois $1 | grep -E $whois_fields
echo "======================"
whois $2 | grep -E $whois_fields
}
@joaociocca
joaociocca / rras.logstash.conf
Last active March 18, 2020 02:25
Logstash dictionary for RRAS VPN logs
input {
elasticsearch {
hosts => ["<server>"]
index => "rras_vpn*"
query => '
{
"query":
{ "range" : {
"@timestamp" : {
"gte" : "2018-11-01", "lte" : "now"
@joaociocca
joaociocca / ias_history.conf
Created September 27, 2019 02:28
Logstash configuration for ingesting old IAS logs
# Using information from:
# - https://iso.csusb.edu/tools/nps-log-interpreter
# - https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd197432(v=ws.10)?redirectedfrom=MSDN
# - http://www.gnu.org/software/radius/manual/html_node/radius_181.html#SEC300
# - https://discuss.elastic.co/t/can-dissect-use-a-variable-number-of-fields/200952/11
input {
stdin { }
}