Skip to content

Instantly share code, notes, and snippets.

View kcchien's full-sized avatar

Kuang-Cheng Chien kcchien

  • King Steel Machinery Co., Ltd.
  • Taichung, Taiwan
View GitHub Profile
@kcchien
kcchien / README.md
Last active November 7, 2023 12:49
Visual Studio Code command for Fish shell

Save code.fish in ~/.config/fish/functions

@kcchien
kcchien / zpl-tcp.js
Last active October 11, 2023 21:38 — forked from gourneau/zpl-tcp.py
Printing ZPL over TCP/IP Example Python , Node.js 如何透過TCP/IP 直接送出ZPL檔到條碼機列印
const net = require('net'); // 引入網路 (Net) 模組
const HOST = '10.10.10.168';
const PORT = 9100;
let zpl = `
^XA
^FO150,40^BY3
^BCN,110,Y,N,N
^FD123456^FS
^XZ
@kcchien
kcchien / install_driver.sh
Created October 21, 2018 06:05
Elementary os 安裝在 Macbook 上找不到無線網路的解法
# Reference http://www.linuxlinx.com/2016/08/fix-no-wireless-on-macbook-after.html
# Removing bcmwl-kernel-source package, then reboot.
sudo apt-get remove --purge bcmwl-kernel-source
sudo reboot
# Installing new broadcom firmware.
sudo apt-get install firmware-b43-installer
# Reaload package.
@kcchien
kcchien / ExportOffice365user.ps1
Created December 8, 2017 08:25
Powershell commands for export Azure AD and import into local AD
#import office 365 session
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
#connect Azure AD
Connect-MsolService -Credential $UserCredential
#Random password generator
Function random-password ($length = 8)
@kcchien
kcchien / excel-addins-snippets
Created November 17, 2020 00:55
Excel.run snippet
await window.Excel.run(async (context) => {
// do something
await context.sync();
});
@kcchien
kcchien / nteract-tricks.md
Created August 8, 2020 04:52 — forked from vhoulbreque/nteract-tricks.md
Make conda environments visible in nteract

Nteract tricks

To add a conda environment to the list of environments:

$ source activate thisenv
(thisenv) $ pip install ipykernel
(thisenv) $ python -m ipykernel install --user --name thisenv
@kcchien
kcchien / buildVSCode.sh
Last active July 24, 2020 17:19
在 nVidia Jetson Nano 編譯與安裝 VSCode buildVSCode.sh : 編譯與安裝 product.json: 要記得先覆蓋原始碼裡的那一份
# 退出桌面模式,以節省記憶體,不然編譯到一半會有記憶體不足的狀況,造成失敗
# 你的畫面會進入Console 模式,是正常的
sudo systemctl isolate multi-user
# 準備建置原始碼
yarn
# 建置原始碼,這個會要花一些時間,約15~20分鐘
yarn run gulp vscode-linux-arm64-min
yarn run gulp vscode-linux-arm64-build-deb
@kcchien
kcchien / crerate-env.sh
Created May 1, 2020 01:44
Create Tensorflow 2 Enviroment with Conda
# 建立一個名稱為 tf2 的虛擬環境,並指定python 版本為 3.6
conda create -n tf2 python=3.6
# 啟動 tf2 虛擬環境
conda activate tf2
# 安裝 tensorflow 2
pip install tensorflow
# 安裝 PIL 套件
conda install pillow
<?php
$ipAddress=$_SERVER['REMOTE_ADDR'];
$matches=array();
echo 'IP:' . $ipAddress . '<br>';
# Execute arp
$arp=`arp -a $ipAddress`;
@kcchien
kcchien / install_fcitx_ime.sh
Last active November 17, 2019 02:24
Elementary os 安裝中文輸入法 倉頡,酷音
# Reference
# https://ithelp.ithome.com.tw/articles/10192648
# https://sites.google.com/site/paothsungchen/selflearning/elementaryos/inputchinese
# Fcitx official https://fcitx-im.org/wiki/Fcitx
sudo apt install software-properties-common
# 移除 ibus 框架
sudo apt remove --purge $(sudo dpkg -l | grep ibus | awk '{print $2}' | grep ^ibus)