Skip to content

Instantly share code, notes, and snippets.

View 1dot75cm's full-sized avatar

1dot75cm

View GitHub Profile
@tvvocold
tvvocold / Copr 编译指南
Last active August 29, 2015 14:18
指南
<section data-background-transition='zoom' data-transition='concave' data-background='http://fdorg.qiniudn.com/galaxy-10996_1280.jpg' data-state='blackout'>
<h1><a href='http://copr.fdzh.org'>Copr</a> 编译指南</h1></br>
<h3> Build Once, Run Anywhere.</h3></br></br></br>
<aside>Tips:按 空格 或 点击>箭头 继续</aside>
</section>
<section data-transition='concave'>
<p> Copr 依赖 FAS 账户,如果您没有请点击 sign up 注册</p>
<img src="http://pic.fdzh.org/uploads/2015/04/20150403175611.png" style="width: 900px;">

Install OS X 10.10 Yosemite in VirtualBox

(本教程基于此 this pastebin 文档编写, 并且适合于 Yosemite 正式版)

(免责声明: 本教程旨在说明如何在 VirtualBox 中运行 Mac OS X 操作系统, 并且本系统仅供测试使用.)

Howto

import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
@iximiuz
iximiuz / flask_static_files_cache_invalidator.py
Last active October 28, 2019 18:56
Flask: add static file's cache invalidator param to URLs generated by url_for(). Blueprints aware.
""" Inspired by http://flask.pocoo.org/snippets/40/ """
app = Flask(__name__)
@app.url_defaults
def hashed_url_for_static_file(endpoint, values):
if 'static' == endpoint or endpoint.endswith('.static'):
filename = values.get('filename')
if filename:
if '.' in endpoint: # has higher priority
@mmoulton
mmoulton / README.md
Last active November 7, 2020 18:19
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.

@rdegges
rdegges / proxy_nginx.sh
Created April 11, 2011 05:30
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
@nak3
nak3 / mptcp_rpm_install.md
Last active October 26, 2021 08:58
mptcp kernel RPM package install instructions

Description

mptcp_kernel is the kernel package which built with mptcp (MultiPath TCP) function. The source code is hosted in github .

The RPM package is hosted on Fedora copr. It can be used on Fedora and CentOS (only x86_64) and their some versions..

####WARNING

This package is now still working in progress and being tested by Kenjiro Nakayama. Please don't use it in your production system. And this is not official repository and please take full responsibility for your actions.

@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@madjar
madjar / scrapper.py
Last active March 5, 2023 15:02
A example of scrapper using asyncio and aiohttp
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
@mrluanma
mrluanma / requirements.txt
Created September 4, 2012 14:40
Python 登录新浪微博(requests 真的比 urllib2 强了 2^^32 倍 pip install requests)
requests==2.4.3
rsa==3.1.4