Skip to content

Instantly share code, notes, and snippets.


Liu Yue euyuil

  • Microsoft Corporation
  • Shanghai, China
View GitHub Profile
View plantuml-dfd.puml
!define dfd_f storage
!define dfd_db database
!define dfd_io rectangle
left to right direction
skinparam {
defaultTextAlignment center
euyuil /
Last active Mar 13, 2020
Setup script for GitLab Runner and other tools with China mirrors
# OS: Ubuntu 18.04
sudo apt-get update
sudo apt-get upgrade -y
# Reference:
curl 2> /dev/null | sudo apt-key add - &>/dev/null
sudo echo 'deb bionic main' > /etc/apt/sources.list.d/gitlab-runner.list
euyuil /
Last active Apr 10, 2019 Dynamic DNS crontab script
IPADDR=`curl -s`
euyuil /
Created Mar 24, 2019
Ubuntu 18.04: Set lock screen resolution the same as current user
cp ~/.config/monitors.xml /var/lib/gdm3/.config/
chmod 600 /var/lib/gdm3/.config/monitors.xml
chown gdm:gdm /var/lib/gdm3/.config/monitors.xml
euyuil / fixowner.bat
Created Jan 27, 2018
Windows Command Line: Fix directory ownership
View fixowner.bat
takeown /F NNNNNN /A /R /D Y
icacls NNNNNN /reset /T /C
euyuil / SetupWinRM.ps1
Created Oct 21, 2016
WinRM: Enable WinRM and create an HTTPS listener with self-signed certificate.
View SetupWinRM.ps1
Param ($DnsName)
$Cert = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName $DnsName -Verbose
$Password = ConvertTo-SecureString -String $DnsName -Force -AsPlainText -Verbose
Export-Certificate -Cert $Cert -FilePath .\$DnsName.cer -Verbose
Export-PfxCertificate -Cert $Cert -FilePath .\$DnsName.pfx -Password $Password -Verbose
$CertThumbprint = $Cert.Thumbprint
euyuil /
Last active Mar 1, 2019
Shadowsocks: Server installation and configuration on Ubuntu 14.04.
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get install -y python-gevent python-pip python-m2crypto supervisor
sudo pip install shadowsocks
sudo mkdir -p touch /etc/shadowsocks
euyuil /
Last active Oct 21, 2016
Gnome: Change the shortcut to move window from Alt-Drag to Super-Drag.
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
euyuil / Update-Package-Reinstall.ps1
Created Feb 15, 2015
NuGet: reinstall all the packages
View Update-Package-Reinstall.ps1
# If you want to reinstall the packages for a project
Update-Package -Reinstall -ProjectName Your.Project.Name
# If you want to reinstall the packages for a solution
Update-Package -Reinstall
euyuil /
Created Nov 30, 2014
Git: undo last commit
# 这个还能保留上一次的更改。
git reset --soft HEAD^
# 这个不能保留上一次的更改。
git reset --hard HEAD^
You can’t perform that action at this time.