Skip to content

Instantly share code, notes, and snippets.

View Razzendah's full-sized avatar
💭
Learning

Razzendah Razzendah

💭
Learning
View GitHub Profile
@john-yuan
john-yuan / aes.go
Last active January 23, 2024 20:59
Golang AES example. AES-128-CBC, AES-192-CBC, AES-256-CBC encryption and decryption functions written in golang. https://go.dev/play/p/Kj3oeHmz0zA
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@jen20
jen20 / deregister-task-definitions.sh
Created July 22, 2019 18:05
Script to deregister all ECS Task Definitions in a given region
#!/usr/bin/env bash
get_task_definition_arns() {
aws ecs list-task-definitions --region ${AWS_REGION} \
| jq -M -r '.taskDefinitionArns | .[]'
}
delete_task_definition() {
local arn=$1
@yingray
yingray / main.go
Last active April 7, 2025 16:57
Golang: aes-256-cbc examples (with iv, blockSize)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
)
@padusumilli
padusumilli / kafka-cluster-docker-compose.yml
Last active January 13, 2024 20:51
Docker compose with multiple kafka broker and schema registry
version: '3.1'
services:
zookeeper-1:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 22181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
@hothero
hothero / aes_cbc_pkcs5.go
Last active August 22, 2024 07:16
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)
//max has been set to 1000000;
private void writeTest(Map<Integer, Integer> map, int max) {
long startTime = System.nanoTime();
for(int i = 1; i <= max; i++) {
Integer a = new Integer(i);
map.put(a, a);
}
long endTime = System.nanoTime();
double diff = (endTime - startTime)/(double)1000000000;
@ungoldman
ungoldman / curl_post_json.md
Last active April 12, 2026 16:43
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

/*************************************************
* Public Constants
*************************************************/
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41