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
#!/usr/bin/env python2 | |
''' | |
DigitalOcean external inventory script | |
====================================== | |
Generates Ansible inventory of DigitalOcean Droplets. | |
In addition to the --list and --host options used by Ansible, there are options | |
for generating JSON of other DigitalOcean data. This is useful when creating |
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 | |
echo "Installing dependencies..." | |
APT=`command -v apt-get` || true | |
YUM=`command -v yum` || true | |
if [[ "$APT" != "" ]]; then | |
apt-get update > /dev/null; sudo apt-get install -qqy sshpass > /dev/null | |
elif [[ "$YUM" != "" ]]; then | |
yum -y install sshpass >> /dev/null | |
else | |
echo "Distro unsupported." |
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
* pkg is the package manager | |
* build Dports tree: | |
# cd /usr | |
# make dports-create-shallow | |
* | |
Follow https://www.dragonflybsd.org/docs/how_to_get_to_the_desktop/ | |
to install mate |
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
// CLEAN JOB BUILDS // | |
// change this variable to match the name of the job whose builds you want to delete | |
def jobName = "Your Job Name" | |
def job = Jenkins.instance.getItem(jobName) | |
job.getBuilds().each { it.delete() } | |
// uncomment these lines to reset the build number to 1: | |
//job.nextBuildNumber = 1 | |
//job.save() |
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
# Clean all unassociated FIPs | |
nova floating-ip-list | grep "| -" | awk '{ print $2}' | xargs -L1 nova floating-ip-delete | |
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
# The usage quotas for the tenant are updated after deleting or creating a new instance | |
read -s -p "MySQL Password: " pw | |
vm_uuid=$1 | |
mysql -D nova -p$pw -e "update instances set deleted='1', vm_state='deleted',deleted_at='now()' where uuid='$vm_uuid' limit 1;" | |
sleep 1 | |
mysql -D nova -p$pw -e "delete from instance_faults where instance_faults.instance_uuid = '$vm_uuid';" | |
mysql -D nova -p$pw -e "delete from instance_id_mappings where instance_id_mappings.uuid = '$vm_uuid';" | |
mysql -D nova -p$pw -e "delete from instance_info_caches where instance_info_caches.instance_uuid = '$vm_uuid';" | |
mysql -D nova -p$pw -e "delete from instance_system_metadata where instance_system_metadata.instance_uuid = '$vm_uuid';" | |
mysql -D nova -p$pw -e "delete from security_group_instance_association where security_group_instance_association.instance_uuid = '$vm_uuid';" |
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
setxkbmap -layout us -variant altgr-intl -option -option lv3:ralt_switch | |
xmodmap -e "keycode 47 = semicolon colon semicolon colon dead_grave dead_grave" |
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 | |
# run as root | |
yum install -y vim git tcpdump yum-utils wget w3m strace lsof curl sudo screen | |
yum localinstall -y http://ftp.cica.es/epel/6/i386/epel-release-6-8.noarch.rpm | |
yum install -y bash-completion htop ccze mtr nmap tmux |
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
#Find a (wired) Raspberry Pi on the network | |
nmap -sn 192.168.1.0/24 > /dev/null; cat /proc/net/arp | grep b8:27 | awk '{print $1}' | |
# Symmetric encrypt with Blowfish | |
openssl enc -bf-cbc -salt -in myfile.txt -out myfile.enc | |
# Symmetric decrypt with Blowfish | |
openssl enc -d -bf-cbc -in myfile.enc -out myfile.txt | |
# Almost invisible shell | |
ssh -o UserKnownHostsFile=/dev/null -T user@host /bin/bash -i |
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
# Monitoring processes I/O | |
dstat -s --top-io --top-bio | |
iotop |
NewerOlder