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 | |
# | |
# Create a variable `$key` for use in powershell as a AES encyrption key | |
# constant with (ConvertFrom-SecureString)[https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertfrom-securestring?view=powershell-7.2)] | |
# | |
# param: $1 secret key (optional, default: secret) | |
# param: $2 cipher (optional, default: aes-256-cbc) | |
# output: An byte array (in decimals), the size of the encryption key (AES256 = 32 bytes) | |
genkey() { |
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 | |
# | |
# MIT Licensensed | |
# Amit Bakshi Jan 2021 | |
# Generic option parser. | |
# Usage: | |
# parse_opts --valid-args 'foo bar link' -- --with-foo=yes --bar=fizz --no-link | |
# | |
# Yields: |
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
[Unit] | |
Description=Generate sshd keys | |
Before=ssh.service | |
ConditionPathExists=!/etc/ssh/ssh_host_rsa_key | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/ssh-keygen -A | |
RemainAfterExit=true | |
StandardOutput=journal |
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/sh | |
# Print the gcc cpu specific options tailored for the current CPU | |
# Author: | |
# http://www.pixelbeat.org/ | |
# Notes: | |
# This script currently supports Linux,FreeBSD,Cygwin | |
# This script is x86 (32 bit) specific | |
# It should work on any gcc >= 2.95 at least |
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/sh | |
mkdir -p ~/Library/KeyBindings | |
cd ~/Library/KeyBindings | |
if test -e DefaultKeyBinding.dict; then | |
echo >&2 "WARNING: Skipping customizing key bindings. $(pwd)/DefaultKeyBinding.dict already exists" | |
exit 0 | |
fi | |
cat > DefaultKeyBinding.dict <<'EOF' | |
{ |
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 main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"regexp" | |
"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 | |
# | |
# Get LetsEncrypt SSL certs | |
# | |
# Usage: | |
# letsencrypt.sh host1.domain.com host2.domain.com ... | |
# | |
# You must have your git config user.email set correctly | |
# | |
# The way this script works is that you register a wildcard DNS |
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 | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common | |
add-apt-repository ppa:ubuntu-toolchain-r/test | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y g++-5 gcc-5 |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDeFQ/NE6ZgqhUaj+lyc5jbEJkkwWjDxSddXOhFDs5e4Mni06m+vrI4rNoZ4mdP3l2p2rECBgPjE59SYbswUlzJWKhdBWLK0BH+rKn5fXjH/2VbE4YrVJaHONjhsLqLNKfvD7C5CC6T7hcwafwNwDjVblmXr/VydIhETnLnwnRZTXA0fTvd/W15gwpMQ+XY/cpTLaAH00oX26nfZRJCdKcVnPIa+OwBD3t2R3tzGdsevvprVCg80Tmyy6LYqLF4dLZVYz/o8G1QNgyjmvhIxyEYFQscT9LL70qfKz/UAUQTdiYr8Z73OXAzDXqNN46PvHSm35W3kQzizsd4KQWEom8J [email protected] |
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 | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update && apt-get install -yq software-properties-common apt-utils | |
add-apt-repository ppa:webupd8team/java -y && apt-get update && \ | |
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \ | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886 && \ | |
apt-get install -y --no-install-recommends oracle-java8-installer |
NewerOlder