Skip to content

Instantly share code, notes, and snippets.

@Wollw
Wollw / interrupt_example.c
Created April 14, 2012 00:17
AVR Timer Interrupt Examples
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdbool.h>
/*
* A global flag used to communicate between the Interrupt Service Routine
* and the main program. It has to be declared volatile or the compiler
* might optimize it out.
*/
volatile bool update = false;
@ck-on
ck-on / ocp.php
Last active May 18, 2024 22:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@isayme
isayme / v2ex_coin.py
Last active July 3, 2020 07:59
V2EX 每日登陆奖励自动获取脚本. 此脚本不再更新, 毕竟要依赖第三方pycurl库. 新版见: https://github.com/isayme/v2ex
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 此脚本不再更新, 毕竟要依赖第三方pycurl库.
# 重写的脚本不再依赖非标准库, 感兴趣的见: https://github.com/isayme/v2ex
import sys
import string
try:
import pycurl2 as pycurl
@damphat
damphat / apt-rdepends-tree
Last active July 6, 2024 07:46
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@patwonder
patwonder / baidu-tieba-image-scaling-enhancer.user.js
Last active January 8, 2023 14:48
百度贴吧图片缩放增强脚本 Baidu Tieba Image Scaling Enhancer
// ==UserScript==
// @id tieba.baidu.com-709c0fe7-e313-44bd-9dbd-752bbd80259d@patwonder@163.com
// @name 百度贴吧图片缩放增强脚本
// @version 0.78
// @namespace patwonder@163.com
// @author patwonder
// @description 增强百度贴吧图片缩放,看大图无需开新标签页。
// @updateURL https://gist.githubusercontent.com/patwonder/99835e0cece2ac9928ad/raw/baidu-tieba-image-scaling-enhancer.user.js
// @downloadURL https://gist.githubusercontent.com/patwonder/99835e0cece2ac9928ad/raw/baidu-tieba-image-scaling-enhancer.user.js
// @include /^https?://tieba\.baidu\.com/((f\?kz=.*)|(p/.*))/
@DraTeots
DraTeots / ComPort over Network.md
Last active July 13, 2024 13:54
ComPort over Network
  1. 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
  1. 安装dnsmasq 和pdnsd解决dns污染

DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd

@mondain
mondain / public-stun-list.txt
Last active July 25, 2024 15:19
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@mobzystems
mobzystems / 7-zip.psm1
Last active May 2, 2024 10:49
7-Zip commands for PowerShell
<#
Powershell Module 7-Zip - 7-Zip commands for PowerShell
The functions in this module call 7za.exe, the standAlone version of 7-zip to perform various tasks on 7-zip archives.
Place anywhere, together with 7za.exe and 7zsd.sfx. 7za.exe is required for all operations; 7zsd.sfx for creating self
extracting archives.
http://www.7-zip.org
Import-Module [Your path\]7-Zip
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin