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
# Delete all files in the workspace | |
rm -rf * | |
# Create a directory for the job definitions | |
mkdir -p $BUILD_ID/jobs | |
# Copy global configuration files into the workspace | |
cp $JENKINS_HOME/*.xml $BUILD_ID/ | |
# Copy keys and secrets into the workspace |
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
mport pandas as pd | |
from datetime import datetime | |
No_of_quarters=8 | |
#today = datetime.date.today() | |
today = datetime(2019, 1, 11) | |
month = pd.Period(today, freq='M') | |
quarter = month.asfreq('Q-DEC') | |
print(type(quarter)) |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: sudo $0 /dev/sdh1" | |
exit 1; | |
fi | |
dd if=$1 of=/dev/null & pid=$! | |
while true; do | |
ps -p$pid --no-heading || break; | |
echo "-- $(date) ------------------"; |
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
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
swapon -s | |
/etc/fstab | |
/swapfile swap swap sw 0 0 |
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
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html |
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 json | |
import boto3 | |
def lambda_handler(event, context): | |
client = boto3.client('s3') | |
res = client.get_object(Bucket='szabgab', Key='abc.json') | |
content = res["Body"].read() | |
data = json.loads(content) | |
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
Thread.getAllStackTraces().keySet().each() { | |
if (it.name.contains('JOB_NAME')) { | |
println "Stopping $it.name" | |
it.stop() | |
} | |
} |
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
Most common Bash date commands for timestamping | |
From time to time I get asked how to use the date command to generate a timestamp. Here is an idiot-friendly script you can post for reference in your team’s bin/ if you get interrupted about timestamp questions or have an aversion to typing phrases like “man date” (with or without a space). | |
All but the first one and last three produce filename-friendly strings. | |
A big thanks to the following folks for pointing out mistakes and suggesting useful format inclusions: | |
2013-05: Rich for the reminder to include UTC and timezoned stamps. | |
2017-10: “Hamilton and Meg” (haha!) for pointing out I had my 4 year example formats messed up and for prodding me to include a 2-year example. | |
2018-01: Autumn Gray for suggesting that I add examples of including short and long days of the week. |
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
xcodebuild -list -workspace BaseNetworkConcept.xcworkspace/ -json |
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
sudo yum groupinstall "Development Tools" | |
sudo yum install make glibc-devel gcc patch | |
sudo yum install gcc-c++ | |
sudo yum install openssl-devel | |
update-alternatives --config gcc ( choose gcc48) | |
/usr/local/bin/virtualenv test-env | |
source test-env/bin/activate |