Skip to content

Instantly share code, notes, and snippets.

View ycku's full-sized avatar
😈
Be evil

Yung-Chung Ku ycku

😈
Be evil
View GitHub Profile
@ycku
ycku / data-type.py
Last active September 5, 2017 03:16
Hello, Python
# 執行時自行註解掉不需要的段落
# 自動型別
var = 'Hello World' # string
print(var)
var = 100 # int
print(var+10)
print('-----')
# 沒有 overflow
@ycku
ycku / install-docker.sh
Created November 4, 2017 13:57
Docker Installation
#!/bin/bash
# Please check out the details of official page: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
# Tested on Ubuntu Zesty 17.04 amd64
# This script need to sudo.
sudo -S sudo -v
# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io
1 2 3 4 5 平均 標準差 誤差 比值
A 951.99 979.08 992.40 1067.75 1014.78 1001.20 43.59 4.35% 100
B 888.62 944.81 901.56 944.71 920.34 920.01 25.25 2.74% 91.89
@ycku
ycku / pgbench-alpine-debian.md
Last active December 12, 2018 08:01
測試 Docker 使用 alpine 和 debian 的效能
1 2 3 4 5 6 7 8 9 10
Alpine 1017.10 1078.33 1006.94 1013.67 987.46 999.53 988.34 1024.07 989.77 930.69
Debian Stretch 935.02 986.09 935.33 961.89 934.99 970.06 977.44 968.70 902.98 893.98
平均 標準差 誤差 比值
Alpine 1003.59 36.99 3.69% 106.01
Debian Stretch 946.65 31.36 3.31% 100.00
@ycku
ycku / pip-offline.md
Last active June 11, 2020 06:47
Note: Offline python pip install

Online host

  • Try to install 'pyvmomi' module
$ mkdir pyvmomi
$ cd pyvmomi
$ pip download pyvmomi
  • Now the related modules of 'pyvmomi' are downloaded in the folder.
@ycku
ycku / apt-offline.md
Last active April 22, 2025 06:48
記錄 apt-offline 的標準語法,在離線環境使用 apt

Advantages

  1. 相容原有的 source list
  2. 只下載需要安裝的套件
  3. 步驟單純

Goals

基本上就是處理下面三種(apt update, upgrade, install)需要網路的操作

  • online$: 表示在有對外網路的主機操作
  • offline$: 表示在無對外網路的主機操作
without PgBouncer with PgBouncer
including excluding overhead including excluding overhead
50 279.45 470.49 40.60% 651.29 752.88 13.49%
100 300.56 519.99 42.20% 688.09 794.18 13.36%
200 fail fail 728.26 826.52 11.89%
300 fail fail 808.12 923.31 12.48%
400 fail fail 797.75 898.38 11.20%
500 fail fail 744.53 824.08 9.65%
600 fail fail 808.09 884.52 8.64%
@ycku
ycku / dism.md
Last active October 17, 2019 08:44
從 Windows 光碟離線安裝內建功能

從 Windows 光碟離線安裝內建功能

  • 以 .Net framework 3.5 為例,Windows 10 以上不能使用 .Net framework 3.5 的離線安裝檔
c:\> dism.exe /online /enable-feature /featurename:netfx3 /All /LimitAccess /Source:d:\sources\sxs
  • Source 改為自己的光碟路徑
@ycku
ycku / install.md
Last active October 31, 2019 09:35
UBUNTU join domain

apt install

$ sudo apt -y install realmd sssd sssd-tools libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob-mkhomedir packagekit

join

$ sudo realm join domain -U ADadmin_username
@ycku
ycku / CountSessionsConnectionServer.ps1
Last active May 5, 2023 03:51
Counts the sessions from each View connection server
Import-Module VMware.VimAutomation.HorizonView
Import-Module VMware.Hv.Helper
Connect-HVServer -Server viewadminserver -User user@domain -Password thepassword
(get-HVlocalsession) |
select @{N='Username';E={$_.namesdata.username}},@{N='VM';E={$_.namesdata.machineorrdsservername}},@{N='ConnectionServer';E={$_.namesdata.securitygatewayaddress}} |
group ConnectionServer |
sort Name