Skip to content

Instantly share code, notes, and snippets.

ian klatzco ianklatzco

Block or report user

Report or block ianklatzco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ghidra-disassembly.c
undefined8 check_secret_id(char *user_input)
{
int iVar1;
int iVar2;
int user_input_(int);
long lVar3;
size_t sVar4;
size_t sVar5;
@ianklatzco
ianklatzco / readme.md
Last active Jan 2, 2019
Python testcode for ECE411
View readme.md

These scripts automatically compile RISC-V code, simulate it with the command line version of ModelSim, and report the time it took to run the code in nanoseconds.

It is particularly useful for the final part of the course, where you will be tweaking your CPU for performance, but you might get some use out of modifying the scripts a bit for the earlier MPs as well.

Assumptions:

  • Your code lives in ~/ece411/reponame.
  • rv_load_memory.sh is in reponame/testcode.
@ianklatzco
ianklatzco / do-codes.txt
Created Nov 16, 2017
digital ocean coupon codes except minus a referral link like that other guy has posted
View do-codes.txt
LOWENDBOX DROPLET10 ALLSSD10 DODEPLOY SHIPITFAST10 OMGSSD10 FRANKFURT
@ianklatzco
ianklatzco / install-tg.sh
Created May 8, 2017
install tg/telegram-cli on linux
View install-tg.sh
#!/bin/bash
git clone --recursive https://github.com/vysheng/tg.git && \
cd tg && \
sudo apt-get update -y && sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make && \
./configure && \
make && \
cd ./bin && \
./telegram-cli
@ianklatzco
ianklatzco / discord-bot-post-message.sh
Created Dec 29, 2016
sends a message to a discord channel via a bot using command line HTTP POST- curl
View discord-bot-post-message.sh
#!/bin/bash
# update the TOKEN and the CHANNELID, rest is optional
# you may need to connect with a websocket the first time you run the bot
# use a library like discord.py to do so
curl -v \
-H "Authorization: Bot TOKEN" \
-H "User-Agent: myBotThing (http://some.url, v0.1)" \
-H "Content-Type: application/json" \
@ianklatzco
ianklatzco / discord-bot-post-message.py
Created Dec 29, 2016
sends messages to a discord channel using a bot via http POST
View discord-bot-post-message.py
# post a message to discord api via a bot
# bot must be added to the server and have write access to the channel
# you may need to connect with a websocket the first time you run the bot
# use a library like discord.py to do so
import requests
import json
channelID = "your_id_goes_here" # enable dev mode on discord, right-click on the channel, copy ID
botToken = "your_token_here" # get from the bot page. must be a bot, not a discord app
@ianklatzco
ianklatzco / potd.sh
Created Oct 21, 2016
automatically scp/run potd checkout script to ews
View potd.sh
#!/bin/bash
# ian klatzco 6 september 2016, some modifcation thru the semester
# WARNING
# make sure you don't have more than the most recent checkout-potd-q*.py file in the directory you set up this script to run in, or else you're gonna have a bad time (multiple downloads of files you've already download, and i am not sure what's gonna happen to your old code)
# WILL WIPE ALL OLD POTD DOWNLOAD SCRIPTS
# ASSUMES
# daily potd download script is dl'd to ~/Downloads
@ianklatzco
ianklatzco / catfact.py
Last active Sep 5, 2019
send cat facts to your friends logged into a ews/server. netid = username if you're not from uiuc
View catfact.py
# if netid is logged in, send a random cat fact to all of its terminals.
# usage: crontab -e. paste in:
# 0 * * * * python ~/catfact.py
# logs in ~/victims.txt
# why did i spend so much time on this.
# this got me banned from the school servers for two days
messagechance = 5 # 1 is 1%, 99 is 99%. keep in mind this will only run if they're logged in.
postscript = '\n this has been an automated cat fact. contact me to unsubscribe. or to subscribe others.\n'
listofnetids = ['netids','go','here']
@ianklatzco
ianklatzco / hexGenerator.sh
Last active Jun 16, 2016
test if lab2 for ECE220 works. download em into the directory containing your lab2.obj, chmod +x both of them, run "hexGenerator.sh > hex" and "test.sh > test" and then "diff test hex". if you get no output, you're golden.
View hexGenerator.sh
#!/bin/bash
max=65535
for((i=0;i<=max;i++))
do
printf "%.4X\n" $i
done
@ianklatzco
ianklatzco / Zelda Chest Noise
Last active Sep 12, 2019
Plays the chest noise from Legend of Zelda to a speaker or piezoelectric. Should be used with arduino; also works with a 1MHz attiny if you use the second script.
View Zelda Chest Noise
/* This code is derived from:
* http://www.arduino.cc/en/Tutorial/Melody
* This plays the chest noise from the Legend of Zelda on a piezo buzzer connected to pin 9 and ground. It has been tuned to a buzzer I had on hand, but you may want to adjust the values, testing against a tuner.
*/
int speakerPin = 0;
const int switchPin = 1;
char notes[] = "gabygabyxzCDxzCDabywabywzCDEzCDEbywFCDEqywFGDEqi azbC"; // a space represents a rest
int length = sizeof(notes); // the number of notes
You can’t perform that action at this time.