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
### | |
# 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
# 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
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
// This utility allows you to run a command which produce a file and interrup it when a certain size is reached | |
package main | |
import( | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" | |
"time" |
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
/* | |
==================================== | |
Build it as standalone binary : | |
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o memhog memhog.g | |
==================================== | |
Build its container : | |
FROM scratch |
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" | |
b64 "encoding/base64" | |
"github.com/skip2/go-qrcode" | |
"math" | |
"os" | |
//"strconv" |
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" | |
b64 "encoding/base64" | |
"fmt" | |
"github.com/clsung/grcode" | |
//"github.com/maruel/natural" | |
"io/ioutil" | |
"os" |
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 ( | |
"fmt" | |
"log" | |
"os" | |
//"io/ioutil" | |
"runtime/pprof" | |
) | |
func main() { |
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 ( | |
"bufio" | |
"bytes" | |
"compress/zlib" | |
"flag" | |
"fmt" | |
"github.com/gogo/protobuf/proto" | |
"github.com/golang/snappy" |