This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# https://github.com/buke/openerp-web-import-chardet/blob/master/web_import_chardet/controllers/__init__.py | |
############################################################################## | |
# web_import_chardet | |
# Auto Detect Import File Encoding & Remove BOM Header In UTF8 File. | |
# Copyright 2012 wangbuke <wangbuke@gmail.com> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 颜文字欢呼 | |
yhuanhu (/≥▽≤/) | |
yhuanhu ヾ(o◕∀◕)ノ | |
yhuanhu ✪ω✪ | |
yhuanhu *★,°*\:.☆\( ̄▽ ̄)/$\:*.°★* | |
yhuanhu ヾ (o ° ω ° O ) ノ゙ | |
yhuanhu ╰(*°▽°*)╯ | |
yhuanhu (。◕ˇ∀ˇ◕) | |
yhuanhu o(*≧▽≦)ツ | |
yhuanhu ≖‿≖✧ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
where? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adjust the number of pre/post lines (-B and -A args) as needed: | |
tcpdump -n -S -s 0 -A 'tcp dst port 80' | grep -B3 -A10 "GET /url" | |
This lets you get the HTTP requests you want, on the box, without generating a huge PCAP file that you have to offload somewhere else. | |
Keep in mind, that the BPF filter is never exact, if there are a large number of packets flowing through any box, BPF can and will drop packets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redis-cli -p 6379 | |
redis 127.0.0.1:6379> SET visits 1 | |
OK | |
redis 127.0.0.1:6379> GET visits | |
"1" | |
redis 127.0.0.1:6379> INCR visits | |
(integer) 2 | |
redis 127.0.0.1:6379> exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP_LIST=("a" "b" "c") | |
for ip in ${IP_LIST[*]}; do | |
ping -c 6 $ip | |
echo " " | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://unix.stackexchange.com/questions/87432/ssh-to-private-ip | |
ssh -f -N -R 12345:localhost:22 remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hg serve --webdir-conf hgweb.cfg -p port_num | |
[paths] | |
path=dirname | |
[web] | |
allow_archive = bz2 gz | |
push_ssl = false | |
allow_push = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
find all solutions of n-order magic square | |
""" | |
import itertools | |
class Solver(object): | |
def __init__(self, n, square=None, magic_sum=None): |
OlderNewer