Skip to content

Instantly share code, notes, and snippets.

View Set-ScreenResolution.ps1
param (
[Parameter(Mandatory=$true,
Position = 0)]
[int]
$Width,
[Parameter(Mandatory=$true,
Position = 1)]
[int]
@Jimmy-Xu
Jimmy-Xu / right_key_run_cmd.reg
Created Sep 13, 2021 — forked from aqzlpm11/right_key_run_cmd.reg
鼠标右键打开命令行cmd(管理员身份)
View right_key_run_cmd.reg
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Open command window here as Administrator"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
View reset-terminal-services.ps1
## This Script is intended to be used for Querying remaining time and resetting Terminal Server (RDS) Grace Licensing Period to Default 120 Days.
## Developed by Prakash Kumar (prakash82x@gmail.com) May 28th 2016
## www.adminthing.blogspot.com
## Disclaimer: Please test this script in your test environment before executing on any production server.
## Author will not be responsible for any misuse/damage caused by using it.
Clear-Host
$ErrorActionPreference = "SilentlyContinue"
## Display current Status of remaining days from Grace period.
@Jimmy-Xu
Jimmy-Xu / gist:0712b073c767f300acd73e78c870f378
Created Nov 23, 2020 — forked from chrisdone/gist:02e165a0004be33734ac2334f215380e
Build and run minimal Linux / Busybox systems in Qemu
View gist:0712b073c767f300acd73e78c870f378

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@Jimmy-Xu
Jimmy-Xu / tun2socks_proxy_foo.bash
Created Mar 21, 2020 — forked from rsanden/tun2socks_proxy_foo.bash
tun2socks TCP+UDP user-wide proxy through shadowsocks and udpgw
View tun2socks_proxy_foo.bash
#--- Build tun2socks and udpgw (as the user who will use the proxy) ---
mkdir -p $HOME/src
cd $HOME/src
git clone "https://github.com/ambrop72/badvpn"
cd badvpn
mkdir -p build
cd build
export OUTDIR=$PWD
export SRCDIR=$(dirname $PWD)
@Jimmy-Xu
Jimmy-Xu / logrus_hooks.go
Created May 22, 2019 — forked from miguelmota/logrus_hooks.go
Golang Logrus show filename and line number
View logrus_hooks.go
package logger
import (
"fmt"
"path"
"runtime"
"github.com/sirupsen/logrus"
)
View Simple vsock setup for QEMU.md

Simple vsock setup for QEMU

Configuration

Host Kernel: rawhide 4.13.0-0.rc6.git4.2.fc28.x86_64 (on Fedora 24)

QEMU is mainline built from sources: QEMU emulator version 2.10.50 (v2.10.0-105-g223cd0e)

Guest: clear-17460-kvm.img (which has vsock support)

@Jimmy-Xu
Jimmy-Xu / ssh_config
Created Apr 16, 2019 — forked from rbenaley/ssh_config
GitHub ssh access via HTTP Proxy
View ssh_config
host github.com
user git
hostname ssh.github.com
port 443
proxycommand socat - PROXY:<hostname>:%h:%p,proxyport=<port>
@Jimmy-Xu
Jimmy-Xu / yamux-exmaple.go
Created Apr 12, 2019 — forked from fatih/yamux-exmaple.go
A simple working yamux example
View yamux-exmaple.go
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/hashicorp/yamux"
)
View gist:d7cdde841f93ccdaa28b992d86ef80c0
package main
import (
"fmt"
"log"
"time"
"golang.org/x/sys/windows/registry"
)