This file contains hidden or 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 ( | |
"flag" | |
"fmt" | |
"os" | |
"github.com/docker/docker/api/types" | |
"github.com/docker/docker/client" | |
"golang.org/x/net/context" | |
) |
This file contains hidden or 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
# scenario: you have a container which has a programming environment (node,python,java) and you want to run Testinfra (or Molecule) to verify is set up properly | |
# This script will copy the test code in the container, run it and compare its output | |
# invocation: | |
# INTERPRETER=node TEST_PROGRAM=test.js EXPECTED_OUTPUT="Hello World" testinfra -v --connection docker --hosts=nodejs | |
# or | |
# INTERPRETER=/tools-copy/java/bin/java TEST_PROGRAM=HelloWorld.java EXPECTED_OUTPUT="Hello, World" testinfra -v --connection docker --hosts=maven | |
import os | |
import pytest | |
import testinfra |
This file contains hidden or 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
### | |
# Script which helps to minimize the final image size | |
### | |
# Set default value of the input variables | |
CI_STEP=${CI_STEP:-null} | |
EXPORT_TYPE=${EXPORT_TYPE:-null} | |
# Use sudo if not root | |
CMD="bash" |
This file contains hidden or 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
# script to edit the OVF Vm descriptor file, in this case change the memory size unit and remove the "System" part in the xml | |
# this was need to be able to import the OVF Vm from Virtualbox to Vsphere | |
import lxml.etree as et | |
import sys | |
import os | |
file_name = sys.argv[1] | |
try: |
This file contains hidden or 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
// This script generates flowlog stats for the local traffic | |
package main | |
import ( | |
"fmt" | |
"github.com/google/gopacket" | |
"github.com/google/gopacket/layers" | |
"github.com/google/gopacket/pcap" | |
"log" |
This file contains hidden or 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 | |
//simple usage go run dns_scraper.go -h=0.uk.pool.ntp.org -s=3 | |
import ( | |
"flag" | |
"fmt" | |
"github.com/bogdanovich/dns_resolver" | |
"io/ioutil" | |
"math/rand" |
This file contains hidden or 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 ruby | |
require 'time' | |
require 'yaml' | |
require 'json' | |
require "net/http" | |
require "uri" | |
# Variables | |
dryrun = ARGV[0] | |
verbose = ARGV[1] |
This file contains hidden or 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
I have two artemis goodies: | |
1) to see how many messages went in the broker | |
curl -s http://$BROKER_IP:8161/jolokia/read/org.apache.activemq.artemis:brokerName=\%22default\%22,module=JMS,name=*,serviceType=Queue,type=Broker/MessagesAdded,MessageCount,Name%7Cjq '.[]' | awk '/MessagesAdded/ { sum+=$2}END {print sum}' | |
you run before and after the test and you know how much c**p flew around | |
This file contains hidden or 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
/ # cat r.lua | |
local f = io.open('/dev/random',"rb") | |
while true do | |
local content = f:read(16) | |
local time = os.date() | |
print(time .. " : " ..content) | |
end | |
[root@localhost ~]# lua r.lua |
This file contains hidden or 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 centos:latest | |
MAINTAINER The CentOS Project <[email protected]> | |
LABEL Vendor="CentOS" | |
RUN yum -y install sensu erlang rabbitmq-server redis | |
# rename sample config | |
RUN mv /etc/sensu/config.json.example /etc/sensu/config.json | |
# setup rabbitmq | |
RUN echo $HOSTNAME && /etc/init.d/rabbitmq-server start && rabbitmqctl add_vhost /sensu && rabbitmqctl add_user sensu sensu && rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*" | |
#start all services | |
ENTRYPOINT redis-server --daemonize yes && /etc/init.d/rabbitmq-server start && /etc/init.d/sensu-server start && /etc/init.d/sensu-api start && /etc/init.d/sensu-client start && bash |