Skip to content

Instantly share code, notes, and snippets.

View SamP20's full-sized avatar

Sam SamP20

  • Bristol
View GitHub Profile
@SamP20
SamP20 / brute_force_solver.py
Created January 6, 2016 09:11
Self descripting number solver
if __name__ == '__main__':
try:
for i in range(10000000000):
tmp = i
counts = [0,0,0,0,0,0,0,0,0,0]
numbers = []
for x in range(10):
n = tmp % 10
numbers.append(n)
counts[n] += 1
@SamP20
SamP20 / agent_test.py
Created November 3, 2018 09:02
Windows 10 ssh-agent test
from asyncssh.packet import *
from base64 import b64encode
SSH_AGENTC_REQUEST_IDENTITIES = 11
SSH_AGENT_IDENTITIES_ANSWER = 12
def main():
f = open(r"\\.\pipe\openssh-ssh-agent", 'r+b', 0)
payload = Byte(SSH_AGENTC_REQUEST_IDENTITIES)
f.write(UInt32(len(payload)) + payload)
@SamP20
SamP20 / interrupt.rs
Last active May 4, 2019 18:17
Example interrupt API
[entry]
fn main() -> ! {
let p = cortex_m::Peripherals::take().unwrap();
let interrupts = Interrupts::new(p.NVIC);
let a: u32 = 5;
let b: u32 = 6;
let c: u32 = 7;
@SamP20
SamP20 / main.rs
Created March 29, 2020 16:56
Turn on an LED
#![no_main]
#![no_std]
extern crate cortex_m_rt as rt;
extern crate panic_halt;
use rt::entry;
use stm32f4::stm32f429;