Skip to content

Instantly share code, notes, and snippets.

View alanljj's full-sized avatar
🎯
Focusing

ITGeeker alanljj

🎯
Focusing
View GitHub Profile
@alanljj
alanljj / user-rule.txt
Created August 30, 2016 08:40
Shadowsocks 用户自定义翻墙规则
@@||ithome.com
||jsfiddle.net
||go.com
||cloudfront.net
||live.com
||coursera.org
||fluidui.com
@@||temp.im
||uxpin.com
||slack.com
@alanljj
alanljj / .stglobalignore
Created September 6, 2017 02:21 — forked from jult/.stglobalignore
syncthing ignore file(s) .stglobalignore and .stignore
// .stglobalignore
// Incomplete Downloads and such.
// For now, these prevent Syncthing from transferring data that's
// going to be thrown out anyway once the download is finished and the
// file is renamed. Stuff may alter when Syncthing gets smarter.
//
// Firefox downloads and other things
*.part
// Chrom(ium|e) downloads
@alanljj
alanljj / re.py
Created November 11, 2017 14:41 — forked from dervn/re.py
Python中过滤HTML标签的函数
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str
@alanljj
alanljj / postgres
Created January 15, 2018 02:32 — forked from mmrwoods/postgres
Postgres maintenance crontab file
# dump all databases once every 24 hours
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night)
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze"
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet"
# re-index all databases once a week
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"'
@alanljj
alanljj / mysql-docker.sh
Created February 28, 2018 09:50 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@alanljj
alanljj / lychee
Created March 15, 2018 06:33 — forked from ottonet/lychee
lychee nginx config
server {
server_name my.lychee.site;
listen 80;
root /var/www/my.lychee.site/htdocs;
access_log /var/www/my.lychee.site/logs/access.log;
error_log /var/www/my.lychee.site/logs/error.log;
index index.php index.html;
@alanljj
alanljj / wp-permissions-script
Created May 16, 2018 02:47 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@alanljj
alanljj / xml_rpc.py
Created May 22, 2019 07:37 — forked from ilyasProgrammer/xml_rpc.py
Odoo xml rpc example
import xmlrpclib
from datetime import datetime
# url = "http://localhost:8069"
# db = "RAJO"
# username = 'a'
# password = 'a'
url = "https://erp.atlantis-kw.com"
db = "RAJO_TEST"
username = 'api'
@alanljj
alanljj / iptv.tvfix.org.m3u8.txt
Created February 3, 2022 17:48 — forked from woodongwong/iptv.tvfix.org.m3u8.txt
iptv.tvfix.org(电视侠)直播源
央视高清
CCTV-4K(色彩准确) : http://iptv.tvfix.org/hls/cctv4k.m3u8
CCTV-1高清 : http://iptv.tvfix.org/hls/cctv1hd.m3u8
CCTV-1香港版高清 : http://iptv.tvfix.org/hls/cctv1hdhk.m3u8
CCTV-2高清 : http://iptv.tvfix.org/hls/cctv2hd.m3u8
CCTV-3高清 : http://iptv.tvfix.org/hls/cctv3hd.m3u8
CCTV-4高清 : http://iptv.tvfix.org/hls/cctv4hd.m3u8
CCTV-5高清 : http://iptv.tvfix.org/hls/cctv5hd.m3u8
CCTV-5+高清 : http://iptv.tvfix.org/hls/cctv5phd.m3u8
CCTV-6高清 : http://iptv.tvfix.org/hls/cctv6hd.m3u8
@alanljj
alanljj / README.md
Created December 31, 2022 14:12 — forked from GermanAizek/README.md
Openwrt - Extend disk space for apps

Instructions for expanding space for openwrt programs. In most cases, 2Gb will be enough. We will install the necessary packages for working with USB devices

root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install nano kmod-usb-core block-mount kmod-fs-ext4 kmod-usb-storage-extras e2fsprogs blkid

After install fdisk package