Skip to content

Instantly share code, notes, and snippets.

View renfei's full-sized avatar
:octocat:
Java Developer, My website: https://blog.renfei.net

Ren Fei renfei

:octocat:
Java Developer, My website: https://blog.renfei.net
View GitHub Profile
@renfei
renfei / close.sh
Created September 28, 2025 12:30
Command to close Ledger's Solana token account and recover deposit in macOS
#!/bin/bash
# Get the public key
# Output my public key: ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r
solana-keygen pubkey 'usb://ledger?key=0'
# View the token account list
spl-token accounts --owner ApqJpFXgNnW4Cw8f8fh5sDaz1fYjqiYmWmERaAZTPM7r
# Close the specified token account
@renfei
renfei / application-standalone.properties
Created September 4, 2024 01:54
CAS的AD域集成配置
cas.authn.accept.enabled=false
cas.server.name=https://sso.iresp.com:8443
cas.server.prefix=${cas.server.name}/cas
logging.config=file:/etc/cas/config/log4j2.xml
cas.authn.ldap[0].order=0
cas.authn.ldap[0].name=Active Directory
cas.authn.ldap[0].type=AUTHENTICATED
cas.authn.ldap[0].use-start-tls=false
cas.authn.ldap[0].subtree-search=true
# cas.authn.ldap[0].search-filter=CN={user}
@renfei
renfei / README.md
Created April 23, 2024 07:13
DockerHub国内镜像源

DockerHub国内镜像源

设置以后需要重启 docker

sudo systemctl daemon-reload
sudo systemctl restart docker
@renfei
renfei / fetch.sh
Created April 23, 2024 02:03
Fetch from OCI registry (ghcr.io)
#!/bin/sh
# Get Token
curl -u renfei:{password} https://ghcr.io/token\?scope\=repository:renfei/renfeid:pull
# Get manifests
curl "https://ghcr.io/v2/renfei/renfeid/manifests/latest" -H "Authorization: Bearer {TOKEN}"
# Get blobs
curl https://ghcr.io/v2/renfei/renfeid/blobs/sha256:0f3320e4e2ae41973a279c466eba6f7af49750691a7d55baabde5b47c635660f -H "Authorization: Bearer {TOKEN}" -v
@renfei
renfei / fastcgi.conf
Created April 2, 2023 08:16
Nginx Full Example Configuration
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

Keybase proof

I hereby claim:

  • I am renfei on github.
  • I am renfei (https://keybase.io/renfei) on keybase.
  • I have a public key whose fingerprint is 626D 0939 A288 EF86 929F 61F9 9648 DC9A 0723 2FA5

To claim this, I am signing this object:

@renfei
renfei / BubbleSort.java
Last active March 15, 2022 08:11
Java学习记录
/**
* 冒泡排序
*/
static class BubbleSort {
public static void main(String[] args) {
int[] arr = new int[]{1, 3, 5, 0, 7, -8, 4, 1, 8, 9, 12, 2};
for (int i = 0; i < arr.length - 1; i++) {
for (int j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
// 如果左侧的比右侧的大,那么交换
@renfei
renfei / display-dependency-updates
Created November 24, 2021 11:59
maven查看本项目是否有更新的版本
mvn versions:display-dependency-updates
@renfei
renfei / AuthorizationFilter.java
Created November 30, 2020 13:58
将authenticationToken填充到安全上下文
Object user = null;
Object password = null;
String[] authorities = null;
// 将用户信息和权限填充 到用户身份token对象中
UsernamePasswordAuthenticationToken authenticationToken
= new UsernamePasswordAuthenticationToken(user, password, AuthorityUtils.createAuthorityList(authorities));
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(httpServletRequest));
// 将authenticationToken填充到安全上下文
SecurityContextHolder.getContext().setAuthentication(authenticationToken);