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 | |
DEVID=$(xinput list --id-only "DLL07F3:01 044E:120B") | |
PROPID=$(xinput list-props $DEVID | grep "libinput Tapping Enabled (" | cut -d '(' -f2 | cut -d')' -f1) | |
xinput set-prop $DEVID $PROPID 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
#!/usr/bin/python3 | |
# | |
# Usage: | |
# ./nodes.py --url http://localhost:5240/MAAS/ --apikey "someapikey" | |
# ./nodes.py --url http://localhost:5240/MAAS/ --username foobar --pasword sekret | |
# | |
# Example output: | |
# node01 Deployed 11 days 2019-08-29 18:56:56+00:00 | |
# node02 Deployed 26 days 2019-08-14 13:19:01+00:00 | |
# node03 Deployed 16 hours 2019-09-09 03:55:11+00:00 |
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
tcpdump -nni any "icmp[icmptype] == icmp-echo or icmp[icmptype] == icmp-echoreply" |
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
dialmgo() { | |
agent=$(cd /var/lib/juju/agents; echo machine-*) | |
pw=$(sudo cat /var/lib/juju/agents/${agent}/agent.conf |grep statepassword |awk '{ print $2 }') | |
mongo --ssl --sslAllowInvalidCertificates -u ${agent} -p $pw localhost:37017/juju --authenticationDatabase admin | |
} |
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 -e | |
# Usage: | |
# ./read_relation.sh <RELATION> <UNIT> <UNIT_TO_READ_FROM> | |
# Example: | |
# ./read_relation.sh identity-service cinder/0 keystone/0 | |
# | |
# In this example we are reading the data contained in the identity-service | |
# relation between cinder/0 and keystone/0. | |
INTERFACE="$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
#!/bin/bash | |
# use awesome as window manager | |
xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -sa awesome | |
# disable xfce4-panel | |
xfconf-query -c xfce4-session -p /sessions/Failsafe/Client2_Command -t string -sa /bin/true | |
# disable xfdesktop | |
xfconf-query -c xfce4-session -p /sessions/Failsafe/Client4_Command -t string -sa /bin/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
# Default server configuration /etc/nginx/sites-enabled/default | |
# | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
... | |
location ~ ^/~(.+?)(/.*)?$ { | |
alias /home/$1/public_html$2; | |
index index.html index.htm; | |
autoindex on; |
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 | |
TOTAL_INSTANCES=0 | |
TMPFILE=`mktemp` | |
nova list --fields tenant_id --all-tenants | tail -n +4 | head -n -2 | cut -d'|' -f3 | tr -d ' ' | sort | uniq -c | sort -n | while read -r LINE; do | |
TENANT_ID=$(echo $LINE | awk -F' ' '{print $2}') | |
TENANT_NAME=$(openstack project show -c name -f value $TENANT_ID) | |
NUM_INSTANCES=$(echo $LINE | awk -F' ' '{print $1}') | |
echo "$NUM_INSTANCES $TENANT_NAME" | |
TOTAL_INSTANCES=$(($TOTAL_INSTANCES+$NUM_INSTANCES)) |
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 | |
# source: https://github.com/juju/charmstore-client/issues/154#issuecomment-375039544 | |
charm=${1#cs:} | |
shift | |
owner="$(charm show "cs:$charm" --format=json | jq -r '.owner.User')" | |
owner_rev="$(charm show "cs:~$owner/$charm" --format=json | jq -r '."id-revision".Revision')" | |
owner_url="cs:~$owner/$charm-$owner_rev" | |
#echo "$owner_url" | |
charm show "$owner_url" "$@"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
# | |
# Disable ipv6 in tun* interfaces | |
# File: /etc/udev/rules.d/99-ipv6-openvpn.rules | |
SUBSYSTEM=="net", ACTION=="add", KERNEL=="tun*", RUN+="/sbin/sysctl -w net.ipv6.conf.$env{INTERFACE}.disable_ipv6=1" |