This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npx ts-node generate-keys.ts | |
import crypto, { KeyObject } from "crypto"; | |
import fs from "fs"; | |
import { isKeyObject } from "util/types"; | |
enum EncryptionAlgorithm { | |
AES_128_CBC = "aes-128-cbc", | |
AES_192_CBC = "aes-192-cbc", | |
AES_256_CBC = "aes-256-cbc", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
port=3000 | |
if [ $# -gt 0 ]; then | |
port=$1 | |
fi | |
process_pid=$(lsof -i :$port | grep "LISTEN" | awk '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ANGLE=0 | |
RADIUS=100 | |
CENTER_X=1000 | |
CENTER_Y=1000 | |
INTERVAL=1 | |
ANGULAR_VELOCITY=1 | |
while true; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <minutes_to_keep_logs> <commands_to_keep_in_history>" | |
exit 1 | |
fi | |
logs_dir="/var/log" | |
minutes_to_keep_logs=$1 | |
commands_to_keep_in_history=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go run search_cep.go 00000000 | |
// Or | |
// go build search_cep.go | |
// ./search_cep 00000000 | |
package main | |
import ( | |
"encoding/json" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go run product_crud.go --action Get --product '{"id": "uuid"}' | |
// go run product_crud.go --action All | |
// go run product_crud.go --action Create --product '{"name": "Example product", "price": 1000.0}' | |
// go run product_crud.go --action Update --product '{"id": "uuid", "name": "Example product", "price": 1000.0}' | |
// go run product_crud.go --action Delete --product '{"id": "uuid"}' | |
package main | |
import ( | |
"bytes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
node_version="" | |
php_version="" | |
global_flag=false | |
while [[ "$#" -gt 0 ]]; do | |
case $1 in | |
--node=*) node_version="${1#*=}"; shift ;; | |
--php=*) php_version="${1#*=}"; shift ;; |