Skip to content

Instantly share code, notes, and snippets.

Avatar

Liu Lantao Lax

View GitHub Profile
@Lax
Lax / server-1.conf
Last active January 4, 2021 06:33
User-Agent based ACL - conditional redirecting rules
View server-1.conf
log_format client_ip "$remote_addr";
map $http_user_agent $whitelist_ua {
default 1;
"~*curl" 0;
}
server {
listen 80;
@Lax
Lax / vue.config.js
Last active June 23, 2019 09:47
vue.config.js for Vue+Electron App https://liulantao.com/electron-vuejs.html
View vue.config.js
const path = require("path");
module.exports = {
pages: {
index: "src/renderer/main.js"
},
chainWebpack: config => {
config.resolve.alias.set("@", path.resolve(__dirname, "src/renderer/"));
config.resolve.alias.set(
"@components",
@Lax
Lax / use-https-for-github.sh
Created June 15, 2019 17:30
Force git to use https:// instead of git:// and ssh://
View use-https-for-github.sh
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://github.com".insteadOf git://github.com
View Icecast-mp3.md

This is a quick set-up guide on how to install Icecast for Mp3 and Ogg streaming, sort of online radio. Tested on Debian Wheezy. Probably works on Ubuntu, etc. Icecast is a "server-like". It offers the HTTP URL/port through which end-users can play the media. However, Icecast itself does not serve the files. It must get its input from other "client-like" software. For example, Ices0 sends mp3 input to Icecast and then Icecast delivers to the end user. Similarly, Ices2 sends ogg input to Icecast and then Icecast delivers to the end user.

Set up icecast

Start by installing:

sudo apt-get install icecast2
@Lax
Lax / CHANGELOG.md
Created November 6, 2018 14:16
release notes template
View CHANGELOG.md

x.x.x Release Notes (yyyy-MM-dd)

New Features

  • None

Enhancements

  • None

Fixes

@Lax
Lax / docker-compose.yml
Created July 24, 2018 07:48
shadowsocks over kcptun quick setup
View docker-compose.yml
version: "3.2"
services:
shadowsocks:
image: centos
ports:
- 2048:2048
restart: always
command: bash -c "yum install python-setuptools -y && easy_install pip && pip install shadowsocks && ssserver -p 2048 -k ${PASSWORD:-DEFAULT_PASSWORD} -t 300 --fast-open --workers 3 -m aes-256-cfb --user nobody"
@Lax
Lax / nginx-signals.md
Created June 4, 2018 05:36
Ngins Signals
View nginx-signals.md

sudo nginx

# Start the server.  If it's already started you'll see
# a bunch of "bind" errors.  If you want to restart you
# should do a "-s quit" first.

sudo nginx -s stop

# Stop the server quickly.  (Sends the SIGTERM signal.)
@Lax
Lax / video-20180526.rst
Created May 26, 2018 11:47
about video setup
View video-20180526.rst
+--------+------+------------+
| public | Desc | Membership |
+========+======+============+
| | | |
+--------+------+------------+
| | | |
+--------+------+------------+
@Lax
Lax / Setup-Steps.md
Last active January 8, 2018 08:32
Confluent - Kafka setup
View Setup-Steps.md

Environments

Docker host name: localhost
Docker host ip: 192.168.0.98 - (macOS: `ifconfig en0 inet`; Linux: `/sbin/ifconfig  eth0`)
Zookeeper address: 192.168.0.98:2181
Kafka address: 192.168.0.98:9092
@Lax
Lax / com.example.jenkins.plist
Created December 14, 2017 16:54
Start jenkins slave agent on macOS. launchctl load -w com.example.jenkins.plist
View com.example.jenkins.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.ci</string>
<key>UserName</key>
<string>lax</string>
<key>ProgramArguments</key>
<array>