Skip to content

Instantly share code, notes, and snippets.

View Trumeet's full-sized avatar
🏳️‍⚧️

Yuuta Liang Trumeet

🏳️‍⚧️
View GitHub Profile
@Trumeet
Trumeet / vyosconf
Created October 29, 2021 01:51
Yet another failed VyOS attempt.
interfaces {
ethernet eth0 {
address dhcp
address 2001:19f0:b001:fb6:5400:3ff:fea6:723/64
}
loopback lo {
}
wireguard wg0 {
address fe80::2980:12/64
address 2404:f4c0:f9c2:200::1/56
{
"description": "UEFI firmware for i386, with Secure Boot and SMM",
"interface-types": [
"uefi"
],
"mapping": {
"device": "flash",
"executable": {
"filename": "/usr/share/edk2-ovmf-csm/ia32/OVMF_CODE.secboot.fd",
"format": "raw"
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
@Trumeet
Trumeet / JPlayer.java
Created January 16, 2021 03:03
Linux Terminal has the capability of displaying 8-bit colour, so why not play something on it?
import org.jcodec.api.FrameGrab;
import org.jcodec.common.io.NIOUtils;
import org.jcodec.common.model.Picture;
import org.jcodec.scale.AWTUtil;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
@Trumeet
Trumeet / main.c
Created October 11, 2020 21:37
EvictPowerSrv Linux version rewritten in C.
/*
* Shutdown the system properly when Azure evicts your Spot instance.
*
* Compile:
* Requires libcurl 4 and json-c 5 headers.
* cc -Wall -Werror -lcurl -ljson-c main.c
*
* Running:
* Requires `shutdown` command and the rights to execute it.
* Requires libcurl.so.4, libjson-c.so.5, and glibc.
@Trumeet
Trumeet / mc.sh
Created August 5, 2020 04:36
MC Auto key tool
#!/bin/bash
export MOUSE_LEFT=1
export MOUSE_RIGHT=2
export KEY_ESCAPE=Escape
# Settings
export MC=$1
SCRIPT=$2
@Trumeet
Trumeet / ShellAbout.ps1
Created April 21, 2020 06:17
Maybe a winver.exe replacement? (DEMO)
$ShellAbout = @'
[DllImport("Shell32.dll")]
public static extern int ShellAbout(IntPtr hwnd, string szApp, string szOtherStuff, IntPtr hIcon);
'@
$Shell32 = Add-Type -MemberDefinition $ShellAbout -Name 'Shell32' -Namespace 'Shell32' -PassThru
$Shell32::ShellAbout(0, "Windows", "", 0);
@Trumeet
Trumeet / Main.java
Created February 25, 2020 22:41
Cosmic Number
import java.util.*;
/**
* Cosmic Number
* License: Unlicensed
**/
public class Main {
private static final int BILLION = 1000000000;
private static final int MILLION = 1000000;
private static final int THOUSAND = 1000;
@Trumeet
Trumeet / reinstall.sh
Last active October 28, 2019 01:38
Reinstall OS in 5 seconds XDD
#!/bin/bash
# License: WTFPL
# References vary.
# Usage: curl -fsSL https://gist.github.com/Trumeet/53159d1f45e27bec091978da57132d23/raw -o - | sh -
trap '' SIGINT
center() {
termwidth="$(tput cols)"
padding="$(printf '%0.1s' ={1..500})"
@Trumeet
Trumeet / docker.sh
Last active March 22, 2021 04:13
Docker installer script
#!/bin/sh
# For Ubuntu (not CoreOS)
# Execute: curl -fsSL https://gist.github.com/Trumeet/f37b11a4687904e8460761f7d3775575/raw -o - | sh -
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $(whoami)