Skip to content

Instantly share code, notes, and snippets.

View alanhg's full-sized avatar
⌨️
Focusing

Alan.He alanhg

⌨️
Focusing
View GitHub Profile
@alanhg
alanhg / code-server-install.sh
Last active October 11, 2022 04:07
code server install sh
# 安装code-server包,也可以使用官方脚本 https://raw.githubusercontent.com/coder/code-server/main/install.sh
VERSION=4.7.1
PORT=8090
mkdir -p ~/.local/lib ~/.local/bin
curl -fL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-linux-amd64.tar.gz \
| tar -C ~/.local/lib -xz
@alanhg
alanhg / install-package-certbot.sh
Last active October 6, 2022 06:58
install-package-certbot.sh
#!/bin/sh
# sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/alanhg/b861c85afa1887daa053ad90fa930453/raw/b9abe224631981fafd184de4b5b87d3fe12d3eaa/install-package-certbot.sh)"
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
APT_CMD=$(which apt)
PACKAGE=certbot
if [ ! -z $YUM_CMD ]; then
yum install -y $PACKAGE
echo "Uploading files to remote server...."
sshpass -p "xxx" scp -r ./build/** root@192.168.1.108:/var/www/mana
echo "File upload to remote server completed! ;)"
@alanhg
alanhg / install-package-lrzsz.sh
Last active July 16, 2022 08:41
install-package-lrzsz.sh / shell
#!/bin/sh
# sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/alanhg/6a299b815f4dd3d242abc16b8be6b861/raw/dbe1497208f1d968ed8b67cad09c596e35c5be9c/install-package-lrzsz.sh)"
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
APT_CMD=$(which apt)
PACKAGE=lrzsz
if [ ! -z $YUM_CMD ]; then
yum install -y $PACKAGE
@alanhg
alanhg / auto-review-jd.js
Created April 10, 2022 15:01
京东自动评论
/**
浏览器打开www.jd.com登录账号,按F12点击Console->复制下列代码->粘贴回车键坐等即可
*/
document.body.innerHTML = "";$("html").css("overflow","hidden");$("body").append('<div id="topTitle" style="padding:20px;display:block;font-size:48px;color:#FFFFFF;background-color:#e2231a;width:100%;text-align:center">京东自动评价JS脚本 </div><iframe src="https://club.jd.com/myJdcomments/myJdcomment.action?sort=0" style="width:99%;height:800px" id="JDifr"></iframe>');$("#J-global-toolbar").remove();let isFiveStar = true;$("#topTitle").click(function(){(isFiveStar = !isFiveStar) ? $("#topTitle").css("background-color","#e2231a"):$("#topTitle").css("background-color","#8B0000");});let pendingNum = 1;let waitSubmitIds;let curId = 0;let maxCurId = 0;$("#JDifr").load(function(){if($("#JDifr").attr("src").indexOf("sort") > 0){pendingNum = ($("#JDifr").contents().find("a.text:first").siblings().length>0 && $("#JDifr").contents().find("a.text:first").attr("href")=="?sort=0")?parseInt($("#JDifr").contents().find("a.text:first").next().text()):0;waitSubmitIds = $("#
@alanhg
alanhg / airdrop-share.scpt
Created December 14, 2021 04:38
airdrop-share.scpt
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
-- This script brings up the AirDrop dialog for the selected file(s) in Finder (window or desktop)
-- Isaac Nelson 17 Jan 2018
-- Vastly improved by implementing Aviral Bansal's fix for UI scripting slowness: https://stackoverflow.com/a/36370637/9278116
-- Updated 28 Mar 2018 to make it work in an Automator workflow
-- Updated 17 Dec 2019 to fix issue with comparison between parentPath and desktopPath
@alanhg
alanhg / uBlacklist.txt
Last active November 7, 2021 01:45
垃圾站点
*://www.coder.work/*
*://blog.csdn.net/*
*://stackoom.cot/*
*://www.jb51.net/*
@alanhg
alanhg / settings.xml
Created August 20, 2019 15:02
maven setting default config
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<id> central</id>
<name> Maven Repository Switchboard</name>
<layout> default</layout>
*://www.runoob.com/*
*://zhidao.baidu.com/*
*://www.cnblogs.com/*
*://blog.csdn.net/*
@alanhg
alanhg / multi-screen-init.sh
Created March 2, 2021 06:02
multi-screen-init
/usr/local/bin/displayplacer "id:FD965078-20C5-7F8A-3AE7-A0FE6C33C5C6 res:2560x1440 hz:60 color_depth:8 scaling:off origin:(0,0) degree:0" "id:EBE8E036-2C6E-9026-BEA4-F0D3A3F2DE71 res:1440x2560 hz:59 color_depth:8 scaling:off origin:(-1440,-1081) degree:90"