Skip to content

Instantly share code, notes, and snippets.

@noahbliss
noahbliss / pindriver-unexpected-high.rs
Last active November 23, 2023 19:29
pindriver-unexpected-high.rs
use hal::delay::Delay;
use hal::gpio::*;
use hal::peripherals::Peripherals;
fn main() -> anyhow::Result<()> {
hal::sys::link_patches();
let delay = Delay::new_default();
let peripherals = Peripherals::take()?;
@noahbliss
noahbliss / somegarbage.rs
Created November 22, 2023 19:07
cleaned up a bit
use async_executor::Executor;
//use async_executor::LocalExecutor;
//use edge_executor::Executor;
use futures_lite::future;
use hal::{gpio::*, peripherals::Peripherals, prelude::*, task::*, timer::*};
use std::thread;
use std::time;
fn main() -> anyhow::Result<()> {
hal::sys::link_patches();
@noahbliss
noahbliss / esp-hal-nostd.rs
Created November 22, 2023 18:24
esp-hal-nostd.rs
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]
use embassy_executor::Spawner;
use embassy_time::{Duration, Timer};
use embedded_hal_async::digital::Wait;
use esp_backtrace as _;
use hal::{
clock::ClockControl,
@noahbliss
noahbliss / .bashrc
Created June 22, 2022 13:51
Minimalistish .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@noahbliss
noahbliss / dattormm.yml
Created February 11, 2022 17:38
Datto RMM API Token Fetch
POST /auth/oauth/token HTTP/2
Host: zinfandel-api.centrastage.net
Content-Type: application/x-www-form-urlencoded
Authorization: Basic cHVibGljLWNsaWVudDpwdWJsaWM=
Content-Length: ###
grant_type=password&username=APIIDKEY&password=APISECRETKEY
@noahbliss
noahbliss / hxagent_linux_install.sh
Last active September 29, 2021 18:39
HX Agent Linux Distribution Conditional Installer
#!/usr/bin/env bash
# Noah Bliss - 2021.09.29
if [ -f /etc/os-release ]; then source /etc/os-release; else echo "os-release missing or not Linux" && exit 1; fi
tgzfile="IMAGE_HX_AGENT_LINUX_32.30.16.tgz"
debfile="xagt_32.30.16-1.ubuntu16_amd64.deb"
rpmfile="xagt-32.30.16-1.el7.x86_64.rpm"
mkdir hxagent
@noahbliss
noahbliss / trendmicro-julia-apiclient.jl
Last active January 6, 2021 16:50
Reference TrendMicro API client written in Julia
#!/usr/bin/env julia
# Noah Bliss - 2020-1-6
using HTTP
using JSON
using JSONWebTokens
using Dates
using SHA
using Base64
# These will stay the same for your tenant. See below for more vars you need to fill.
@noahbliss
noahbliss / kali-zshrc
Last active April 1, 2024 00:59
Kali's default zshrc
# ~/.zshrc file for zsh interactive shells.
# see /usr/share/doc/zsh/examples/zshrc for examples
setopt autocd # change directory just by typing its name
#setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
setopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
setopt numericglobsort # sort filenames numerically when it makes sense
@noahbliss
noahbliss / tmuxbashrc
Last active October 26, 2020 22:44
tmux bashrc helpers
# Auto attach existing tmux session, if none exist, start one.
#if command -v tmux >/dev/null && ! [ $TERM == "screen" ]; then tmux a || tmux; fi
# Tell us if tmux is running or not, does _not_ auto attach.
if if command -v tmux >/dev/null && tmux ls &>/dev/null && ! [ "$TERM" == "screen" ]; then echo -e "------\n A TMUX session exists! Attach with \`tmux a\`\n------\n"; fi
@noahbliss
noahbliss / regex-extract
Created September 18, 2020 20:08
Sed wizardry to extract regex from standard in or a file as arg 2.
sed -nE "s#.*($1).*#\1#p" "$2"