Skip to content

Instantly share code, notes, and snippets.

Avatar

Vadim Kaushan Disasm

View GitHub Profile
@Disasm
Disasm / main.rs
Created Aug 25, 2020
rust-cleaner
View main.rs
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;
View ecp5-scan.py
#!/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"
View rcc_test.rs
#![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};
View colorlight_5a_75b.py
# 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
View 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])