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
from fabric.api import * | |
from fabric.context_managers import hide | |
def dev(): | |
env.enviroment = 'dev' | |
env.branch = 'dev' | |
env.push_code = True | |
env.collect_static = False | |
env.resetdb = 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
def generate(request): | |
''' | |
Generate PDF | |
''' | |
data = {'response': 0} | |
if request.method == 'POST': | |
css_rules = ''' | |
.redalpha60 { | |
/* Fallback for web browsers that don't support RGBa */ | |
background-color: rgb(255, 0, 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
<domain type='kvm'> | |
<name>instance-00000xxx</name> | |
<uuid>xxxxxxxxxxxxxxxxxx</uuid> | |
<memory>1048576</memory> |
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
^(?<time>^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}(\.\d{3})?)) (?<id>(\d)*)?\s?(?<severity>(INFO|ERROR|WARNING|CRITICAL)) (?<component>([A-Za-z,\.,\,\_]*(\.)*))+ (?<description>([A-Za-z,\.,\[,\],\s,\:,\-,\d,\(,\),\=,\/,\',\",\_,{,}]*))$ | |
Test case: | |
2015-10-14 17:16:19.330 INFO nova.osapi_compute.wsgi.server [req-bef63dd4-2450-47ab-92f1-b4388a747ba7 admin demo] 104.131.138.224 "GET /v2.1/ceddd0c4f5214101b2026aef64797d51/limits HTTP/1.1" status: 200 len: 779 time: 0.2924919{} |
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
username="myusername" | |
hash="$(echo -n 'thenewpass{s4lt}' | sha256sum | awk '{print $1;}')" | |
echo "Changing password for $username" | |
echo "Password encrypted with SHA-256" | |
sed -i -E "s/(<passwordHash>.+)/<passwordHash>s4lt:$hash<\/passwordHash>/" /var/lib/jenkins/users/$username/config.xml | |
echo "Replaced succesfully, restarting jenkins service..." | |
service jenkins restart |
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
echo -e "\n\n########## Containers unhealthy ##########\n\n" | |
docker ps | grep unhealthy | |
echo -e "\n\n########## Pacemaker Status ##########\n\n" | |
pcs status | |
echo -e "\n\n########## RabbitMQ Status ##########\n\n" | |
docker exec -ti $(docker ps | grep -oP "rabbitmq-bundle-docker-[0-9]+") rabbitmqctl cluster_status | |
echo -e "\n\n########## Galera Status ##########\n\n" | |
docker exec -ti $(docker ps | grep -oP "galera-bundle-docker-[0-9]+") mysql -e "SHOW GLOBAL STATUS LIKE 'wsrep_%'" | grep -E -- 'wsrep_local_state_comment|wsrep_evs_state' | |
echo -e "\n\n########## Redis Status ##########\n\n" | |
docker exec -ti $(docker ps | grep -oP "redis-bundle-docker-[0-9]+") ps -efw |
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
source /home//stack/overcloudrc | |
openstack volume service list | |
openstack hypervisor list | |
openstack network agent list | |
# Variables | |
ENDPOINT='dashboard.shcp.gob' | |
USER='admin' | |
PASSWORD='wyd0903hw5qdi' |
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
#!/usr/bin/env bash | |
# Copyright 2017, Z Lab Corporation. All rights reserved. | |
# Copyright 2017, Kubernetes scripts contributors | |
# | |
# For the full copyright and license information, please view the LICENSE | |
# file that was distributed with this source code. | |
set -e |
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
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches | |
git fetch upstream | |
# Make sure that you're on your master branch: |
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
USER=someuser | |
PASSWORD=somepass | |
FILENAME="hosts.txt" | |
echo "Creating ssh key..." | |
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa -y | |
echo "Set StrictHostKeyChecking to no (/etc/ssh/ssh_config)..." | |
sed -i '/StrictHostKeyChecking/c StrictHostKeyChecking no' /etc/ssh/ssh_config | |
echo "Install sshpass..." |
OlderNewer