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

@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
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@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.

@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))
@hwdsl2
hwdsl2 / .MOVED.md
Last active April 18, 2024 01:37
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
@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.

@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':