Install the OpenSSL on Debian based systems
sudo apt-get install openssl
#!/usr/bin/env bash | |
KEYID=f0f2af05-6530-4dcf-a7ef-602f5bb8f642 | |
echo hello hello > ExamplePlaintextFile | |
aws kms encrypt --key-id f0f2af05-6530-4dcf-a7ef-602f5bb8f642 --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob | base64 --decode > ExampleEncryptedFile | |
aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext | base64 --decode |
Encrypt the Chef User’s Private Key | |
Chef Server uses public key cryptography to authenticate API requests. This requires the client to sign a hash of requests using a valid private key. In this example, we’ll use KMS to encrypt a copy of our Chef Server certificate (with its associated private key) and then decrypt it on the fly with the Lambda function as needed. This allows us to safely store our Chef Server credentials at rest in encrypted form without the risk of unauthorized users discovering the decryption key needed to access the credentials. | |
Create a customer master key (CMK) in KMS and note the keyId that is automatically generated. Make sure the IAM user you want to use for encrypted the Chef Server certificate and the Lambda role created in the previous section are added as a key users in KMS. Your IAM user needs kms.encrypt permissions to encrypt the certificate, while your Lambda user (via an IAM role) needs kms.decrypt permissions at runtime to access the certificate. | |
Encrypt your Chef Server c |
import re | |
import boto3 | |
import csv | |
from botocore.exceptions import ClientError | |
ec2 = boto3.client('ec2') | |
def get_snapshots(): | |
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots'] |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
#!/bin/bash | |
cd | |
timestamp=$(date +%s) | |
if [ ! -f openssh-7.3.zip ]; then wget https://github.com/noteits/openssh-portable/releases/download/cent.os.6.7.openssh.7.3p1/openssh-7.3.zip; fi; | |
unzip -o openssh-7.3.zip -d openssh-7.3p1 | |
cd openssh-7.3p1/ | |
cp /etc/pam.d/sshd pam-ssh-conf-$timestamp | |
rpm -U *.rpm | |
yes | cp pam-ssh-conf-$timestamp /etc/pam.d/sshd | |
/etc/init.d/sshd restart |
#!/usr/bin/env bash | |
# Quinn Comendant <quinn@strangecode.com> | |
# https://gist.github.com/quinncomendant/3be731567e529415d5ee | |
# Since 25 Jan 2015 | |
# Version 1.2 | |
CMD=$1; | |
if [[ `id -u` = 0 ]]; then |
abs(float)
- Returns the absolute value of a given float.
Example: abs(1)
returns 1
, and abs(-1)
would also return 1
,
whereas abs(-3.14)
would return 3.14
. See also the signum
function.
basename(path)
- Returns the last element of a path.
base64decode(string)
- Given a base64-encoded string, decodes it and
returns the original string.
NAME TITLE | |
abusiveexperiencereport.googleapis.com Abusive Experience Report API | |
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API | |
accesscontextmanager.googleapis.com Access Context Manager API | |
actions.googleapis.com Actions API | |
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API | |
adexchangebuyer.googleapis.com Ad Exchange Buyer API II | |
adexchangeseller.googleapis.com Ad Exchange Seller API | |
adexperiencereport.googleapis.com Ad Experience Report API | |
admin.googleapis.com Admin SDK |
git branch -m master newname | |
git push origin newname | |
# Change "Default Branch" in settings/options in GitHub | |
git push origin :master |