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 'deb http://http.debian.net/debian-backports squeeze-backports(-sloppy) main' > /etc/apt/sources.list.d/backports.list | |
apt-get update | |
apt-get -t squeeze-backports install "ansible" |
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
$ sudo vi /etc/linuxmint/mintSystem.conf | |
[global] | |
enabled = False | |
[restore] | |
lsb-release = False | |
etc-issue = False | |
$ sudo vi /etc/lsb-release |
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
# kill all of the user processes | |
ps -u amonagent | grep -v PID | awk '{print $1}' | xargs -i kill {} | |
sleep 2 | |
ps -u amonagent | grep -v PID | awk '{print $1}' | xargs -i kill {} | |
# Systemd | |
if which systemctl > /dev/null 2>&1 ; then | |
systemctl stop amonagent | |
# Sysv | |
else |
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
resource "aws_alb" "alb_grafana" { | |
name = "alb-energy-grafana" | |
internal = true | |
security_groups = ["${aws_security_group.sec_energy_grafana_elb.id}"] | |
subnets = ["${var.SUBNETS}"] | |
tags { | |
Name = "alb-energy-grafana" | |
Owner = "${var.OWNER}" |
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
# https://forums.docker.com/t/accessing-host-machine-from-within-docker-container/14248/5 | |
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet | |
# Now each container can connect to the host under the fixed IP 192.168.0.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
aws iam upload-server-certificate --server-certificate-name star_amon_cx --certificate-body file://star_amon_cx_body.cer --private-key file://star_amon_cx.key --certificate-chain file://star_amon_cx_chain.cer --profile personal --path /cloudfront/ |
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 base64 | |
import hashlib | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
class AESCipher(object): | |
""" | |
A classical AES Cipher. Can use any size of data and any size of password thanks to padding. | |
Also ensure the coherence and the type of the data with a unicode to byte converter. |
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
sum=0; | |
$('.tabellebg .tarifiert').each(function() { | |
val = $(this).html(); | |
formatted_val = val.replace(".", "").replace(" kB", "").replace(" ", ""); | |
val_to_int = parseInt(formatted_val); | |
if(!isNaN(val_to_int)) { | |
sum +=val_to_int; | |
} |
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 random | |
distros = ['debian', 'centos', 'rails', 'django', 'ubuntu','redis', 'mysql', 'mongo', 'db'] | |
providers = ['do-ams','do-nyc', 'ec2-eu-west', 'ec2-us-east', 'do-ams', 'do-sf', 'do-sgp'] | |
region = [1, 2, 3] | |
for i in range(5): | |
distro = random.choice(distros) | |
provider = random.choice(providers) |
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
func main() { | |
cmd := os.Args[1] // the first argument is a command we’ll execute on all servers | |
hosts := os.Args[2:] // other arguments (starting from the second one) – the list of servers | |
results := make(chan string, 10) // we’ll write results into the buffered channel of strings | |
timeout := time.After(5 * time.Second) // in 5 seconds the message will come to timeout channel | |
// initialize the structure with the configuration for ssh packat. | |
// makeKeyring() function will be written later | |
config := &ssh.ClientConfig{ | |
User: os.Getenv("LOGNAME"), |