Skip to content

Instantly share code, notes, and snippets.

View bstee615's full-sized avatar
🐢
Working on graduating

Benjamin Steenhoek bstee615

🐢
Working on graduating
View GitHub Profile
@bstee615
bstee615 / limit_twitter.js
Created March 12, 2024 19:48
JavaScript for Twitter Post Limiter
// ==UserScript==
// @name Twitter Post Limiter
// @namespace https://github.com/bstee615/
// @version 0.2
// @match https://twitter.com/home*
// @grant none
// @author Benjamin Steenhoek
// @description Number posts on the Twitter timeline and limit after a set number.
//
// 3/12/2024, 2:23 PM created
@bstee615
bstee615 / run_llm.sh
Last active November 18, 2023 02:17
Following Francois's instructions how to run Nous-Capybara-34B https://twitter.com/francoisfleuret/status/1725418041570173334/photo/1
#!/bin/bash
pip install huggingface-hub==0.19.0
git clone https://github.com/ggerganov/llama.cpp
(cd llama.cpp; make -j -k)
huggingface-cli download TheBloke/Nous-Capybara-34B-GGUF nous-capybara-34b.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
./llama.cpp/main -ngl 32 -m nous-capybara-34b.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -i -ins
# Interact with the LLM through the command-line chat interface. Have fun!
@bstee615
bstee615 / run_project_fuzzer.sh
Created February 16, 2023 20:33
OSS-Fuzz - run project's fuzzer with runtime and file limit
#!/bin/bash
project=$1
fuzzer=$2
timeout=$3
file_limit=$4
corpus_dir=$5
jobs=$6
STARTTIME="$(date +%s)"
ENDTIME="$(( $STARTTIME + $timeout ))"
@bstee615
bstee615 / output_failure.txt
Created September 30, 2022 17:30
Test a bug with DeepSpeed output_file argument
Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertForSequenceClassification: ['cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.bias', 'cls.predictions.transform.dense.weight', 'cls.seq_relationship.weight']
- This IS expected if you are initializing BertForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and a
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bstee615
bstee615 / pyzotero-delete-tags.py
Created September 30, 2022 15:55
Remove all auto-added tags from Zotero (mine came in from Mendeley)
#%%
ID="8644119"
KEY="ICPHRBsnvLZhN8ojG4CPBOvo"
TYPE="user"
from pyzotero import zotero
zot = zotero.Zotero(ID, TYPE, KEY)
items = zot.top(limit=5)
# we've retrieved the latest five top-level items in our library
# we can print each item's item type and ID
@bstee615
bstee615 / timing_results.csv
Created March 22, 2022 20:09
Timing results for SrcML vs. Joern vs. LLVM
LLVM Joern SrcML
0.0230s ± 0.0034s 6.2906s ± 0.0034s 0.0702s ± 0.0088s
@bstee615
bstee615 / loop_exchange_result.c
Created March 22, 2022 20:06
Loop exchange result
int main()
{
int x = 0;
int i = 0;
while (i < 10) {
x += 1;
i++;
}
return x;
}
@bstee615
bstee615 / loop_exchange.c
Created March 22, 2022 20:05
Loop exchange input
int main()
{
int x = 0;
for (int i = 0; i < 10; i ++)
{
x += 1;
}
return x;
}
@bstee615
bstee615 / compile.py
Created April 29, 2021 21:38
Compiles a Latex project into one .tex file
import os
import re
import sys
"""
Compiles a Latex project into one .tex file.
Requires a main tex file and a compiled .bbl file for the project.
Run from the root of the Latex project for correct include paths.
Usage: compile.py <input.tex> <input.bbl>
"""