Skip to content

Instantly share code, notes, and snippets.

Mr. Hsu junxy

Block or report user

Report or block junxy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aliyun-CentOS-Base.repo
# CentOS-Base.repo
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
if type pactl > /dev/null 2>&1 || type xvinfo > /dev/null 2>&1; then
# detect WSL host
if type systemd-detect-virt > /dev/null 2>&1 && test "$(systemd-detect-virt -c)" != wsl -a -e /etc/resolv.conf; then
WSL_HOST=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null)
# set DISPLAY if there is an X11 server running
junxy / Installing node via windows subsystem for linux

Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)

Windows just released the windows subsystem for linux feature to the public with its latest windows fall creator update, if you are not familiar with this feature it allows you to run linux binaries natively on windows - F.A.Q.

Enabling WSL

The feature is not enabled by default and you need to activate it, you can do it via powershell (with admin rights):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Or you can open: Control-Panel -> Programs -> Turn Windows feature on ro off, and click the "windows subsystem for linux (beta)" button.

junxy /
Created Mar 24, 2019
ddns( update script
# get public ip
myip=$(dig +short
echo "My IP: $myip"
curl -X 'POST' '' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode 'format=json' \
--data-urlencode 'sub_domain=xxx' \
junxy / .wakeup
Last active Jun 14, 2018 — forked from ralph089/.wakeup
Restarts Bluetooth Module on Mac OS X. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
View .wakeup
# Restart Bluetooth Module on Mac OS X
# Requires Blueutil to be installed:
log() {
echo "$@"
junxy / jdk1.8.0_151-install.txt
Last active Jan 3, 2019 — forked from jaydubb12/jdk1.8.0_151-install.txt
Oracle JAVA -JDK Installation & Configuration Script 1.8.0_151
View jdk1.8.0_151-install.txt
#// rpm Installation Oracle JDK 1.8.0_151
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"
#// installation command
#// -i = install
#// -n = non-interactive
#// -v = verbose
#// -h = The hash table is a feature of bash that prevents it from having to search $PATH every time you type a command by caching the results in memory.
View fastonosql.rb
cask 'fastonosql' do
version '1.10.0'
sha256 '38bf2c7b272040d8e25ec4cace4799c7a378bbf9e742192bff9d350e75d35292'
url "{version}-x86_64.dmg"
appcast '',
checkpoint: 'efc5b58bbfdeed9f028c65295b17774b0e5cb99548c160c91fa6a1085c3f13f4'
name 'FastoNoSQL'
homepage ''
junxy / CleanWindowTempCabFiles.ps1
Created Dec 2, 2016
清理 windows temp cab_* 临时文件? PS: 这些文件不断生成占用C盘空间,暂时没找到方法,删除也没发现有什么问题,只好先用脚本定期清理一下。
View CleanWindowTempCabFiles.ps1
Set-Location "C:\Windows\Temp"
Get-ChildItem -Filter "cab_*" | Where-Object {$_.length -gt 1 }
Get-ChildItem -Filter "cab_*" | Where-Object {$_.length -gt 1 } | Remove-Item -Force
Write-Host "done"
junxy / batch_ping.ps1
Created Nov 25, 2016
View batch_ping.ps1
$stringlist =
$ping = new-object
You can’t perform that action at this time.