This file contains hidden or 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
set -e causes the shell to exit whenever a pipeline, list, or compound command exits with non-zero status; | |
set -u causes the shell to exit whenever it attempts to expand a parameter which isn't defined. | |
set -o pipefail If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or | |
zero if all commands in the pipeline exit successfully. This option is disabled by default. |
This file contains hidden or 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
Environment variables | |
The git plugin sets several environment variables you can use in your scripts: | |
GIT_COMMIT - SHA of the current | |
GIT_BRANCH - Name of the remote repository (defaults to origin), followed by name of the branch currently being used, e.g. "origin/master" or "origin/foo" | |
GIT_LOCAL_BRANCH - Name of the branch on Jenkins. When the "checkout to specific local branch" behavior is configured, the variable is published. If the behavior is configured as null or **, the property will contain the resulting local branch name sans the remote name. | |
GIT_PREVIOUS_COMMIT - SHA of the previous built commit from the same branch (not set on first build on a branch) | |
GIT_PREVIOUS_SUCCESSFUL_COMMIT - SHA of the previous successfully built commit from the same branch (not set on first build on a branch) | |
GIT_URL - Repository remote URL | |
GIT_URL_N - Repository remote URLs when there are more than 1 remotes, e.g. GIT_URL_1, GIT_URL_2 |
This file contains hidden or 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
Steps for installing the Android Emulator from EC2 console: | |
----------------------------------------------------------- | |
sudo apt install default-jdk | |
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
unzip sdk-tools-linux-4333796.zip -d android-sdk | |
sudo mv android-sdk /opt/ | |
export ANDROID_SDK_ROOT=/opt/android-sdk | |
echo "export ANDROID_SDK_ROOT=/opt/android-sdk" >> ~/.bashrc | |
echo "export PATH=$PATH:$ANDROID_SDK_ROOT/tools" >> ~/.bashrc | |
re-login |
This file contains hidden or 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
# Took this: | |
# https://s3.amazonaws.com/awsiammedia/public/sample/SAMLAPICLIADFS/samlapi_formauth_adfs3.py | |
# converted to boto3 and smooshed it together with this: | |
# https://gist.github.com/kapilt/ac8e222081f63ba64e93 | |
# which gave birth too this: | |
import sys | |
import botocore | |
import boto3 | |
import requests |
This file contains hidden or 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
from botocore.credentials import RefreshableCredentials | |
from botocore.session import get_session | |
from boto3 import Session | |
def assumed_session(role_arn, session_name, session=None): | |
"""STS Role assume a boto3.Session | |
With automatic credential renewal. |
This file contains hidden or 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
Skip compile -Dmaven.main.skip | |
Skip exec -Dexec.skip |
This file contains hidden or 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
from datetime import datetime | |
from dateutil import tz | |
# METHOD 1: Hardcode zones: | |
from_zone = tz.gettz('UTC') | |
to_zone = tz.gettz('America/New_York') | |
# METHOD 2: Auto-detect zones: | |
from_zone = tz.tzutc() | |
to_zone = tz.tzlocal() |
This file contains hidden or 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 botocore | |
import boto3 | |
import datetime | |
from dateutil.tz import tzlocal | |
from botocore.credentials import DeferredRefreshableCredentials | |
from botocore.session import Session | |
def assumed_role_session(role_arn: str, base_session: botocore.session.Session = None): | |
base_session = base_session or boto3.session.Session()._session |
This file contains hidden or 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
brew uninstall ideviceinstaller | |
brew uninstall libimobiledevice | |
brew uninstall usbmuxd | |
brew install usbmuxd --HEAD | |
brew install --HEAD libimobiledevice | |
brew unlink libimobiledevice && brew link libimobiledevice | |
brew install --HEAD ideviceinstaller | |
brew unlink ideviceinstaller && brew link ideviceinstaller | |
sudo chmod -R 777 /var/db/lockdown |