Skip to content

Instantly share code, notes, and snippets.

@ifduyue
ifduyue / public-dns-cn-servers-file.sh
Last active August 17, 2016 04:47
Generate dnsmasq servers-file, servers come from public-dns.info
curl -sSL http://public-dns.info/nameserver/cn.txt | perl -MList::Util=shuffle -e 'print shuffle<STDIN>' | head -n10 | xargs -L1 -I{} echo "server={}"
@ifduyue
ifduyue / beanstalkd.service
Last active March 1, 2023 11:36
Install beanstalkd on CentOS 7 / CentOS 8
[Unit]
Description=Beanstalkd is a simple, fast work queue
[Service]
User=nobody
Restart=always
RestartSec=500ms
ExecStart=/usr/local/bin/beanstalkd -b /var/lib/beanstalkd
LimitNOFILE=10240
@ifduyue
ifduyue / apt install docker-engine
Created October 14, 2015 09:08
Can't install docker-engine on Ubuntu 14.04 LTS
# apt-get install -f docker-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
@ifduyue
ifduyue / add-git-aliases.sh
Last active October 11, 2021 02:31
git aliases
#!/bin/bash
set -x
# common shortcuts
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.rb rebase
#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
# usage:
# git-large-files 500k
# git-large-files 0.5m
# git-large-files 5b
cat - << EOWARNING
WARNING: This script will fil up your left over disk space.
DO NOT RUN THIS WHEN YOUR VIRTUAL HD IS RAW!!!!!!
You should NOT do this on a running system.
This is purely for making vagrant boxes damn small.
Press Ctrl+C within the next 10 seconds if you want to abort!!
@ifduyue
ifduyue / changelog.txt
Last active February 26, 2020 08:18
The goods from okean.com
2020.02.19 1600 UTC
china
added: 103.148.174.0/23
2020.01.21 1702 UTC
china
added: 103.147.211.0/24
#coding: utf8
import re
import time
import datetime
import dateutil.tz
# Remember offset is in seconds west of UTC, but the timezone is in
# minutes east of UTC.
#!/bin/bash
# this will install everything as root, so take that into account before you run it
set -e
# need cmake, python development headers, ZLib and OpenSSL
sudo yum groupinstall "Development tools" -y
sudo yum install cmake zlib-devel openssl-devel http-parser-devel -y
root=`pwd`