Skip to content

Instantly share code, notes, and snippets.

View flounderK's full-sized avatar
💭
Screaming in confusion

Clif Wolfe flounderK

💭
Screaming in confusion
  • Good god I’m lost
View GitHub Profile
@flounderK
flounderK / clickuptime.py
Last active July 11, 2020 17:19
Get the exact amount of time that you have spent working on either tasks or specific days in clickup
import os
import configparser
import requests
import json
from pyclickup import ClickUp
from collections import defaultdict
import datetime
from datetime import timedelta
import dateparser
@flounderK
flounderK / add_common_parent_directory.py
Last active August 21, 2020 18:30
Really messy script to add parent directories to files in google drive to make a tagging system for my digital library
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from apiclient import errors
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import argparse
@flounderK
flounderK / custom.py
Created February 20, 2021 16:17
ansible ini format filter plugin
from configparser import ConfigParser
from collections import defaultdict
import re
from io import StringIO
def from_ini(a, **kw):
conf = ConfigParser(**kw)
conf.optionxform = str
#!/usr/bin/python3
from collections import defaultdict
def get_vals_from_module(mod, sep='_'):
return {k: getattr(mod, k) for k in dir(mod) if not k.startswith(sep) and sep in k}
# TODO: make this work via stack (maybe?)
def catagorize_enums(name_dict, sep='_'):
@flounderK
flounderK / get_macros.py
Created July 11, 2021 16:15
A quick script to pull out macro definitions from c files
#!/usr/bin/python3
import re
import argparse
import os
import json
parser = argparse.ArgumentParser()
parser.add_argument("path", help="path to a file to get macros from")
parser.add_argument("-s", "--singleline", default=False, action="store_true",
@flounderK
flounderK / clipboard_file_transfer.sh
Created January 2, 2022 17:13
A very sad elf file transfer over a single tcp connection
# on remote target
cat << EOF | base64 -d - | tar -Jxf - -O > exp && chmod +x exp && ./exp
# on your machine (copies the base64 to your clipboard)
xclip -sel c <(tar -cJO exp | base64 - | sed -e '$a\\nEOF\n')
# Literally just paste the entirety of the compressed binary in base64 to the connected terminal
@flounderK
flounderK / gist:4b1694e23217deb34414d1854eafe2a1
Created January 3, 2022 17:26
create linux kernel codeqldb from cmdline
#!/bin/bash
CODEQL_DB_DIR="$HOME/Documents/codeql_dbs"
mkdir -p "$CODEQL_DB_DIR"
LINUX_REPO_DIR="$HOME/cloned/linux"
ORIGINAL_DIR=$(pwd)
cd "$LINUX_REPO_DIR"
make defconfig
cd "$ORIGINAL_DIR"
@flounderK
flounderK / make_slideshare_pdf.py
Created November 12, 2022 21:40
Turn a bunch of images from slideshare into a pdf
#!/usr/bin/env python3
import os
import argparse
import re
import subprocess
def cli():
description = """
Convert a large set of images from jpg to pdf.
@flounderK
flounderK / gdbinit
Last active October 21, 2023 19:51
Print out console output from the linux kernel in qemu before setting up serial or a console correctly using gdb
set height 0
set width 0
set $BINBASE = <YOUR-BINARY-BASE-HERE>
# this works correctly for the linux kernel after printk started using a ringbuffer in he linux kernel
set $PRINTLOC = 0x0
set $BP_record_print_text = $BINBASE + <offset-to-record_print_text>
b *$BP_record_print_text
@flounderK
flounderK / build_static_strace_aarch64.sh
Created November 5, 2023 16:03
cross compile static strace for aarch64
sudo apt install gcc-aarch64-linux-gnu
sudo apt install crossbuild-essential-arm64
sudo apt install crossbuild-essential-armel
sudo apt install gcc-arm-linux-gnueabi gcc-arm-none-eabi
git clone git@github.com:strace/strace.git
cd strace
./bootstrap