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
pkg update | |
pkg install xorg | |
echo 'kern.vty=vt' >> /boot/loader.conf | |
pkg install virtualbox-ose-additions | |
echo 'vboxguest_enable="YES"' >> /etc/rc.conf | |
echo 'vboxservice_enable="YES"' >> /etc/rc.conf | |
echo 'dbus_enable="YES"' >> /etc/rc.conf | |
service vboxguest start | |
service vboxservice start | |
service dbus start |
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
import boto3 | |
def get_limit_value(service_code, quota_name): | |
client = boto3.client('service-quotas') | |
paginator = client.get_paginator('list_service_quotas') | |
page_iterator = paginator.paginate(ServiceCode=service_code) | |
for page in page_iterator: | |
for quota in page['Quotas']: | |
if quota['QuotaName'] == quota_name: |
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
import boto3 | |
client = boto3.client('organizations') | |
response = client.list_accounts( | |
) | |
if "Accounts" in response: | |
for account in response['Accounts']: | |
print("\"%s\",\"%s\"" %(account['Id'],account['Email'])) |
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
0 |
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
aws ec2 describe-images \ | |
--owners 'amazon' \ | |
--filters 'Name=description,Values=Amazon Linux AMI*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId]' \ | |
--output 'text' |
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
import os | |
import sys | |
import json | |
import boto3 | |
import logging | |
from botocore.vendored import requests | |
from botocore.exceptions import ClientError | |
ssm = boto3.client('ssm') | |
parameter = ssm.get_parameter(Name='/jenkins/jenkins_api_user', WithDecryption=True) |
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
export MYBUCKET=mybucket | |
export MYDIR=mydir/1/ | |
aws s3 ls s3://$MYBUCKET/$MYDIR/ | awk '{if ($4) print $4}' > myFiles.txt | |
for x in `cat myFiles.txt` | |
do | |
echo "restoring $x" | |
aws s3api restore-object \ | |
--bucket $MYBUCKET \ | |
--key "${MYDIR}/$x" \ | |
--restore-request '{"Days":7}' |
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
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ls='ls -G' | |
alias ll='ls -lG' | |
alias dir='ls -lG' | |
alias gits='git status' | |
alias gs='git status' | |
alias gl='git log' | |
alias ga='git add' | |
alias gd='git diff' |