Skip to content

Instantly share code, notes, and snippets.

@herryliq
herryliq / main.yml
Created February 22, 2017 06:43 — forked from rothgar/main.yml
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@herryliq
herryliq / gist:1fed2ff006f16379cbbd26bad7c1fcd5
Created March 29, 2017 06:47 — forked from allex/gist:11203573
Ubuntu 安装中文字体

环境 (Environment)

版本:Ubuntu 14.04 LTS 默认语言:English(United States)

安装 (Setup)

Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。

@herryliq
herryliq / codemirror-example.html
Created May 18, 2017 13:55 — forked from drmalex07/codemirror-example.html
Example use of CodeMirror as javascript code editor. #javascript #javascript-editor #codemirror
<html lang="en">
<head>
<title>CodeMirror in Action</title>
<script src="js/vendor/jquery-1.9.1.js"></script>
<!-- More examples at http://codemirror.net/demo/ -->
<!-- add basic CodeMirror functionality -->
<script src="js/vendor/codemirror-4.1/lib/codemirror.js" type="text/javascript" charset="utf-8"></script>
@herryliq
herryliq / update-dnsmasq-from-gfwlist.py
Created July 29, 2017 05:39 — forked from rambolee/update-dnsmasq-from-gfwlist.py
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@herryliq
herryliq / virtual_keyboard
Created April 13, 2020 23:06 — forked from arunreddy/virtual_keyboard
QT Virtualkeyboard
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.Qt import Qt
from PyQt5.QtWidgets import *
class VKQLineEdit(QLineEdit):
def __init__(self, parent=None, name=None, mainWindowObj=None):
super(VKQLineEdit, self).__init__(parent)
@herryliq
herryliq / myqueue.py
Created June 14, 2020 04:44 — forked from bofm/myqueue.py
Enhanced Python queue with additional .getall(), .clear() and .close() methods.
import threading
from queue import Empty, Full
class QueueClosed(Exception):
pass
class MyQueue():
@herryliq
herryliq / gstreamer.md
Created October 17, 2020 15:04 — forked from nebgnahz/gstreamer.md
Collections of GStreamer usages

Most GStreamer examples found online are either for Linux or for gstreamer 0.10.

This particular release note seems to have covered important changes, such as:

  • ffmpegcolorspace => videoconvert
  • ffmpeg => libav

Applying -v will print out useful information. And most importantly the negotiation results.

@herryliq
herryliq / README.md
Created October 17, 2020 15:05 — forked from Samfox2/README.md
GStreamer stream to HTML5

Description

[Server] GStreamer ---> HTML [Client]

Require

  • gstreamer-1.x
  • Browser which supports video tag of HTML5

debian

@herryliq
herryliq / receipt5.md
Created October 18, 2020 00:02
How to make a Raspberry Pi an RTSP streamer and how to consume this?

RTSP streaming from Raspberry PI

Introduction

This gist describes the necessary software installation steps for a Raspberry PI in order to enable the PI's camera to act as an external camera for the Dragonfly Java application. This gist shows, how to make a Raspberry PI an RTSP streaming server. The resulting feed can then be used as input for the Dragonfly Java app or the Accuware Dragonfly Demo - Calibration Mode server. The RTSP server on the Raspberry PI must be made publicly available, if calibration is a requirement.

Prerequisites

@herryliq
herryliq / open_momo.rst
Created October 19, 2020 13:45 — forked from voluntas/open_momo.rst
OpenMomo プロジェクト