Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / loopit.sh
Last active April 2, 2022 20:14
utilities for printf vulnerability cs647
#!/usr/bin/env bash
for i in {1..220}; do
echo | ./vulnFileCopy2 "'%$i\$x..'"
printf "\nLast offset was: ${i}\n"
done
@cicorias
cicorias / README.md
Created March 23, 2022 13:16
Convert AVRO files to JSONL files using Python

Overview

Using this you can run against a directory that has nested files/folders with files of *.avro.

This will walk the tree, convert alongside each of the avro files.

python avroConvert.py "mypath"

Generate Jar with dependencies (fatJar) using Gradle

There are multiple posts (old and new) with instructions on how to generate a fat jar, this is, a jar file for your application containing also your application's dependencies. Most solutions I have tried did not work for me, even in a simple Hello World java application, but I have found one that seems to work as expected.

Here it is:

Instructions

@cicorias
cicorias / docker-for-mac.md
Created March 13, 2022 16:33 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@cicorias
cicorias / Makefile
Last active May 16, 2022 21:57
Caesar Cipher in Assembly
SOURCES=caesar.s
OBJECTS=caesar.o
PRODUCT=caesar
uname_m := $(shell uname -m)
$(info uname_m=$(uname_m))
# 32 bit
LDFLAGS.i686=
ASFLAGS.i686=
# 64 bit
@cicorias
cicorias / preRequest.js
Last active February 18, 2022 20:43
sending traceparent for opentelemetry in postman
const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
//let traceparent = "00-" + genRanHex(32) + "-00" + genRanHex(14) + "-01"
let traceparent = "00-" + genRanHex(32) + "-" + genRanHex(16) + "-01"
pm.environment.set("traceparent", traceparent)
console.warn("sent " + traceparent)
@cicorias
cicorias / sendTracePost.sh
Created February 18, 2022 15:11
gist to send traceparent open telemetry from bash script headers
#!/usr/bin/env bash
# set -eox
# see spec: https://www.w3.org/TR/trace-context
# version-format = trace-id "-" parent-id "-" trace-flags
# trace-id = 32HEXDIGLC ; 16 bytes array identifier. All zeroes forbidden
# parent-id = 16HEXDIGLC ; 8 bytes array identifier. All zeroes forbidden
# trace-flags = 2HEXDIGLC ; 8 bit flags. Currently, only one bit is used. See below for detail
VERSION="00" # fixed in spec at 00
TRACE_ID="$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 32 | head -n 1)"
PARENT_ID="00$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 14 | head -n 1)"
@cicorias
cicorias / do.sh
Created February 14, 2022 16:14
bash to execute series of comands
#!/bin/bash
shopt -s nocasematch
getFileExtension () {
case "$1" in
"zip" )
echo "zip"
;;
"bzip2" )
echo "bz2"
@cicorias
cicorias / CaesarCipher.asm
Created January 20, 2022 15:01 — forked from ManeeshaPerera/CaesarCipher.asm
The following program is a CaesarCipher encryption algorithm written in MIPS assembly language
.data
prompt: .asciiz "Encrypt(E) or Decrypt(D) ?"
indata: .space 20
plaintext: .asciiz "Enter Plain text: "
ciphertext: .asciiz "Enter Cipher text: "
data: .space 40
Key: .asciiz "Key ?"
WrongKeyword: .asciiz "\nPlease enter a valid character"
.text
main:
@cicorias
cicorias / kotlin.kts
Created January 11, 2022 15:09
Kotlin Live Templates for Intellij
@Test
fun `should $DESCRIPTION$`() {
// given
$GIVEN$
// when
$WHEN$
// then
$THEN$