Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Liu Yue euyuil

🎯
Focusing
  • Microsoft Corporation
  • Shanghai, China
View GitHub Profile
View plantuml-dfd.puml
@startuml
!define dfd_f storage
!define dfd_db database
!define dfd_io rectangle
left to right direction
skinparam {
defaultTextAlignment center
@euyuil
euyuil / setup.sh
Last active Mar 13, 2020
Setup script for GitLab Runner and other tools with China mirrors
View setup.sh
#!/bin/bash
# OS: Ubuntu 18.04
sudo apt-get update
sudo apt-get upgrade -y
# Reference: https://mirror.tuna.tsinghua.edu.cn/help/gitlab-runner/
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
sudo echo 'deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/ubuntu bionic main' > /etc/apt/sources.list.d/gitlab-runner.list
@euyuil
euyuil / gandi-ddns.sh
Last active Apr 10, 2019
Gandi.net: Dynamic DNS crontab script
View gandi-ddns.sh
#!/bin/bash
# https://doc.livedns.gandi.net/
# https://www.ipify.org/
APIKEY='YourKeyGoesHere'
DOMAIN='example.com'
NAME='@'
IPADDR=`curl -s https://api.ipify.org/`
@euyuil
euyuil / update-resolution.sh
Created Mar 24, 2019
Ubuntu 18.04: Set lock screen resolution the same as current user
View update-resolution.sh
#!/bin/bash
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
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
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
euyuil / install-and-configure-shadowsocks-server.sh
Last active Mar 1, 2019
Shadowsocks: Server installation and configuration on Ubuntu 14.04.
View install-and-configure-shadowsocks-server.sh
#!/bin/bash
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
euyuil / disable-alt-drag.sh
Last active Oct 21, 2016
Gnome: Change the shortcut to move window from Alt-Drag to Super-Drag.
View disable-alt-drag.sh
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
@euyuil
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
euyuil / undo-last-commit.sh
Created Nov 30, 2014
Git: undo last commit
View undo-last-commit.sh
# 这个还能保留上一次的更改。
git reset --soft HEAD^
# 这个不能保留上一次的更改。
git reset --hard HEAD^
You can’t perform that action at this time.