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
//#include "stdafx.h" | |
#include <sodium.h> | |
#include <iostream> | |
using namespace std; | |
#define MESSAGE (const unsigned char *) "test" | |
#define MESSAGE_LEN 4 | |
#define CIPHERTEXT_LEN (crypto_box_SEALBYTES + MESSAGE_LEN) |
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 | |
# Define the backup directory | |
BACKUP_DIR="$HOME/dotfile-backup" | |
get_vscode_settings_path() { | |
case "$OSTYPE" in | |
linux-gnu*) | |
# Linux | |
if [ -n "$WSL_DISTRO_NAME" ]; then |
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 | |
# This script installs the latest version of Go on your system. | |
# _________ _ _______ _________ _______ _ _ _______ _______ | |
# \__ __/( ( /|( ____ \\__ __/( ___ )( \ ( \ ( ____ \( ___ ) | |
# ) ( | \ ( || ( \/ ) ( | ( ) || ( | ( | ( \/| ( ) | | |
# | | | \ | || (_____ | | | (___) || | | | | | | | | | | |
# | | | (\ \) |(_____ ) | | | ___ || | | | | | ____ | | | | | |
# | | | | \ | ) | | | | ( ) || | | | | | \_ )| | | | | |
# ___) (___| ) \ |/\____) | | | | ) ( || (____/\| (____/\ | (___) || (___) | | |
# \_______/|/ )_)\_______) )_( |/ \|(_______/(_______/ (_______)(_______) |
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
CC = gcc | |
CFLAGS = -Wall -Wextra -std=c11 -O2 | |
LDFLAGS = -lcurl -ljansson -ldotenv | |
SRCDIR = src | |
OBJDIR = obj | |
BINDIR = bin | |
DATADIR = data | |
SRC = $(wildcard $(SRCDIR)/*.c) |
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 | |
sudo apt update -y | |
sudo apt-get install ca-certificates curl gnupg lsb-release | |
# Add Docker’s official GPG key | |
sudo mkdir -m 0755 -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg |
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
package schemagen | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"strings" | |
) |
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 | |
gpg --full-generate-key | |
key_id=$(gpg --list-secret-keys --keyid-format=long | grep sec | awk '{print $2}' | awk -F '/' '{print $2}') | |
echo "Key ID: $key_id" | |
gpgKey=$(gpg --armor --export $key_id) | |
echo $gpgKey |
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
```sql | |
-- Create the extension if it doesn't exist | |
CREATE EXTENSION IF NOT EXISTS "pgcrypto"; | |
-- Create table | |
CREATE TABLE IF NOT EXISTS users( | |
id serial not null primary key, | |
username text not null unique, | |
password text not null, |
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 | |
ARCH="amd64" | |
LATEST_VERSION="go1.19.3" | |
# "$(curl -sL https://golang.org/VERSION?m=text)" | |
ZIP_FILE="${LATEST_VERSION}.linux-${ARCH}.tar.gz" | |
if [ -f "$ZIP_FILE" ]; then | |
echo "go version $LATEST_VERSION already downloaded" |
NewerOlder