This Gist has moved to podder-ai/kubernetes-offline-install-guideline Please check here for latest updates.
Work machine: A linux machine can access to internet
#!/bin/bash | |
if [ ! -d "tmp" ]; then | |
echo "tmp not exist. Creating tmp" | |
mkdir -p tmp | |
fi | |
PIDFILE=tmp/run.pid | |
if [ -f $PIDFILE ] | |
then |
#!/bin/bash | |
echo "The script you are running has basename `basename "$0"`, dirname `dirname "$0"`" | |
echo "The present working directory is `pwd`" |
def pdf_to_image(self, pdf_file, image_file): | |
try: | |
images = convert_from_path(pdf_file) | |
# pdf has 1 page | |
print (len(images)) | |
if len(images) == 1: | |
images[0].save(image_file) | |
else: | |
widths, heights = zip(*(i.size for i in images)) | |
max_width = max(widths) |
""" | |
Author: Eric J. Ma | |
Purpose: To merge PDFs together in an automated fashion. | |
""" | |
import os | |
from PyPDF2 import PdfFileReader, PdfFileMerger |
"""Examples fetching data from MySQL via /usr/bin/mysql""" | |
import subprocess | |
def get_innodb_log_file_size(): | |
"""Run SELECT @@innodb_log_file_size and return the value as an integer""" | |
process = subprocess.Popen(['mysql', '-ss'], | |
stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT, |
This Gist has moved to podder-ai/kubernetes-offline-install-guideline Please check here for latest updates.
Work machine: A linux machine can access to internet
FROM php:7.1-apache | |
ADD . /var/www | |
ADD ./site.conf /etc/apache2/sites-enabled/000-default.conf | |
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && \ | |
docker-php-ext-install mcrypt pdo_mysql opcache && \ | |
pecl install redis-3.1.2 && docker-php-ext-enable redis && \ | |
a2enmod rewrite |
var fs = require('fs'); | |
/** | |
* Offers functionality similar to mkdir -p | |
* | |
* Asynchronous operation. No arguments other than a possible exception | |
* are given to the completion callback. | |
*/ | |
function mkdir_p(path, mode, callback, position) { | |
mode = mode || 0777; |
#!/bin/bash | |
set -x | |
export SHA1=`echo ${CIRCLE_SHA1} | cut -c1-7` | |
export ENV=`echo $1 | rev | cut -d \- -f1 | rev` | |
function dd_mute() { | |
if [[ ${DD_MUTE_ID+x} ]]; then | |
echo "muting DD monitor id: ${DD_MUTE_ID}" | |
curl -X POST "https://app.datadoghq.com/api/v1/monitor/${DD_MUTE_ID}/mute?api_key=${DD_API_KEY}&application_key=${DD_APP_KEY}" |
machine: | |
php: | |
version: 7.1.3 | |
dependencies: | |
pre: | |
- mkdir -p ~/.composer/cache | |
- mkdir -p ~/.php-cs-fixer | |
- echo "memory_limit = 256M" > /opt/circleci/php/$(phpenv global)/etc/conf.d/memory.ini | |
override: |