Skip to content

Instantly share code, notes, and snippets.

View chiehpower's full-sized avatar
🎯
Focusing on work

CHIEH chiehpower

🎯
Focusing on work
View GitHub Profile
@chiehpower
chiehpower / .drone.yml
Last active May 15, 2022 08:24
Drone yml file - Medium
global-variables:
debian_image: &debian_image ubuntu:latest
environment: &default_environment
server_ip: 10.1.2.102
kind: pipeline
type: docker
name: test
steps:
@chiehpower
chiehpower / docker-compose.yml
Created May 15, 2022 07:11
Drone for Server - Medium
version: '2'
services:
drone-server:
image: drone/drone:2
container_name: cicd-server
ports:
- 8090:80
extra_hosts:
- "10.1.2.102:10.1.2.102"
@chiehpower
chiehpower / source.list
Last active December 6, 2021 06:37
amd64 | /etc/apt/source.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://free.nchc.org.tw/ubuntu/ focal main restricted
# deb-src http://free.nchc.org.tw/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://free.nchc.org.tw/ubuntu/ focal-updates main restricted
# deb-src http://free.nchc.org.tw/ubuntu/ focal-updates main restricted
@chiehpower
chiehpower / gap.py
Created August 28, 2021 08:08
A simple code for computing Global Average Precision
# Source code from : https://github.com/yisaienkov/evaluations/blob/master/evaluations/kaggle_2020/global_average_precision.py
from typing import Dict, Tuple, Any
import pandas as pd
def colorstr(*input):
*args, string = input if len(input) > 1 else ('blue', 'bold', input[0])
colors = {
'blue': '\033[34m',
'end': '\033[0m',
@chiehpower
chiehpower / setup_zsh_script.sh
Last active July 29, 2022 06:48
Set up ZSH and packages
#!/bin/bash
apt-get update && apt-get install -y zsh autojump fonts-powerline
sudo chsh -s /bin/zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
## Resolved: Could not resolve host: github.com
git config --global --unset http.proxy
git config --global --unset https.proxy
@chiehpower
chiehpower / Dockerfile ENV
Last active November 15, 2021 07:01
The question is "When we use the ENV instruction in the dockerfile, can we can keep it in the environment after the container is built?"
FROM nvcr.io/nvidia/tensorrt:20.03-py3
ENV TEST_PAR=TEST_dockerfile_env
file name : .flake8
```
[flake8]
max-line-length = 100
```
file name : .editorconfig
```
import os
def batch_rename(path):
count = 0
total = len(os.listdir(path))
for fname in os.listdir(path):
time = total - len(str(count))
Extension = fname.split('.')[-1]
new_fname = str(0*(time)) + str(count) + '.' + Extension
import sys
import xlwt
book = xlwt.Workbook(encoding="utf-8")
sheet1 = book.add_sheet("Sheet1")
def main(orig_args, data):
filename = "speed_time.xls"
output(filename, data)
@chiehpower
chiehpower / vs code extensions
Last active April 29, 2022 00:49
VS Code Extension
Extension List:
- Better Comments : https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
- Atom One Dark Theme : https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark
- Power Mode : https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-power-mode
- Python : https://marketplace.visualstudio.com/items?itemName=ms-python.python
- Material Icon Theme : https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme
- TODO Highlight : https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight
- Markdown All in One : https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
- Remote - Containers : https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers