Skip to content

Instantly share code, notes, and snippets.

View asound.state
state.PCH {
control.1 {
iface MIXER
name 'Front Mic Boost Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
View mul_threads.py
import threading
import urllib2
import time
def worker(num):
"""thread worker function"""
response = urllib2.urlopen('http://python.org/')
print 'Worker: %s' % num
return
View how-to-use-xserver-xorg-video-dummy.mk
# apt-get install
sudo apt-get update
# For ubuntu 14.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-trusty
# For ubuntu 16.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-willy
# Copy the xorg.conf to `/etc/X11/xorg.conf`.
wget -P /etc/X11 https://gist.githubusercontent.com/mangoliou/ba126832f2fb8f86cc5b956355346038/raw/b6ad063711226fdd6413189ad905943750d64fd8/xorg.conf
View xorg.conf
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# 1024x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 64.11 MHz
# Modeline "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync
# 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz
# Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
# 1368x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
# Modeline "1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync
@mangoliou
mangoliou / x11vnc-stack-smashing-detected-solution.mk
Last active Jan 23, 2021
x11vnc `stack smashing detected` solution.
View x11vnc-stack-smashing-detected-solution.mk
# Install x-related to compile x11vnc from source code.
sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
# Grep source code.
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
View system_docker_event.py
#!/usr/local/container-station/python/bin/python2.7
from __future__ import absolute_import, division, print_function, with_statement
# python lib
import os
import time
import socket
import logging
View build.sh
#!/bin/bash
while read line
do
IMAGE = $line
echo "$IMAGE\n"
done < projects.txt