Skip to content

Instantly share code, notes, and snippets.

View syhily's full-sized avatar

Yufan Sheng syhily

View GitHub Profile
@lawrenceching
lawrenceching / install-frp-as-systemd-service.sh
Last active July 5, 2024 02:23
Install frp as systemd service
#!/bin/bash
# Update on 2024/05/29
# 1. use wget to fetch latest frp version when curl was not installed
# 2. Remind users that frp will be run in non-root user
# 3. Add CI
#
# Update on 2024/04/13
# 1. Improved OS compatibility: try wget and then curl for downloading files.
#
# Update on 2024/01/26
@ShikiSuen
ShikiSuen / RemovingSTHeiti.sh
Last active August 6, 2019 03:39
STHeiti Cleaner.
#!/bin/bash
# At least works with macOS 10.12 - 10.14. Do not use this with macOS 10.11 and earlier.
# RUN THIS SCRIPT UNDER RECOVERY MODE.
# !! REMEMBER to change the next line to make sure it fits your actural system volume label.
cd "/Volumes/Macintosh HD/"
# Applying International Text Styles to Japanese GUI of current iTunes.
cp "Applications/iTunes.app/Contents/Resources/English.lproj/TextStyles.plist" "Applications/iTunes.app/Contents/Resources/Japanese.lproj/TextStyles.plist"
cd "system"
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active June 15, 2024 20:25
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@wu-sheng
wu-sheng / AppendToBootstrapClassLoaderSearch.java
Last active March 7, 2024 06:14
byte-buddy appendToBootstrapClassLoaderSearch, and jdk instrumentation
/**
* All codes from stagemonitor apm, which gives a example about how to use instrumentation::appendToBootstrapClassLoaderSearch
* This will be very useful for instrument some class in rt.jar
*/
private static boolean initInstrumentation() {
try {
/**
* this try-catch block shows two ways about instrumentation.
* ref issue: https://github.com/raphw/byte-buddy/issues/237
*/
@gnachman
gnachman / iterm.scpt
Last active April 27, 2018 05:44
Fix docker quickstart terminal for iTerm2 version 2.9 and later
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
@skanjo
skanjo / install-oracle-jdk-centos.md
Last active June 21, 2018 18:35
Install Oracle JDK on CentOS

Install Oracle Java 8 JDK

Note: If you would like to install a different release of Oracle Java 8 JDK, go to the Oracle Java 8 JDK Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 8 JDK RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.rpm"

Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

@kitzy
kitzy / deleteMacKeeper.sh
Created February 9, 2015 21:58
Delete MacKeeper and JustCloud
#!/bin/bash
# This program will uninstall MacKeeper and JustCloud
#################
### Variables ###
#################
# Items at the system level to be removed
systemItems=(
// -*- coding: utf-8 -*-
// ==UserScript==
// @name They are all 17 years old
// @author HIRATA Yasuyuki <yasu@asuka.net>
// @namespace http://yasu.asuka.net/
// @version 1.1.0
// @include http://www.google.tld/search?*
// @include https://www.google.tld/search?*
// @released 2013-04-23
// @updated 2013-04-30
@ansell
ansell / gist:1141550
Created August 12, 2011 06:06
Maven: Compiling and installing test jar without running them
mvn -DskipTests test-compile jar:test-jar install
the similar command below, will not compile or package the jar file (if you are using the surefire plugin) so, don't use it if you want to distribute the test jar file without running the tests
mvn -Dmaven.test.skip test-compile jar:test-jar install