Skip to content

Instantly share code, notes, and snippets.

@joguSD
joguSD / rip.py
Created September 21, 2024 08:18
#!/usr/bin/env python
import pyudev
import subprocess
import sys
def is_cd_event(device):
if device.properties.get('ID_TYPE') != 'cd':
return False
if device.properties.get('ID_MODEL') != 'DVDRAM_GP65NB60':
return False
@joguSD
joguSD / uEnv.txt
Created April 6, 2022 05:44
VisionFive Haiku OS
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
scriptaddr=0x88100000
script_offset_f=0x1fff000
script_size_f=0x1000
kernel_addr_r=0x84000000
kernel_comp_addr_r=0x90000000
kernel_comp_size=0x10000000
struct ProgressBar {
max: usize,
current: usize,
last: Instant,
wait: Duration,
}
impl ProgressBar {
fn default(max: usize) -> ProgressBar {
ProgressBar {
import os
import shutil
import botocore.session
s = botocore.session.Session()
loader = s.get_component('data_loader')
services = s.get_available_services()
to_delete = {}
# Server list generated by rankmirrors on 2017-04-02
##
## Arch Linux repository mirrorlist
## Filtered by mirror score from mirror status page
## Generated on 2017-04-01
##
## Macedonia
## Canada
## South Korea
## Lithuania
@joguSD
joguSD / labs.py
Last active March 28, 2017 02:01
#lab times: 9, 11, 1, 3, 5, 7
def getLines(path):
with open(path) as f:
return f.readlines()
def parseDuration(timestamp):
hoursString, minsString = timestamp[9:14].split(":")
hours = int(hoursString)
length = int(minsString)
/******************************************************
* Tester file to test basic functionality of your code
* ****************************************************/
#include "baseboggleplayer.h"
#include "boggleplayer.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>