Skip to content

Instantly share code, notes, and snippets.

View ojpojao's full-sized avatar
😏
só o creme papai

ojpojao ojpojao

😏
só o creme papai
View GitHub Profile
@ojpojao
ojpojao / qemu-commands.txt
Created August 27, 2024 18:00
create vm with QEMU from cmd
## 1
qemu-system-x86_64 \
-device e1000,netdev=net0,mac=50:b8:15:00:01:00 -netdev tap,id=net0,ifname=vunl1_0,script=no \
-device e1000,netdev=net1,mac=50:b8:15:00:01:01 -netdev tap,id=net1,ifname=vunl1_1 ,script=no \
-device e1000,netdev=net2,mac=50:b8:15:00:01:02 -netdev tap,id=net2,ifname=vunl1_2,script=no \
-device e1000,netdev=net3,mac=50:b8:15:00:01:03 -netdev tap,id=net3,ifname=vunl1_3,script=no \
-nographic -chardev socket,id=serial0,path=/opt/unetlab/tmp/1/1/console.sock,server,nowait \
-serial chardev:serial0 \
-chardev socket,id=monitor,path=/opt/unetlab/tmp/1/1/monitor.sock,server,nowait \
-monitor chardev:monitor \
@ojpojao
ojpojao / random-commands.txt
Created August 27, 2024 17:59
random commands
echo "'${VENDOR}'$(cat /dev/random | tr -dc '0-9A-F' | head -c 100000)" > file00.txt
@ojpojao
ojpojao / get_virgin_router_logs.py
Created August 25, 2024 06:30 — forked from rossdavidsmith/get_virgin_router_logs.py
A quick script to login to a Virgin router and download logs
import requests
import re
import hashlib
router_uri = 'https://192.168.1.1'
password = "abcd1234"
def hash(cleartext):
m = hashlib.md5()
m.update(cleartext.encode('utf-8'))
@ojpojao
ojpojao / ip.py
Created August 25, 2024 06:09 — forked from tb1402/ip.py
Speedport pro/pro plus get public ip (with lte bonding enabled)
import requests
import urllib3
import xmltodict
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
data = "<soap-env:Envelope xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" \
"xmlns:cwmp=\"urn:telekom-de.totr64-2-n\"><soap-env:Body><cwmp:GetParameterValues xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><cwmp:ParameterNames length=\"1\">" \
"<xsd:string>Device.IP.Interface.4.IPv4Address.1.IPAddress</xsd:string></cwmp:ParameterNames></cwmp:GetParameterValues></soap-env:Body></soap-env:Envelope>"
@ojpojao
ojpojao / cwmp.py
Created August 25, 2024 06:07 — forked from Itay2805/cwmp.py
A CWMP server to traverse and dump properties of a client
import dataclasses
import logging
import socket
import threading
import urllib.request
from typing import List
import inflection as inflection
from datetime import datetime
import coloredlogs
/*
Start upgrading x routers per day, double that number until max router upgrades reached.
Eg: With starting upgrade number of 200 routers, total of 5000 and max per day of 1000:
Day 1 upgrade 200 routers,
Day 2 uprade 400 routers,
Day 3 upgrade 800 routers,
Day 4 upgrade 1000 routers
Day 5 upgrade 1000 routers
Day 6 upgrade 1000 routers
@ojpojao
ojpojao / user-config.yaml
Created April 8, 2023 00:10
cloud-init para XCP-NG
#cloud-config
# vim: syntax=yaml
# allow change hostname when false
preserve_hostname: false
# change hostname
hostname: {name}%
# setup /etc/hosts
manage_etc_hosts: true
disable_root: true
apt_preserve_sources_list: true
#! /usr/bin/env bash
# chmod +x init_setup.sh
# sudo ./init_setup.sh
dnf upgrade -y
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y && \
dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y && \
dnf install vlc -y
rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg && \
@ojpojao
ojpojao / install_netbox.sh
Last active November 5, 2022 07:01
Realiza a instalação do NetBox com https
#!/usr/bin/env bash
# Tentativa de automatizar(porcamente) a instalação do Netbox kkkkkkk
# João Paulo dos Santos <[email protected]>
# Algum dia de outubro de 2022
# chmod +x install_netbox.sh
# execute com "sudo ./install_netbox.sh"
set -xe
@ojpojao
ojpojao / install_genieacs.sh
Last active June 6, 2024 11:21
Install GenieACS on Ubuntu 18.04 LTS
#! /usr/bin/env bash
## author: João Paulo <[email protected], [email protected]>
set -xe
sudo apt update && sudo apt install -y dirmngr \
gnupg \
apt-transport-https \
ca-certificates \
software-properties-common