Skip to content

Instantly share code, notes, and snippets.

@allenyllee
allenyllee / install_tools.sh
Last active April 14, 2024 21:31
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
@QuantumGhost
QuantumGhost / example.puml
Last active March 23, 2024 22:39
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@TheConstructor
TheConstructor / inetd.conf
Last active May 22, 2020 10:42
Postfix SRS-support under Debian "Wheezy". Using http://packages.debian.org/wheezy/srs, http://packages.debian.org/wheezy/liburi-perl and http://packages.debian.org/wheezy/openbsd-inetd File paths are: - /opt/srs/srs-encode.sh - /opt/srs/srs-decode.sh - /etc/inetd.conf (should be appended to) - /etc/postfix/main.cf (should be appended to) - /etc…
# SRS
127.0.0.1:10001 stream tcp nowait root /opt/srs/srs-encode.sh /opt/srs/srs-encode.sh
127.0.0.1:10002 stream tcp nowait root /opt/srs/srs-decode.sh /opt/srs/srs-decode.sh
@thinkhy
thinkhy / tedSubtitle.pl
Last active October 6, 2017 14:59
Get subtitle for TED video
#!/usr/local/bin/perl
################################################################################
# File: tedSubtitle.pl
# Desscription: Get ted talk's subtitle from TED.com
# and convert subtitle of TED video to SRT format(SubRip Subtitle File)
# Usage: ted.pl URL languageCode output.src
# Creator: Thinkhy
# Date: 2011.04.30
# ChangeLog: 1 Add language code. [thinkhy 2011.05.06]
# 2 Read advertisement time from the parameter of introDuration in html.