Skip to content

Instantly share code, notes, and snippets.

View liut's full-sized avatar
🎯
Focusing

Liut liut

🎯
Focusing
View GitHub Profile
@liut
liut / sdforge.servic
Last active May 31, 2024 09:28
stable-diffusion-webui-forge with user systemd
[Unit]
Description=Stable-diffusion Service
[Service]
Type=simple
WorkingDirectory=/home/user/systemd/
ExecStart=/home/user/systemd/sdforge.sh
[Install]
WantedBy=default.target
@liut
liut / install.sh
Created March 5, 2021 07:21 — forked from cloverstd/install.sh
install libtorrent and python binds on centos 7
yum install -y boost boost-devel
yum install -y make gcc gcc-c++ kernel-devel python-devel
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_10/libtorrent-rasterbar-1.0.10.tar.gz
tar zxvf libtorrent-rasterbar-1.0.10.tar.gz
cd libtorrent-rasterbar-1.0.10.tar.gz
./configure --disable-debug --with-boost-libdir=/usr/lib64 --disable-encryption --enable-python-binding
make && make install
export LD_LIBRARY_PATH=/usr/local/lib/
cd bindings/python
python setup.py build
@liut
liut / clash_redir_iptables.sh
Last active August 2, 2020 08:17
用于clash穿透模式的iptables规则,场景是树莓派做旁路由
#!/bin/sh
MY_PROXY_1 = 1.2.3.4
iptables -t nat -N CLASH
iptables -t nat -A CLASH -d 10.0.0.0/8 -j RETURN
iptables -t nat -A CLASH -d 127.0.0.0/8 -j RETURN
iptables -t nat -A CLASH -d 169.254.0.0/16 -j RETURN
iptables -t nat -A CLASH -d 172.16.0.0/12 -j RETURN
iptables -t nat -A CLASH -d 192.168.0.0/16 -j RETURN
@liut
liut / crawl.go
Last active January 25, 2021 09:46
crawl with goquery, fixes from http://blog.csdn.net/lamphp/article/details/52452226
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@liut
liut / CsvReader
Last active August 29, 2015 14:17
Csv Reader
<?PHP
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* CsvReader
*
* 按Iterator接口读取CSV格式的数据
*
* @package Lib
* @author liut
@liut
liut / php-locales
Created March 20, 2015 06:14
php locales
<?php
$arr = array(
'language'=>'en' ,
'script' =>'Hans' ,
'region' =>'CN',
'variant2'=>'rozaj' ,
'variant1'=>'nedis' ,
'private1'=>'prv1' ,
'private2'=>'prv2'