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
<!-- | |
Copyright 2017 Vinzenz Feenstra, Red Hat, Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
def mail_body_decode(message): | |
for part in email.header.decode_header(message): | |
binary, charset = part | |
if isinstance(binary, str): | |
yield str(binary) | |
else: | |
dammit = UnicodeDammit(binary, ['utf8', 'gb2312'] + [charset]) | |
decoded_str = dammit.unicode_markup | |
yield decoded_str |
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
command="php $INSTALL/indefero/scripts/gitcron.php" | |
job="0 0 * * 0 $command" | |
cat <(fgrep -i -v "$command" <(crontab -l)) <(echo "$job") | crontab - |
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
image: docker:latest | |
services: | |
- docker:dind | |
build-master: | |
stage: build | |
script: | |
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | |
- docker build --pull -t "$CI_REGISTRY_IMAGE" . | |
- docker push "$CI_REGISTRY_IMAGE" |
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
[loggers] | |
keys=root,access | |
[handlers] | |
keys=consoleHandler,errorFileHandler,accessFileHandler,infoFileHandler | |
[formatters] | |
keys=simpleFormatter, accessFormatter | |
[logger_root] |
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
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
echo ZONE=\"Asia/Shanghai\">/etc/sysconfig/clock |
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 me.champeau.deck2pdf; | |
import java.lang.reflect.Field; | |
import java.util.Objects; | |
import javafx.application.Application; | |
/** | |
* Adapted from https://gist.github.com/hastebrot/cbca1128dd791966e3a6 | |
*/ | |
public class HeadlessMain { |
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 python:2.7 | |
FROM gatsbylee/centos6-python27:6.9.1 | |
USER root | |
RUN yum -y install gcc | |
RUN yum -y install mysql mysql-devel | |
ENV ORACLE_HOME=/usr/lib/oracle/11.2/client64 | |
ENV PATH=$PATH:$ORACLE_HOME/bin | |
ENV LD_LIBRARY_PATH=$ORACLE_HOME/lib |
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
rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm | |
yum -y install puppet-agent | |
ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet |
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
# module https://forge.puppet.com/stankevich/python | |
# $puppet module install stankevich-python --version 1.18.2 | |
# solution see https://github.com/stankevich/puppet-python/issues/233 | |
class { 'python': | |
version => 'python27', | |
pip => 'present', | |
dev => 'absent', | |
virtualenv => 'absent', |