Skip to content

Instantly share code, notes, and snippets.

View mageddo's full-sized avatar
💭
🚲 🍺

Elvis Souza mageddo

💭
🚲 🍺
View GitHub Profile
@mageddo
mageddo / sub.ass
Created October 30, 2022 01:40
Ass Example | SubStation_Alpha
[Script Info]
; Print = https://i.imgur.com/zAATUaF.jpg
; https://en.wikipedia.org/wiki/SubStation_Alpha
; This is a Sub Station Alpha v4 script.
; For Sub Station Alpha info and downloads,
; go to http://www.eswat.demon.co.uk/
Title: Neon Genesis Evangelion - Episode 26 (neutral Spanish)
Original Script: RoRo
Script Updated By: version 2.8.01
ScriptType: v4.00
@mageddo
mageddo / KeepMovingMouse.java
Last active March 24, 2025 15:19
ScreenSaver Prevent
import java.awt.*;
import java.time.Duration;
/**
* Move the mouse by one pixel every 3 minutes to prevent screen saver to start,
* useful when you dont have the right permissions to change that
* https://stackoverflow.com/questions/4231458/moving-the-cursor-in-java
* https://stackoverflow.com/questions/1439022/get-mouse-position
*/
public class KeepMovingMouse {
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.Duration;
import javax.sql.DataSource;
import com.mageddo.db.StmUtils;
Stream.of(
new AbstractMap.SimpleEntry<>("Apple", 1),
new AbstractMap.SimpleEntry<>("Orange", 1),
new AbstractMap.SimpleEntry<>("Orange", 1),
new AbstractMap.SimpleEntry<>("Grape", 1),
new AbstractMap.SimpleEntry<>("Grape", 1),
new AbstractMap.SimpleEntry<>("Grape", 1)
)
@mageddo
mageddo / build.gradle
Last active March 20, 2021 19:05
Gradle Release Config Example
plugins {
id 'net.researchgate.release' version '2.8.1'
}
release {
project.ext.set("release.useAutomaticVersion", true)
git {
requireBranch = ''
}
failOnCommitNeeded = false
version: '3'
services:
agent:
image: portainer/agent:1.3.0
environment:
AGENT_CLUSTER_ADDR: tasks.agent
# AGENT_PORT: 9001
# LOG_LEVEL: debug
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@mageddo
mageddo / TestUtils.java
Created June 25, 2020 22:19
Utilities for testing
package testing;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
/**
* Some utilities while testing
@mageddo
mageddo / TestUtils.java
Created June 25, 2020 22:19
Utilities for testing
package testing;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
/**
* Some utilities while testing
@mageddo
mageddo / main.cpp
Created June 20, 2020 20:46
Load jar and execute class method from JVMTI + JNI
#include <jvmti.h>
#include <cstring>
#include <iostream>
void debug(char* msg...){
// printf(msg);
}
int loadJar(JNIEnv *jni){
@mageddo
mageddo / main.cpp
Last active November 8, 2022 17:44
JNI call static method with arguments and return object
JNIEnv *jni;
// class and method finding
jclass clazz = jni->FindClass("java/lang/String");
jmethodID method = jni->GetStaticMethodID(clazz, "valueOf", "(Ljava/lang/Object;)Ljava/lang/String;");
if(method == NULL){
jni->FatalError("Class method not found\n");
}
// method execution