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"
@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 February 6, 2024 08:27
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 March 30, 2024 02:53
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;
/*************************************************
* 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