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 -v; old_energy_uj=0 old_time=0; while :; do energy_uj=$(sudo cat /sys/class/powercap/intel-rapl/*/energy_uj); time=$(date +%s%N); echo $(( (energy_uj - old_energy_uj) * 1000000 / (time - old_time) )); old_time=$time old_energy_uj=$energy_uj; sleep 1; done |
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
# | |
# Daemon for consul | |
# | |
# chkconfig: 345 98 20 | |
# description: Daemon for consul | |
# processname: consul | |
### BEGIN INIT INFO | |
# Provides: consul | |
# Required-Start: $network |
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
# | |
# Daemon for vault | |
# | |
# chkconfig: 345 99 20 | |
# description: Daemon for vault | |
# processname: vault | |
### BEGIN INIT INFO | |
# Provides: vault | |
# Required-Start: $network |
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 | |
import requests | |
import datetime | |
import json | |
import os | |
""" | |
Check_mk plugin to check for last log from Elasticsearch compared to current time | |
""" |
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 | |
# Generate hosts-file with private IP's in AWS ec2 | |
# Vars | |
hosts_file="/etc/hosts" | |
region="eu-west-1" | |
# AWS call | |
described_instances=`aws ec2 describe-instances --region ${region}` |
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
# Juniper SRX cheatsheet | |
#Help | |
help | |
<command> ? | |
#Show | |
show configuration |
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
cecho(){ | |
BLACK="\033[0;30m" | |
BLUE="\033[0;34m" | |
GREEN="\033[0;32m" | |
CYAN="\033[0;36m" | |
RED="\033[0;31m" | |
PURPLE="\033[0;35m" | |
ORANGE="\033[0;33m" | |
LGRAY="\033[0;37m" | |
DGRAY="\033[1;30m" |
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
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#define CANARY "in_the_coal_mine" | |
struct { | |
char buffer[1024]; |
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 | |
# Count appended lines last 10 seconds simultanously | |
# CentOS/RHEL | |
LOGPATH="/var/log/httpd/" | |
# Ubuntu/Debian | |
# LOGPATH="/var/log/apache2/" |
NewerOlder