Skip to content

Instantly share code, notes, and snippets.

View nemchik's full-sized avatar

Eric Nemchik nemchik

View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active February 29, 2024 04:20
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 27, 2024 02:55 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active March 26, 2024 12:27
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

# I DID NOT CREATE THIS SCRIPT, /u/shaloham did on reddit.com/r/sysadmin
#SOURCE: https://www.dropbox.com/s/ucjoc9x7i768cji/Bryce's%20Cryptowall%20Scanner.ps1?dl=0
#REDDIT: https://www.reddit.com/r/sysadmin/comments/42t8f9/simple_shitty_cryptowall_scanner_script/
# Email notification settings
$smtpserver = "something" #replace
$smtpport = 25
# Main loop
while (1 -eq 1)
@JeremyMorgan
JeremyMorgan / states.sql
Last active October 3, 2023 12:55
An SQL Query to insert 50 U.S. States into a database.Make sure your auto increment is set in MySQL, and Identity_insert is set in MS-SQL.
CREATE TABLE [state](
[stateID] [int] IDENTITY(1,1) NOT NULL,
[stateCode] [nchar](2) NOT NULL,
[stateName] [nvarchar](128) NOT NULL,
CONSTRAINT [PK_state] PRIMARY KEY CLUSTERED
( [stateID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY])
ON [PRIMARY]
@paranoiq
paranoiq / key.regexp.txt
Last active January 3, 2024 14:30
public RSA key validation regexp
#ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3} ([^@]+@[^@]+)#
// this is the most simple case. see more complete regexps in coments below
// http://generator.my-addr.com/generate_ssh_public_rsa_key-private_rsa_key-ssh_pair_online_tool.php
// https://help.ubuntu.com/community/SSH/OpenSSH/Keys
// http://www.ietf.org/rfc/rfc4716.txt