Skip to content

Instantly share code, notes, and snippets.

View jamezrin's full-sized avatar
:octocat:
Committing

Jaime Martínez Rincón jamezrin

:octocat:
Committing
View GitHub Profile
@jamezrin
jamezrin / !RebootToOs.md
Created October 21, 2018 22:41 — forked from Darkhogg/!RebootToOs.md
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@jamezrin
jamezrin / test_adb.py
Created September 6, 2018 16:48
Take screenshot with python-adb and save it to a file
import os
from adb import adb_commands
from adb import sign_m2crypto
# Devices running KitKat or later require auth
signer = sign_m2crypto.M2CryptoSigner(
os.path.expanduser('~/.android/adbkey'))
# Connect to the device
device = adb_commands.AdbCommands()
<!DOCTYPE html>
<html>
<head>
<title>Pruebas</title>
</head>
<body>
<?php
// Direccion del servidor, usuario, contraseña y base de datos
$con = new mysqli("localhost", "root", "", "cosasdb");

Keybase proof

I hereby claim:

  • I am Jamezrin on github.
  • I am jaime29010 (https://keybase.io/jaime29010) on keybase.
  • I have a public key whose fingerprint is D751 DC9D 2016 3C3B 6627 2C03 A99A 07C6 AE63 3603

To claim this, I am signing this object:

@jamezrin
jamezrin / GuestPaste.java
Last active August 9, 2017 01:38
Little class to create guest pastes on Pastebin (uses lombok!)
package com.jaimemartz.playerbalancer.utils;
import lombok.Data;
import lombok.Getter;
import javax.net.ssl.HttpsURLConnection;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
@jamezrin
jamezrin / BitExample.java
Last active July 6, 2017 23:15
Java class to store boolean values on numbers
package com.jaimemartz.bitexample;
import static com.jaimemartz.bitexample.BitHelper.*;
public class BitExample {
/* Output:
Testing at bit: 1
Starting status: false
Setting to true: 100000000000001
@jamezrin
jamezrin / GithubDankifier.js
Last active April 28, 2017 14:35
Github Dankifier
// ==UserScript==
// @name Github Dankifier
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Send nudes please
// @author jaime29010
// @match https://github.com/*
// @grant none
// ==/UserScript==
public class GeolocationManager {
private final DatabaseProvider provider;
public GeolocationManager(LobbyBalancer plugin) throws Exception {
File dir = new File(plugin.getDataFolder(), "data");
if (!dir.exists()) {
dir.mkdir();
}
File reader = new File(dir, "geoip2-2.8.0");
if (!reader.exists()) {
# Force resume of partially downloaded files
-c
# Continue on download errors
-i
# Do not overwrite files
-w
# Convert video files to audio-only files
//Setting up gson
GsonBuilder builder = new GsonBuilder();
builder.setPrettyPrinting();
builder.enableComplexMapKeySerialization();
//fix for map key that is null
//gson does UUID.fromString even if the object is null, and it does not accept nulls
builder.registerTypeAdapter(UUID.class, (JsonDeserializer<UUID>) (element, type, context) -> {
if (element.isJsonNull() || element.getAsString().equals("null")) {
return null;