Skip to content

Instantly share code, notes, and snippets.

@Disasm
Disasm / main.rs
Created August 25, 2020 16:49
rust-cleaner
use std::process::Command;
use std::path::Path;
fn main() {
println!("Scanning file system...");
let output = Command::new("locate").arg("Cargo.toml").output().expect("Failed to create process").stdout;
for line in output.split(|b| *b == 0x0a) {
if let Ok(s) = std::str::from_utf8(line) {
if s.is_empty() {
continue;
#![no_main]
#![no_std]
extern crate panic_semihosting;
extern crate stm32f7xx_hal;
use cortex_m_rt::entry;
use stm32f7xx_hal::prelude::*;
use stm32f7xx_hal::pac;
use stm32f7xx_hal::rcc::{Rcc, HSEClock, HSEClockMode};
#!/usr/bin/env python3
import sys
from migen import *
from migen.build.generic_platform import Pins, IOStandard
from migen.build.lattice import LatticePlatform
class Platform(LatticePlatform):
default_clk_name = "clk25"
# This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# License: BSD
# The Colorlight 5A-75B PCB and IOs have been documented by @miek and @smunaut:
# https://github.com/q3k/chubby75/tree/master/5a-75b
from litex.build.generic_platform import *
from litex.build.lattice import LatticePlatform
from litex.build.lattice.programmer import OpenOCDJTAGProgrammer
@Disasm
Disasm / gpg_scan.py
Created July 1, 2019 21:54
gpg_scan.py
#!/usr/bin/env python3
import os
import subprocess
import re
def main():
pubring = os.path.join(os.getenv("HOME", "~"), ".gnupg", "pubring.gpg")
output = subprocess.check_output(["gpg", "--list-packets", pubring])