Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am desterhuizen on github.
  • I am desterhuizen (https://keybase.io/desterhuizen) on keybase.
  • I have a public key ASAtO3gC1n1jf_iBzipVMgaE2tABtsOLh7BI08dZRoIV-go

To claim this, I am signing this object:

Generating Server Certificates

Generating the Certificate Authority Key

openssl genrsa -out mongodb-ca.key 4096

Create the config for CA certificate

MongoDB Atlas API Automation

Generate a deployment template

echo '{
   "name" : "<name>",
   "diskSizeGB" : "<size>",
   "providerSettings" : {
       "providerName" : "AWS",
       "diskIOPS" : 100,

Auto connect to Servers

Automatically connect to hosts from a list in a file

  • line 1: panes / tabs, panes will split the new tab as needed and tabs make a new tab for each host.
  • line 2: command to enter befotre the hostname in each host
  • line 3 -> X: The number of hosts you want to connect to.

Create a file in ~/servers/new_servers

panes
ssh -i key.pem ec2-user@
set -o errexit
promptToExit() {
echo $1 "(Y/N)"
read yn
if [[ "$yn" != "y" && "$yn" != "Y" ]]; then
echo "Stoppping the process..."
exit;
fi
}
@desterhuizen
desterhuizen / phpdangerousfuncs.md
Created December 11, 2023 08:19 — forked from mccabe615/phpdangerousfuncs.md
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program