Skip to content

Instantly share code, notes, and snippets.

View Imeguras's full-sized avatar
🐒
Welp guess that will do

Imeguras

🐒
Welp guess that will do
View GitHub Profile
@Imeguras
Imeguras / vpn.sh
Last active November 12, 2021 13:00 — forked from miguel-negrao/vpn.sh
VPN ipleiria.pt Linux
#!/bin/sh
IFS='
'
IP=172.20.4.63
# iniciar o container. Correr apenas uma vez
docker run --name snx-vpn --cap-add=ALL -v /lib/modules:/lib/modules -e SNX_SERVER=vpn.ipleiria.pt -e SNX_USER=joao.silva -e SNX_PASSWORD=xxxxxxxx -t -d kedu/snx-checkpoint-vpn
# correr esta linha para iniciar a vpn
docker container start snx-vpn && sudo route add -net $IP netmask 255.255.255.255 gw `docker inspect --format '{{ .NetworkSettings.IPAddress }}' snx-vpn` && sudo route add -net 192.168.1.146 netmask 255.255.255.255 gw `docker inspect --format '{{ .NetworkSettings.IPAddress }}' snx-vpn`
@Imeguras
Imeguras / appvendas.sh
Last active December 3, 2021 09:26
Bd AppVendas
#!/bin/sh
IFS='
'
javac -classpath ./gui/:./gui/classfiles/ojdbc6.jar -d ./gui/classfiles ./gui/Main.java -encoding Cp1252 &&
java -cp ./gui/classfiles/ojdbc6.jar:./gui/classfiles Main;
cd ./gui/src
javac -classpath ./:./classfiles/ojdbc8-19.3.0.0.jar -d ./classfiles -Xlint:unchecked -Xlint:unchecked -encoding Cp1252 Main.java
java -cp ./classfiles/ojdbc8-19.3.0.0.jar:./classfiles Main;
@Imeguras
Imeguras / errors.txt
Created March 29, 2022 12:31
Errors relating to prometeu
./MainWindow.java:24: error: unmappable character (0xED) for encoding UTF-8
// t�tulo, com info da liga��o atual
^
./MainWindow.java:24: error: unmappable character (0xE7) for encoding UTF-8
// t�tulo, com info da liga��o atual
^
./MainWindow.java:24: error: unmappable character (0xE3) for encoding UTF-8
// t�tulo, com info da liga��o atual
^
./MainWindow.java:27: error: unmappable character (0xED) for encoding UTF-8
@Imeguras
Imeguras / discord.js
Created August 8, 2022 17:28
just a very very crude scrapper made for discord in order to circumvent not being able to @ people
/*//grab the innerHTML of the child of the elements with the class username-i5-wv-
//and console.log the value prepended by @
var usernames = [];
var username = document.getElementsByClassName('username-i5-wv-');
//for each username print the innerHTML of every child
for (var i = 0; i < username.length; i++) {
usernames.push('@' + username[i].children[0].innerHTML);// I Think its this... im horrible at JS
}
console.log(usernames.toString());
@Imeguras
Imeguras / ports.txt
Created November 16, 2022 15:17
Uma lista de portas para o fsipleiria
[TCP]
22-SSH
80-HTTP
443-HTTPS
8080-Apps Genericas
3030-PDMWORKS
1433-SQLPDM
25734-License Server SNW
1055-SERVERANSYS
1056-VendorANSYS
@Imeguras
Imeguras / shell.sh
Created June 23, 2024 16:55
Preprocess HandiTalk shell
#!/bin/zsh
# Base directory
BASE_DIR="<target>"
CATEGORIES=("Words" "Alphabet")
RESIZED_DIR="Resize"
FRAMES_DIR="Frames"
FRAME_COUNT=8
# Function to resize video and save
@Imeguras
Imeguras / ivo.py
Created June 23, 2024 16:59
Ivo's preprocessing script
from PIL import Image
import os
def resize_crop_and_flip(image_path, output_path, size=(250, 250)):
with Image.open(image_path) as img:
img_ratio = img.width / img.height
target_ratio = size[0] / size[1]
if img_ratio > target_ratio:
# Crop the width (crop horizontally)
@Imeguras
Imeguras / cocofix.py
Created June 23, 2024 20:18
Fixes COCO annoying folder disposition
import os
import json
import shutil
from collections import defaultdict
from tqdm import tqdm
def create_class_folders(output_dir, class_names):
for class_name in class_names:
class_dir = os.path.join(output_dir, class_name)
os.makedirs(class_dir, exist_ok=True)