Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Andy Bao null-dev

💭
I may be slow to respond.
View GitHub Profile
@null-dev
null-dev / disable-fb.sh
Created Jan 7, 2021
Disable efifb at runtime
View disable-fb.sh
#!/usr/bin/env bash
# 1. Download and install the QEMU hook helper from here: https://github.com/PassthroughPOST/VFIO-Tools
# 2. Place this file in /etc/libvirt/hooks/qemu.d/NAME OF YOUR VM/prepare/begin/disable-fb.sh
# 3. Make disable-fb.sh executable.
VM_NAME="$1"
echo "libvirt-qemu disable-fb: Disabling efi-framebuffer to prepare to pass GPU to VM $VM_NAME" > /dev/kmsg 2>&1
echo "efi-framebuffer.0" > /sys/bus/platform/devices/efi-framebuffer.0/driver/unbind
@null-dev
null-dev / vndb_variety_quotes.py
Created Jun 21, 2020
VNDB quotes plugin for the Variety wallpaper changer
View vndb_variety_quotes.py
#!/usr/bin/python
from variety.plugins.IQuoteSource import IQuoteSource
from variety.Util import Util
from locale import gettext as _
class VNDBSource(IQuoteSource):
@classmethod
def get_info(cls):
return {
@null-dev
null-dev / keybase.md
Created Apr 28, 2019
Keybase identity proof
View keybase.md

Keybase proof

I hereby claim:

  • I am null-dev on github.
  • I am nulld3v (https://keybase.io/nulld3v) on keybase.
  • I have a public key ASCmcZbgg7vDpUsl7Yu_WcCgk8yvn6jFM0uWlGOlkq1lbwo

To claim this, I am signing this object:

View gist:b7f05446f7d16216f625fdc9708311d4
[
{
"clusterTitle": "international/internal/internationally",
"docs": [
{
"docTitle": "United Nations \u0026 It\u0027s International Organizations--Midterm ...",
"docBlurb": "There are six main organs of the United Nations—the General Assembly, the Security Council, the Trusteeship Council, the Economic and Social Council, the International Court of Justice, and the Secretariat.",
"docURL": "https://quizlet.com/157367004/united-nations-its-international..."
},
{
@null-dev
null-dev / open-iterm.scpt
Last active Jul 7, 2018
Applescript to open a new iTerm2 window
View open-iterm.scpt
if application "iTerm" is running then
tell application "System Events"
tell UI element "iTerm" of list 1 of application process "Dock"
perform action "AXShowMenu"
click menu item "New Window (Default Profile)" of menu 1
end tell
end tell
else
tell application id (id of application "iTerm")
reopen
@null-dev
null-dev / TachiTest.kt
Last active Apr 17, 2018
Automated Tachiyomi source tester
View TachiTest.kt
import android.content.Context
import android.graphics.Color
import android.preference.PreferenceManager
import android.support.design.widget.TabLayout
import android.support.test.InstrumentationRegistry
import android.support.test.espresso.Espresso
import android.support.test.espresso.Espresso.onIdle
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.UiController
import android.support.test.espresso.ViewAction
@null-dev
null-dev / JsonReaderObjectReader.kt
Created Apr 14, 2018
Read entire `JsonObject`s and `JsonArray`s from `JsonReader`s
View JsonReaderObjectReader.kt
/**
* Reads entire `JsonObject`s and `JsonArray`s from `JsonReader`s
*
* @author nulldev
*/
import com.google.gson.JsonArray
import com.google.gson.JsonNull
import com.google.gson.JsonObject
import com.google.gson.stream.JsonReader
@null-dev
null-dev / test.sh
Last active Mar 22, 2018
Script to write, compile and run simple multidimensional array test cases
View test.sh
#!/bin/bash
# Disable WINE debug logging
export WINEDEBUG=-all
cat <<EOM >HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
int[][] yesArraysWork = new int[10][10];
Integer[] sameAsObjArrays = new Integer[10];
@null-dev
null-dev / kbagi.com_batch_dl_link.js
Created Feb 10, 2018
kbagi.com Batch Download Link Lister
View kbagi.com_batch_dl_link.js
@null-dev
null-dev / index.php
Created Jun 19, 2017
1fichier.com direct link generator (PHP)
View index.php
<?php
if(!isset($_GET['a'])) {
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>');
}
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline";
stream_context_set_default(array(
'http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]'