Skip to content

Instantly share code, notes, and snippets.

View fanyang89's full-sized avatar
🥥

fanyang fanyang89

🥥
  • SmartX
  • 12:06 (UTC +08:00)
View GitHub Profile
@jasonboukheir
jasonboukheir / git
Last active March 29, 2024 18:12
git when in unix, git.exe when in wsl
#!/bin/sh
if pwd | grep /mnt/c > /dev/null; then
exec git.exe "$@"
else
exec /usr/bin/git "$@"
fi
#!/usr/bin/env python
import yaml
import sys
for manifest in yaml.load_all(sys.stdin):
if manifest:
if 'metadata' in manifest and 'namespace' not in manifest['metadata']:
manifest['metadata']['namespace'] = sys.argv[1]
print '---'
@ihipop
ihipop / frp systemd.md
Last active December 26, 2023 05:13
FRP systemd 启动脚本 FRP systemd init config
@styblope
styblope / docker-api-port.md
Last active May 17, 2024 07:03
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@alexcreek
alexcreek / backup.sh
Last active May 18, 2023 13:59
simple backup script using rsync + tar
#!/bin/bash
TODAY=$(date +%Y%m%d)
TARGETS=( '/etc' '/home' '/root' '/var/www' )
BACKUP_ROOT='/backups'
BACKUP_DIR="${BACKUP_ROOT}/${TODAY}"
echo "$(date +%D" "%r): Beginning backup"
mkdir -p $BACKUP_DIR
for i in ${TARGETS[@]}; do