Skip to content

Instantly share code, notes, and snippets.

View garden4hu's full-sized avatar
🌴
On vacation

hu.peili garden4hu

🌴
On vacation
View GitHub Profile
@garden4hu
garden4hu / installing_devtoolset8_cent6.md
Created May 9, 2023 05:31
install devtoolset-8/9 in centos 6.5

how to install devtoolset7/8/9 in centos6

Note: this isn't an official solution.

install centos-release-scl-rh

## install scl-rh repo
yum install centos-release-scl-rh
@garden4hu
garden4hu / enable_coredump.md
Created March 23, 2023 08:15
enable core dump on Linux

enable core dump

## set the limit size of core
sudo echo "ulimit -c unlimited" >> /etc/profile

## source to active
source /etc/profile

## set core file name pattern and saving path
@garden4hu
garden4hu / tweak_linux.md
Created February 20, 2023 10:01
linux note

添加用户到 root group

 ## for example: user dev
 usermod -g root dev  # -g means change the dev's primiry group to group root
 ## you can add the dev to other group by option -aG
 ## for example, you can add the user dev to group plugdev by:
 ## usermod -aG plugdev dev
 
@garden4hu
garden4hu / certbot_note.md
Last active February 11, 2023 15:41
certbot note

记录使用 dns update ssl 证书的几个命令

在 Ubuntu 下

install certbot and certbot-dns-cloudflare

snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo snap install certbot-dns-cloudflare
sudo snap set certbot trust-plugin-with-root=ok
@garden4hu
garden4hu / ff_build.sh
Created February 7, 2023 09:27
build ffmpeg from source on Ubuntu
#!/usr/bin/env bash
#################################### README ####################################
# This script follows the guidance of FFMPEG(https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu).
# It works will on Ubuntu22.04. It may works on other version of Ubuntu because that I didn't check it.
# This script mods some parameters of building command,(for example the vmaf's bindir). So you may pay
# attention to VMAF.
################################################################################
@garden4hu
garden4hu / trojan.sh
Last active October 15, 2022 10:22
to install trojan-go on Ubuntu
#!/usr/bin/env bash
## 检查 trojan更新,并强制更新
## 安装 trojan
## 卸载 trojan
MACHINE='amd64'
RELEASE_VERSION="v0.10.6"
#! /bin/bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
cleanup() {
trap - SIGINT SIGTERM ERR EXIT
# script cleanup here
}
# jdk version is jdk-1.8
@garden4hu
garden4hu / tuic-install.sh
Last active October 22, 2022 14:41
tuic-install.sh
#!/usr/bin/env bash
# modifed from https://github.com/v2fly/fhs-install-v2ray/blob/master/install-release.sh
# https://github.com/HyNetwork/hysteria/blob/master/install_server.sh
# You can set this variable whatever you want in shell session right before running this script by issuing:
# export JSON_PATH='/usr/local/etc/tuic'
JSON_PATH=${JSON_PATH:-/etc/tuic}
curl() {
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
}
@garden4hu
garden4hu / set_windows_vc_env.ps1
Last active August 18, 2022 17:55
introduce the envrionment variable of developer Command prompt of VS to powershell prompt
## Current powershell will check the VisualStudio installion and Windows SDK version
## If they are OK, the VC environment variable will set to current process of command line
### this Script allow you set the vcvarsall environment variable into your current terminal process.
class VSInfo {
[string]$version
[string]$installPath
[string]$edition
}
@garden4hu
garden4hu / gist:a057ae837481dba45cff98f3cdf2d53e
Created July 17, 2022 08:06 — forked from lsauer/gist:2834199
Windows Environment Variables / PATH variables
//www.lsauer.com 2012
//author: Microsoft Inc.
//Type: tab-separated flatfile / datatable
Variable Type Description
%ALLUSERSPROFILE% Local Returns the location of the All Users Profile.
%APPDATA% Local Returns the location where applications store data by default.
%CD% Local Returns the current directory string.
%CMDCMDLINE% Local Returns the exact command line used to start the current Cmd.exe.
%CMDEXTVERSION% System Returns the version number of the current Command Processor Extensions.