Skip to content

Instantly share code, notes, and snippets.

View rodrickbrown's full-sized avatar

Rodrick Brown rodrickbrown

View GitHub Profile
mkdir ~/.simple-tpm-pk11
stpm-keygen -p -o ~/.simple-tpm-pk11/$USER.key
echo "key $USER.key" > ~/.simple-tpm-pk11/config
ssh-keygen -D /lib64/libsimple-tpm-pk11.so > "~/.ssh/$USER.pub"
ssh-keygen -D /usr/lib/x86_64-linux-gnu/libsimple-tpm-pk11.so > "~/.ssh/$USER.pub" (ubuntu)
cat <<EOF > ~/.ssh/config
Host *
PKCS11Provider libsimple-tpm-pk11.so
EOF
#!/bin/bash
force=0
function getInstanceIdByEnvTag {
export instance_ids=$(aws ec2 describe-instances --filter Name=tag:Environment,Values=${environment} | jq '.Reservations[].Instances[].InstanceId' | tr -d '"')
echo "The following instances with Tag:${environment} will be stopped"
for instance in ${instance_ids[@]};
do
class Color(DefaultColor):
USERNAME_FG = 15
USERNAME_BG = 4
USERNAME_ROOT_BG = 1
HOSTNAME_FG = 15
HOSTNAME_BG = 8
HOME_SPECIAL_DISPLAY = True
PATH_FG = 7
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import json
import time
from checks import AgentCheck
from hashlib import md5
class OMSServiceCheck(AgentCheck):
import os
import urllib
import json
from checks import AgentCheck
from hashlib import md5
class AccumuloCheck(AgentCheck):
def check(self, instance):
if 'host' not in instance:
$ $ egrep run_jar roles/microservice/tasks/main.yml
template: src=run_jar.sh.j2 dest={{ orch_svc_base_dir }}/bin/run_jar.sh owner={{ orchard_service_user }} group={{ orchard_service_group }} mode=0755
$ cat roles/microservice/templates/run_jar.sh.j2
#!/bin/env bash
# {{ ansible_managed }}
{% if orch_svc_main_class == 'com.orchard.noteserver.NoteServer' %}
EC2_REGION="`echo \"$EC2_AVAIL_ZONE\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
{% endif %}
{
"id": "/production/haproxy/marathon-lb-test",
"args": [ "-s", "--group", "production", "-m", "prod-mesos-m-1.aws.orchardplatform.com:8080", "--health-check" ],
"cpus": 0.5,
"mem": 4096,
"instances": 1,
"constraints": [
[
"hostname","UNIQUE"
],
{
"id": "/production/haproxy/marathon-lb",
"cpus": 0.5,
"mem": 4096,
"instances": 1,
"constraints": [
[
"hostname","UNIQUE"
],
[
I0527 12:38:37.445116 51736 exec.cpp:143] Version: 0.28.1
I0527 12:38:37.447388 51749 exec.cpp:217] Executor registered on slave ed03b83f-1696-45ef-b0c9-6d4e0307b5bc-S16
Generating RSA private key, 2048 bit long modulus
..............................................+++
...............................+++
e is 65537 (0x10001)
Signature ok
subject=/CN=*
Getting Private key
marathon_lb: setting default value for HAPROXY_HTTP_FRONTEND_ACL_ONLY_WITH_PATH_AND_AUTH
I0527 12:38:37.445116 51736 exec.cpp:143] Version: 0.28.1
I0527 12:38:37.447388 51749 exec.cpp:217] Executor registered on slave ed03b83f-1696-45ef-b0c9-6d4e0307b5bc-S16
Generating RSA private key, 2048 bit long modulus
..............................................+++
...............................+++
e is 65537 (0x10001)
Signature ok
subject=/CN=*
Getting Private key
marathon_lb: setting default value for HAPROXY_HTTP_FRONTEND_ACL_ONLY_WITH_PATH_AND_AUTH