Skip to content

Instantly share code, notes, and snippets.

View sixg0000d's full-sized avatar
🌴
On vacation

sixg0000d sixg0000d

🌴
On vacation
View GitHub Profile
@sixg0000d
sixg0000d / rest-go-envs.fish
Last active September 8, 2021 13:35
Rest all of go environment variables
#!/usr/bin/fish
for e in (go env | awk -F '=' '{ print $1 }')
go env -u $e
end
@sixg0000d
sixg0000d / fish-parallel.fish
Created May 20, 2021 14:11
fish 多线程执行命令的方法
#!/usr/bin/fish
# thread nums
set num 10
for i in (seq $num)
echo $num
end | xargs -L 1 -P $num sh -c '<command you want to run>'
#!/usr/bin/fish
switch (id -u)
case 0
dnf install -y xmlstarlet
case "*"
sudo dnf install -y xmlstarlet
end
set goog_json (curl -sL https://www.gstatic.com/ipranges/goog.json | string collect)
@sixg0000d
sixg0000d / screenshots-cleanup.service
Last active March 28, 2024 15:09
screenshots cleanup
[Unit]
Description=Cleaning screenshot pictures
[Service]
Type=oneshot
# ExecStart=/usr/bin/find 'Pictures' -name 'Screenshot_[0-9]*_[0-9]*.png' -delete
ExecStart=/usr/bin/find '图片' -name 'Screenshot_[0-9]*_[0-9]*.png' -delete
[Install]
WantedBy=graphical.target
@sixg0000d
sixg0000d / nginx.te
Last active March 28, 2024 15:06
v2ray confdir with domain socket under SELinux
module nginx 1.0;
require {
type unconfined_service_t;
type var_t;
type var_run_t;
type http_port_t;
type httpd_t;
class process setrlimit;
@sixg0000d
sixg0000d / init-server.sh
Last active February 3, 2021 23:34
Initial server which use dnf
#!/bin/bash
EXTRA_PACKAGES=${EXTRA_PACKAGES:-"tar wget vim rpmconf sudo bind-utils fish sshguard jq"}
NEW_SSH_PORT=${NEW_PORT:-"$(shuf -i 10000-65535 -n 1)"}
function check_package_management() {
if command -v dnf >/dev/null; then
echo "package management: dnf"
pm=dnf
pm_install='dnf -y install'
@sixg0000d
sixg0000d / v2ray-restart.sh
Last active April 11, 2021 03:39
certbot hook script for v2ray
#!/bin/bash
chown -R v2ray:v2ray /etc/letsencrypt/ && systemctl restart v2ray.service
@sixg0000d
sixg0000d / env_setup.sh
Last active December 8, 2022 17:55 — forked from axxx007xxxz/Setup Android build environment on Fedora
This one is for Fedora 32 to build LineageOS 17.1
#!/bin/bash
if [ $UID != "0" ]; then
echo "ERROR: You must run this script as root!"
exit 1
fi
dnf install \
@development-tools \
ImageMagick-devel \
ImageMagick-c++-devel \