Install python-novaclient
2.30.2
pip install -I python-novaclient==2.30.2
Install python-openstackclient
pip install python-openstackclient
Create your config file:
vi ~/.config/openstack/clouds.yaml
dreamcompute:
#!/bin/bash | |
# | |
# terraform-app | |
# | |
# This to terraform the servers for the Galleon App | |
# By storing the date now, we can calculate the duration of provisioning at the | |
# end of this script. | |
start_seconds="$(date +%s)" |
variable "region" { | |
default = "tr2" | |
description = "The region of openstack, for image/flavor/network lookups." | |
} | |
variable "image" { | |
default = { | |
tr2 = "eee08821-c95a-448f-9292-73908c794661" | |
tr2-1 = "" | |
RegionOne = "WRONG VALUE" |
Install python-novaclient
2.30.2
pip install -I python-novaclient==2.30.2
Install python-openstackclient
pip install python-openstackclient
Create your config file:
vi ~/.config/openstack/clouds.yaml
dreamcompute:
1.) FIND: ' {AMANAME}: ' | |
REPLACE WITH: ' {AMANAME}! ' | |
2.) FIND: '\[[0-9]{1,2}:[0-9]{2} PM\] ([^:]+)\: ([^\[]+)' | |
REPLACE WITH: '**Q (\1) : \2** | |
' | |
3.) FIND: ' | |
** |
#!/bin/bash -x | |
# DESCRIPTION: The following UserData script is created to configure a Rackspace Cloud server | |
# with all the necessary things you might want. | |
# Recommended flavor is a minimum 4-8GB as the disk partitions for /tmp and /var/log are 4-8GB | |
# | |
# Can be used from CLI with nova or supernova | |
# example: | |
# supernova lincusa boot --image "Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)" --flavor performance1-8 --key-name {YOUR_KEY} --user-data "ubuntu-init-script.sh" --config-drive true {YOUR_SERVER_NAME} | |
# |
echo RTFM >&2; | |
exit -1; | |
N=1 | |
yum install -y lvm2 | |
D=$(grep "unknown partition table" /var/log/messages | tail -n 1 | perl -pe 's/.*: ([^:]*): unknown.*/$1/g'); | |
D=/dev/$D | |
pvcreate $D | |
vgcreate vg_$N $D | |
S=$(vgdisplay vg_$N | grep Total | perl -pe 's/[^0-9]+//g') |
#sql-restore-files | |
for SQL in *.sql.gz; do DB=${SQL/\.sql.gz/}; echo importing $DB; zcat $SQL | mysql -u root --password='{PASSWORD}' $DB; done | |
#backup all directories and compress them | |
find ./* -maxdepth 0 -type d -exec echo "Archiving {}" \; -exec tar -cjf "{BACKUP_DIR}/{}-{DATE}.tar.bz2" \; | |
#find and replace in files recursive without touching files that dont match | |
find ./ -type f -name '*.php' -print0 | xargs -0 grep 'FIND' -l | xargs sed -i 's/FIND/REPLACE/g' | |
#apache max clients recommendation |
// Client side form validation | |
$("form").submit(function(e) { | |
var uploader = $("#uploader").pluploadQueue(); | |
// Validate number of uploaded files | |
if (uploader.total.uploaded == 0) { | |
// Files in queue upload them first | |
if (uploader.files.length > 0) { | |
// When all files are uploaded submit form | |
uploader.bind("StateChanged", function() { |
var _optly = { | |
updateQueryString: function(key, value, url) { | |
if (!url) url = window.location.href; | |
var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"); | |
if (re.test(url)) { | |
if (typeof value !== 'undefined' && value !== null) | |
return url.replace(re, '$1' + key + "=" + value + '$2$3'); | |
else { | |
var hash = url.split('#'); |
umount /dev/xvdd1 (unmount the partition) | |
fsck -y /dev/xvdd1 (do an initial file system check) | |
tune2fs -O ^has_journal /dev/xvdd1 (remove the existing journal) | |
fsck -y /dev/xvdd1 (do a further file system check) | |
tune2fs -j /dev/xvdd1 (recreate the journal) |