Skip to content

Instantly share code, notes, and snippets.

View euyuil's full-sized avatar
🎯
Focusing

Liu Yue euyuil

🎯
Focusing
View GitHub Profile
@euyuil
euyuil / check-tls-versions.sh
Created February 18, 2021 05:07
HTTPS: Check supported TLS versions
#!/bin/bash
nmap --script ssl-enum-ciphers -p 443 www.google.com
@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 March 13, 2020 16:30
Setup script for GitLab Runner and other tools with China mirrors
#!/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 April 10, 2019 06:53
Gandi.net: Dynamic DNS crontab script
#!/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 March 24, 2019 14:08
Ubuntu 18.04: Set lock screen resolution the same as current user
#!/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
Last active November 23, 2022 13:53
Windows Command Line: Fix directory ownership
takeown /F NNNNNN /A /R /D Y /SKIPSL
icacls NNNNNN /reset /T /C /L
@euyuil
euyuil / SetupWinRM.ps1
Created October 21, 2016 10:18
WinRM: Enable WinRM and create an HTTPS listener with self-signed certificate.
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 March 1, 2019 04:50
Shadowsocks: Server installation and configuration on Ubuntu 14.04.
#!/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 October 21, 2016 10:19
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
euyuil / Update-Package-Reinstall.ps1
Created February 15, 2015 09:15
NuGet: reinstall all the packages
# 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