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
@junxy
junxy / post-WSL.md
Created Sep 24, 2019 — forked from noygal/post-WSL.md
Installing node via windows subsystem for linux
View post-WSL.md

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
junxy / ddns_dnspod.sh
Created Mar 24, 2019
ddns(dnspod.com) update script
View ddns_dnspod.sh
#!/bin/sh
# get public ip
myip=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo "My IP: $myip"
curl -X 'POST' 'https://api.dnspod.com/Record.Ddns' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode 'format=json' \
--data-urlencode 'sub_domain=xxx' \
@junxy
junxy / .wakeup
Last active Jun 14, 2018 — forked from ralph-hm/.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 README.md). 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
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"
@junxy
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
#//INSTRUCTIONS FOR DOWNLOADING AND INSTALLING JAVA WITHIN LINUX SYSTEMS AND UPDATING ALTERNATIVES FILES
#// rpm Installation Oracle JDK 1.8.0_151
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm
#// 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 "https://www.fastonosql.com/anonim_users_downloads/macosx/fastonosql-#{version}-x86_64.dmg"
appcast 'https://github.com/fastogt/fastonosql/releases.atom',
checkpoint: 'efc5b58bbfdeed9f028c65295b17774b0e5cb99548c160c91fa6a1085c3f13f4'
name 'FastoNoSQL'
homepage 'https://www.fastonosql.com/'
@junxy
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
junxy / batch_ping.ps1
Created Nov 25, 2016
批量ping,并输出ping不通的ip
View batch_ping.ps1
$stringlist =
'192.168.36.104',
'192.168.36.130',
'192.168.22.126',
'192.168.50.111',
'192.168.36.129',
'192.168.36.133'
# http://ilovepowershell.com/2010/04/13/powershell-how-to-ping-computers/
$ping = new-object system.net.networkinformation.ping
@junxy
junxy / Logstash-log4net-README.md
Last active May 29, 2019 — forked from dterziev/logstash.conf
Logstash 2.1.x config for log4net logs.
View Logstash-log4net-README.md
<!- .... ->
<log4net>    
    <appender name="RollingLogFileAppenderLogstash" type="log4net.Appender.RollingFileAppender">
      <encoding value="utf-8" />
      <!--该目录必需有 IIS用户 写权限-->
      <file value="X:/var/log/[app_name]/logfile.log" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
View gist:d4f34e9e90f95b7ec29ace904259ee96
{
"Id": "ActionTemplates-101",
"Name": "DownOutputScripts",
"Description": "Download file from url",
"ActionType": "Octopus.Script",
"Version": 4,
"Properties": {
"Octopus.Action.Package.NuGetFeedId": "feeds-builtin",
"Octopus.Action.Script.Syntax": "PowerShell",
"Octopus.Action.Script.ScriptSource": "Inline",
You can’t perform that action at this time.