Skip to content

Instantly share code, notes, and snippets.

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.
@jacky9813
jacky9813 / yum-mirror
Created June 14, 2020 12:49
Bash script for mirroring yum repositories registered in the system
#!/usr/bin/env bash
BASEDIR=$(pwd)
PROGRAMDIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
REPOSINFODIR=/etc/yum.repos.d
SYNCSTARTTIME=$(date "+%Y%m%d%H%M%S")
SYNCLOGDIR=$BASEDIR/logs/sync/$SYNCSTARTTIME
GLOBALLOGFILE=SyncLog.log
ALLREPOS=false
VERBOSE=false
SHOWREPOS=false
Dim verbose
verbose = True
' verbose = False
Sub WordCallback(FilePath)
On Error Resume Next
Dim outputPath, oDoc
outputPath = FilePath & "x"
If verbose Then
Wscript.Echo FilePath & " => " & outputPath

Building Python 3.11

This article focuses on building CPython for common Linux server operating systems.

These scripts will be tested in fresh Docker container.

I'll install dependencies from package manager if possible, or I'll try compile myself if that makes sense.

The dependencies doesn't change much between these CPython versions, so Python 3.12 and 3.10

@jacky9813
jacky9813 / README.md
Last active November 13, 2022 07:10
Journey of Installing Gentoo Linux

My Journey of Installing Gentoo Linux

Welp, since it is Gentoo Linux, it'll never gonna be easy to install, and definitely having much more rocky process than Rocky Linux (pun intented).

Installing Gentoo Linux is just a test to my Linux knowledge and hopefully it'll help me troubleshoot problems when managing other's machine.

Anyway, the official Gentoo Installation Handbook is very helpful for getting started, mostly.

The scope of the installation

@jacky9813
jacky9813 / lxc-wsl2.md
Last active October 2, 2024 14:35
Running LXC VM in WSL2

Running LXC/LXD VM in WSL2 (Windows 11 Only)

If you just running LXC/LXD containers, the default settings for WSL2 (both Windows 10 and Windows 11) should be adequate.

However, if trying something like lxc launch images:alpine/3.18 --vm, LXC will complain that vhost_vsock module is not loaded.

Here's how I configure WSL2 so I can run VM with LXC/LXD.

@jacky9813
jacky9813 / cmon-intel.ps1
Last active October 17, 2023 19:05
intel 13th gen Core i FREE UPGRADE!!!!!
# A wonderful upgrade tool for Intel 14th gen Core i processors!
# This script is required to run in an PowerShell session with administrator access.
#
# All you need to do is open PowerShell as Administrator, copy this file and paste to
# that PowerShell window and you're done upgrading!
$upgraded_cpu_names = @{
"13600KF" = "14600KF";
"13600K" = "14600K";
"13900KF" = "14900KF";
@jacky9813
jacky9813 / azurerm_error.log
Created March 6, 2024 10:33
Terraform error log from AzureRM
2024-03-06T18:30:30.003+0800 [ERROR] provider.terraform-provider-azurerm_v3.93.0_x5: Response contains error diagnostic:
diagnostic_summary=
| deleting Load Balancer Backend Address Pool (Subscription: "<REDACTED>"
| Resource Group Name: "<REDACTED>"
| Load Balancer Name: "example-lb"
| Backend Address Pool Name: "example-lb-be-address-pool"): performing LoadBalancerBackendAddressPoolsDelete: unexpected status 400 with error: LoadBalancerBackendAddressPoolInUseByVirtualMachineScaleSet: Cannot remove backend address pool example-lb-be-address-pool from load balancer since it is in use by virtual machine scale set /subscriptions/<REDACTED>/resourceGroups/<REDACTED>/providers/Microsoft.Compute/virtualMachineScaleSets/example-vmss.
tf_provider_addr=provider tf_resource_type=azurerm_lb_backend_address_pool @module=sdk.proto diagnostic_detail="" tf_req_id=afb22b8f-5f14-9af2-02f4-e818d11f69c4 diagnostic_severity=ERROR @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagn