export DATE=`date +"%Y%m"`
export SITENAME="mike_tig_as"
export KEYNAME="$DATE-$SITENAME"
# Generate private key, make it have no password.
# change to 2048 if you want compatibility with CDNs / aws cloudfront / load balancers, etc
openssl genrsa -aes256 -passout pass:xxxx -out "${KEYNAME}.pass.key" 4096
openssl rsa -passin pass:xxxx -in ${KEYNAME}.pass.key -out ${KEYNAME}.key
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 | |
RM = rm -f | |
INSTRUMENT_FOR_PROMETHEUS := false | |
ifeq ($(INSTRUMENT_FOR_PROMETHEUS),true) | |
CFLAGS = -Wall -DINSTRUMENT_FOR_PROMETHEUS | |
LIBS = -lbcm2835 -lprom -lpromhttp -lmicrohttpd | |
else | |
CFLAGS = -Wall |
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 | |
################################################################################ | |
# cap - capture your screen | |
# | |
# This script allows you to capture your screen on Linux or macOS systems using | |
# the appropriate tools available on each platform. On Linux, it uses 'slop' | |
# and 'ffmpeg', while on macOS, it utilizes 'screencapture'. The script prompts | |
# you to select a desktop area for recording and saves the recording as an MP4/MOV | |
# file with customizable video quality. |
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
function password_encode(password) | |
local bcrypt = require 'bcrypt' | |
return bcrypt.digest(password, 12) | |
end | |
function check_password(password, encoded_password) | |
local bcrypt = require 'bcrypt' | |
return bcrypt.verify(password, encoded_password) | |
end |
For excessively paranoid client authentication.
Original: https://gist.github.com/mtigas/952344
openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
- Want to have a Discord user be able to enter commands to a bot and have actions impact their account in-game or not.
- Want an in-game user to be able to enter commands and have a bot "carry those over" to Discord
- Want to have the bot be able to access players' information
Examples:
- Discord user enters /mystats and bot replies with info about their money, score, etc, and whether they're currently connected or not.
- Player "John12" enters command '!dsay hello discord' and bot sends that message on a discord channel
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
#!/usr/bin/env bash | |
if [[ ! $EUID -eq 0 ]]; then | |
echo "ERROR: You're not running as root!" | |
exit 1 | |
fi | |
echo "Clearing snapd Cache..." | |
rm -rvf /var/lib/snapd/cache/** |
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 <iostream> | |
#include <string> | |
#include <curl/curl.h> | |
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) | |
{ | |
((std::string*)userp)->append((char*)contents, size * nmemb); | |
return size * nmemb; | |
} |
http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/
Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
NewerOlder