Skip to content

Instantly share code, notes, and snippets.

View RecoFu's full-sized avatar

Reco RecoFu

View GitHub Profile
@shengyou
shengyou / recommended-plugins-for-jetbrains-ides.md
Last active August 14, 2025 04:03
JetBrains IDE 微醺夜 - IDE 操作技巧分享 (April 2025)
@likamrat
likamrat / WinGet_WinSrv.ps1
Created February 13, 2023 00:41
Installing Winget om Windows Server 2019/2022
Write-Information "This script needs be run on Windows Server 2019 or 2022"
If ($PSVersionTable.PSVersion.Major -ge 7){ Write-Error "This script needs be run by version of PowerShell prior to 7.0" }
# Define environment variables
$downloadDir = "C:\WinGet"
$gitRepo = "microsoft/winget-cli"
$msiFilenamePattern = "*.msixbundle"
$licenseFilenamePattern = "*.xml"
$releasesUri = "https://api.github.com/repos/$gitRepo/releases/latest"
@qrtt1
qrtt1 / 00-ITHOME 2021 鐵人賽-觀戰區.md
Last active August 2, 2024 14:39
ITHome 第 13 屆鐵人賽 (updated UTC 2021-11-07 10:14:45.317902)
@mingderwang
mingderwang / list.py
Created August 19, 2020 06:34
Python Taiwan (Telegram) 讀書會練習
'''
https://note.nkmk.me/en/python-function-return-multiple-values/
我們用 function 可以一次回傳多個值, 當成了解 list 與 tuple 不同的地方
'''
# list 數學叫 "陣列", 其特性是 一堆有 “順序” 關係的東西清單.
# 這些東西, 未必要同一型態, 但同一型態 的 list 比較合理(且常用)
'''
@Cojad
Cojad / mini_google_authenticator.php
Last active May 21, 2025 10:01
Very small implementation of Google's OTP Authenticator
<?php
// copied from python code at https://stackoverflow.com/a/23221582/3103058
function base32_decode($key) {
// https://www.php.net/manual/en/function.base-convert.php#122221
$key = strtoupper($key);
list($t, $b, $r) = array("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "", "");
foreach(str_split($key) as $c)
$b = $b . sprintf("%05b", strpos($t, $c));
foreach(str_split($b, 8) as $c)
$r = $r . chr(bindec($c));
@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$: 表示在無對外網路的主機操作
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active October 24, 2025 11:14
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@nicman23
nicman23 / upgrade
Created April 21, 2018 06:34
Openwrt upgrade script
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
if [ -e /root/.upgrade ]
then exit
else touch /root/.upgrade
fi
@sebsto
sebsto / gist:6441df09e97c4cbbd22b8ba313b8d642
Last active July 19, 2022 03:26
Amazon Linux 2 first boot on Virtual Box
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html
# Be sure you have config/meta-data and config/user-data ready as per the below
# change ec2-user's password to your password
$ cat config/meta-data
local-hostname: amazonlinux.onprem
# eth0 is the default network interface enabled in the image. You can configure
@TerAnYu
TerAnYu / upgrade-all-packages
Created November 18, 2017 17:25 — forked from danielvijge/upgrade-all-packages
Upgrade all packages on OpenWRT router
#!/bin/ash
echo "Updating package list..."
opkg update > /dev/null
if [ `opkg list-upgradable | cut -d " " -f1 | wc -l` -gt 0 ]; then
echo "Available updates:"
opkg list-upgradable
echo ""