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 copy | |
a = 1 | |
b = [1,2,3] | |
c = "Some random string :)" | |
z = [a,b,c] | |
x = list(z) | |
x[1][1] = 100 |
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
#!/bin/bash | |
# Usage comment out code that you don't need per your CloudStack version | |
input=$(mysql -u root -proot -e "select vnc_password from cloud.vm_instance where name='$1'\G;" | grep vnc_password | sed 's/.*vnc_password: //') | |
# For older ACS versions: | |
java -classpath /usr/share/cloudstack-common/lib/jasypt-1.9.0.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI decrypt.sh input=$input password=password verbose=true | |
# For ACS 4.15-17: | |
java -classpath /usr/share/cloudstack-common/lib/jasypt-1.9.3.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI decrypt.sh input=$input password=password verbose=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
set -e | |
export ROOT=$PWD | |
git fetch origin | |
git clean -fdx | |
rm -fr deps/*jar deps/awsapi-lib deps/*.mar NONOSS | |
git checkout -- . | |
git checkout ${TAG} | |
export MINOR=${BUILD_ID} |
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
#!/bin/bash | |
# usage: bash <script> systemvm64template-4.5-vmware systemvm64template-4.5-vmware.vmdk | |
function stage_vmx (){ | |
cat << VMXFILE > "${1}.vmx" | |
.encoding = "UTF-8" | |
displayname = "${1}" | |
annotation = "${1}" | |
guestos = "otherlinux-64" |
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
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT DATABASE()); | |
SELECT IFNULL(@tables,'dummy') INTO @tables; | |
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables); | |
PREPARE stmt FROM @tables; |
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
domains=1 | |
instances=1 | |
usage(){ | |
echo "usage: $0 [-d domains] [-i instances]" | |
echo " -d number of domains to create (defaults to 1)" | |
echo " -i number of instances to create (defaults to 1)" | |
echo " -h (prints this help)" | |
} | |
while getopts d:i:h opt |
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
#!/bin/bash | |
# By Rohit Yadav <bhaisaab@apache.org> | |
# Change the values as needed below | |
set -e | |
set -x | |
cli=cloudmonkey | |
dns_ext=8.8.8.8 | |
dns_int=192.168.1.1 | |
gw=192.168.1.1 |
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
cd /path/to/repo | |
# rpm | |
for release in 4.2 4.3 4.4; | |
do | |
echo "Buildling repo for $release" | |
cd $release | |
rm -fr repodata | |
createrepo . |
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
int sensorValue; | |
void setup() | |
{ | |
Serial.begin(9600); // sets the serial port to 9600 | |
} | |
void loop() | |
{ | |
sensorValue = analogRead(0); // read analog input pin 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
- Get authors file: | |
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt | |
- Fix the authors file with alias = Name <Email@Server.com> | |
- Convert! | |
mkdir repo && cd repo | |
git svn init repo --no-metadata | |
git config svn.authorsfile <path to authors file> | |
git svn fetch |