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
$ juju ssh 0 | |
machine-0# sudo apt-get install mongodb-clients | |
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin | |
MongoDB shell version: 2.4.9 | |
connecting to: localhost:37017/admin | |
juju:PRIMARY> db = db.getSiblingDB("juju") | |
juju |
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
1. Set Up an OIDC Identity Provider in AWS | |
Create an OIDC Identity Provider in AWS IAM: | |
Navigate to the IAM section in the AWS Management Console. | |
Choose "Identity Providers," then "Create Provider." | |
Select "OpenID Connect" as the provider type. | |
For the provider URL, you need the OIDC discovery endpoint URL from your k3s cluster. This URL is typically obtained from your Kubernetes cluster's API server configuration. | |
Add the thumbprint of the OIDC provider's SSL certificate. | |
2. Configure k3s for OIDC | |
Configure k3s with OIDC Details: |
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
function forward_lookup(hostname) | |
local ip = "" | |
local success, socket = pcall(require, "socket") | |
if success then | |
ip = socket.dns.toip(hostname) | |
end | |
print(ip, success, socket) | |
return ip | |
end |
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
Some notes from engineering. | |
1) Identify the partition | |
Mnesia('rabbit@juju-machine-30-lxd-11'): ** ERROR ** mnesia_event got {inconsistent_database, running_partitioned_network, 'rabbit@juju-machine-29-lxd-9'} | |
$ sudo rabbitmqctl cluster_status | |
2) Pick the most reliable node as the master. |
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 python | |
""" | |
Purge and delete rabbit queues by prefix and message | |
amount. | |
Usage: | |
{0} prefix 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/env python | |
""" | |
This is a tool for recovering a lost juju unit | |
Usage: | |
{0} controller-ip unit-from unit-to basedir | |
""" | |
import subprocess | |
import shlex |
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
$ juju run --unit nova-compute/0 "relation-ids amqp" | |
amqp:30 | |
$ juju run --unit nova-compute/0 "relation-list -r amqp:30" | |
rabbitmq-server/0 | |
$ juju run --unit nova-compute/0 "relation-get -r amqp:30 - rabbitmq-server/0" | |
hostname: 10.1.1.17 | |
password: 4T6fg9VjqN9BBLXdBBfyHscxpkBzby698GsXf88LwnRnmqd46TVfbPCMmrRCHpS5 | |
private-address: 10.1.1.17 |
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
package main | |
import ( | |
//"bufio" | |
"fmt" | |
"golang.org/x/net/icmp" | |
"golang.org/x/net/internal/iana" | |
"golang.org/x/net/ipv4" | |
"log" | |
"net" |
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 jinja2 import Environment | |
import yaml | |
import sys | |
RULE_TPL = """ | |
ALERT {{ alert }} | |
IF {{ expr }} | |
FOR {{ for }} | |
LABELS { | |
severity="page" |
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
niedbalski@theos-mobile:~$ cat test-madvise.c | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) { | |
size_t size = sysconf(_SC_PAGE_SIZE) * 6; //24K |
NewerOlder