I hereby claim:
- I am blackpioter on github.
- I am blackpioter (https://keybase.io/blackpioter) on keybase.
- I have a public key whose fingerprint is 550A 5D5B 0FF9 F873 8AE6 2257 312A D4E7 15E5 7DDC
To claim this, I am signing this object:
awk -F: 'END {print "uid:"u" gid:"g" groups:"gg}{if($1=="Uid"){split($2,a," ");u=a[1]}if($1=="Gid"){split($2,a," ");g=a[1]}if($1=="Groups"){gg=$2}}' /proc/self/status |
# Gawk version | |
# Remote | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
# No Gawk | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
#!/usr/bin/env python | |
import boto3 | |
filter_env = {'Name': 'tag:Environment', 'Values': ['Environment']} | |
filter_role = {'Name': 'tag:Role', 'Values': ['Role']} | |
for i in ec2.instances.filter(Filters=[filter_env, filter_role]): | |
for tag in i.tags: | |
if tag['Key'] == "Name": | |
print (i.id + " " + tag['Value']) |
#!/usr/bin/env python | |
import boto3 | |
def list_instances_env_role(env, role): | |
""" | |
List of instances with tag:Environment and tag:Role | |
""" |
#!/bin/bash -xe | |
################################################################################## | |
function usage(){ | |
echo "usage: $(basename $0) /path/to/jenkins_home jenkins.tar.gz" | |
} | |
function error_exit | |
{ |
plugins { | |
id "com.palantir.git-version" version "0.5.2" | |
id "nebula.rpm" version "4.1.0" | |
} | |
jar { | |
baseName = 'PACKAGE_NAME' | |
try { | |
def details = versionDetails() |
def isJenkinsBuild = System.getenv("BUILD_NUMBER") ?: false | |
if(isJenkinsBuild) { | |
signingKeyId = System.getenv("signingKeyId") | |
signingKeyPassphrase = System.getenv("signingKeyPassphrase") | |
signingKeyRingFile = new File(System.properties['user.home'] + '/.gnupg/secring.gpg') | |
} |
## AWS show instance count by type | |
aws ec2 describe-instances --filters Name=instance-state-name,Values=running --output json | jq ".Reservations[].Instances[].InstanceType" | sort | uniq -c | sort -n | |
## AWS List instances in table | |
aws ec2 describe-instances --output table --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, State.Name]' | |
## AWS List running instances in table | |
aws ec2 describe-instances --output table --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, PublicIpAddress, PrivateIpAddress , InstanceType, SubnetId ]' --filters Name=instance-state-name,Values=running | |
## AWS EC2 limits for account / region |
I hereby claim:
To claim this, I am signing this object:
## mysql: show mysql host,user,passwd | |
SELECT Host,user,password FROM mysql.user WHERE User = "root" ORDER BY (Host="localhost") ASC ; | |
## mysql: set empty root password | |
update user set password=PASSWORD("") where User='root'; | |
flush privileges; |