Skip to content

Instantly share code, notes, and snippets.

Avatar
😂
Face With Tears of Joy...

Lixingcong lixingcong

😂
Face With Tears of Joy...
View GitHub Profile
@lixingcong
lixingcong / aria2.bat
Created Sep 12, 2016 — forked from aa65535/aria2.bat
Aria2的配置文件 & 启动脚本
View aria2.bat
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@lixingcong
lixingcong / aria2
Created Sep 13, 2016 — forked from andrzejressel/aria2
init.d file for aria2c daemon (debian)
View aria2
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c init script.
@lixingcong
lixingcong / probe.php
Created Sep 14, 2016 — forked from DrayChou/p.php
lnmp 中带的 php 探针
View probe.php
<?php
/* ----------------本探针基于YaHei.net探针------------------- */
error_reporting(0); //抑制所有错误信息
@header("content-Type: text/html; charset=utf-8"); //语言强制
ob_start();
$title = "雅黑PHP探针";
$version = "v0.4.2"; //版本号
define('HTTP_HOST', preg_replace('~^www\.~i', '', $_SERVER['HTTP_HOST']));
View color_bash_demo.sh
#!/bin/bash
useage() {
printf "\n\e[1;4mAscii Escape Code Helper Utility\e[m\n\n"
printf " \e[1mUseage:\e[m colors.sh [-|-b|-f|-bq|-fq|-?|?] [start] [end] [step]\n\n"
printf "The values for the first parameter may be one of the following:\n\n"
printf " \e[1m-\e[m Will result in the default output.\n"
printf " \e[1m-b\e[m This will display the 8 color version of this chart.\n"
printf " \e[1m-f\e[m This will display the 256 color version of this chart using foreground colors.\n"
printf " \e[1m-q\e[m This will display the 256 color version of this chart without the extra text.\n"
@lixingcong
lixingcong / README.md
Created Sep 16, 2016 — forked from smileart/README.md
My ZSH Theme — Agnoster Mod
View README.md

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@lixingcong
lixingcong / muse-lxc.zsh-theme
Last active Jun 5, 2021
zsh theme: muse-lxc
View muse-lxc.zsh-theme
#!/usr/bin/env zsh
# update: 2021-06-05
# source
# https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/muse.zsh-theme
# search all git colors
# grep -o "ZSH_THEME_GIT_[A-Z_]\+" ~/.oh-my-zsh/lib/git.zsh | sort | uniq
# bash color list
@lixingcong
lixingcong / title_change.js
Created Oct 24, 2016
change html tilte when switch over pages
View title_change.js
var this_title=document.title;
document.addEventListener('visibilitychange', function() {
document.title = document.hidden ? this_title+":你看不到我~": this_title;
});
@lixingcong
lixingcong / recursively_get_links.py
Last active Nov 8, 2016
recursively get web page links
View recursively_get_links.py
@lixingcong
lixingcong / demo_2.1.py
Last active Nov 19, 2016
《统计学习方法》例2.1
View demo_2.1.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time-stamp: < 1.py 2016-11-19 14:09:19 >
"""
对应《统计学习方法》李航课本的第2章“感知机”的例题2.1
"""
import os
# An example in that book, the training set and parameters' sizes are fixed
@lixingcong
lixingcong / chnroute_update.txt
Last active Sep 28, 2021
chinaroute路由表更新命令
View chnroute_update.txt
路由表使用cidrmerge进行合并
cat route.txt| cidrmerge > route_merged.txt
https://github.com/karlpilkington/cidrmerge
ipip.net中国大陆路由表(每两个月更新一次)
wget https://github.com/17mon/china_ip_list/raw/master/china_ip_list.txt -O /tmp/route.txt
ChinaRoute ipv4路由表
wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/route.txt