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
Summary: A utility for unpacking zip files | |
Name: unzip | |
Version: 6.0 | |
Release: 20%{?dist} | |
License: BSD | |
Group: Applications/Archiving | |
Source: http://downloads.sourceforge.net/infozip/unzip60.tar.gz | |
# Not sent to upstream. | |
Patch1: unzip-6.0-bzip2-configure.patch | |
# Upstream plans to do this in zip (hopefully also in unzip). |
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
title CI/CD Pipeline under Microservices for Developer\n@ yiidtw.github.io/blog | |
participant RD | |
participant Git | |
participant Jenkins | |
participant Harbor | |
participant Kubernetes | |
Git->RD: fork to personal repo | |
note over RD: develop & \nUNIT TEST |
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
# -*- coding: utf-8 -*- | |
import threading, sys, time | |
from math import pi | |
def workload(stop_event, arg): | |
# while not stop_event.wait(1): | |
# print ("working on %s" % arg) | |
while not stop_event.is_set(): | |
pi * pi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
[Unit] | |
Description=Gunicorn instance to serve python-flask | |
After=network.target | |
[Service] | |
User=centos | |
Group=centos | |
WorkingDirectory=/home/centos/python-flask | |
Environment="PATH=/home/centos/miniconda2/envs/python-flask/bin" | |
ExecStart=/home/centos/miniconda2/envs/python-flask/bin/gunicorn --bind 0.0.0.0:8000 wsgi |
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
from datetime import datetime | |
def logit(msg, log_type="INFO"): | |
try: | |
print(' {} {} {}'.format(log_type, datetime.now().strftime("%Y-%m-%d %H:%M:%S"), msg)) | |
except Exception as e: | |
print(' ERROR logging' + e.message) |
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
# sed | |
sed -i "s/old/new/g" /path/to/file | |
# find | |
find . -name "*.log" -type f | while read f; do echo $f; done | |
# fine and delete | |
find . -name "*.pyc" -exec rm -f {} \; | |
# compress a dir and scp |
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
# http://www.stdtime.gov.tw/chinese/bulletin/NTP%20promo.txt | |
sudo yum install -y ntp | |
sudo sed -i "s/server 0.centos.pool.ntp.org iburst/server time.stdtime.gov.tw prefer/g" /etc/ntp.conf | |
sudo sed -i "s/server 1.centos.pool.ntp.org iburst/server tick.stdtime.gov.tw/g" /etc/ntp.conf | |
sudo sed -i "s/server 2.centos.pool.ntp.org iburst/server tock.stdtime.gov.tw/g" /etc/ntp.conf | |
sudo sed -i "s/server 3.centos.pool.ntp.org iburst/server clock.stdtime.gov.tw/g" /etc/ntp.conf | |
sudo ntpdate time.stdtime.gov.tw # must nptdate before ntpd start, otherwise the port would be occupied by ntpd | |
sudo systemctl start ntpd && sudo systemctl enable ntpd |
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 yum install -y epel-release | |
sudo yum install -y python-pip python-virtualenv python-virtualenvwrapper | |
cat <<EOF >>$HOME/.bashrc | |
if [ -f /usr/bin/virtualenvwrapper.sh ]; then | |
export WORKON_HOME=~/.virtualenvs | |
source /usr/bin/virtualenvwrapper.sh | |
fi | |
EOF |
OlderNewer