This blog is rated  R⃣ , viewer discretion is advised

为什么tg可以随便封OpenVPN

信息

信息

现查明,你公司擅自扩大国内因特网虚拟专用网业务覆盖范围,违反《电信业务经营许可管理办法》(工信部令 …

Posted

archive

/dev/tcp

马克一下。。。exec这个没想到shell里也可以用啊

exec 3<>/dev/tcp/www.google.com/80
echo -e "GET / HTTP/1.1\n\n">&3
cat <&3

简单的端口扫描:

$ for p in {1..1023}; do(echo …

Posted

archive

github多账户马甲之间ssh key切换

场景:有多个github账号,比如公司一个,私人一个。现在想在同一台主机上同时维护公司的和私人的repo

大家可能会尝试把一个 …

Posted

archive

context switching is expensive

用了好几个chrome的time tracking扩展,用来跟踪我上网都把时间浪费在哪些网站上了。

这几天的发现:

  1. 1/5的时间没有被跟踪到,也就 …

Posted

archive

retry alias for bash

This is what you do when you have a shitting Internet connection:

$ vim ~/.bash_aliases

function retry(){
  false;
  while [ $? -gt 0 ];
    do $@;
  done;
}

To rape your server, just retry ssh -o ConnectTimeout=1 blah@foobar

Shit just got working for now.

Posted

archive

被爆出翔了了

dump一个db的时候发现有个 INT 类型居然保存的数据是 20121126

问了下,对方说,就是这个样子设计的,方便用来比较日期

我这种老 …

Posted

archive

VoiceBunny

HN上看到这篇帖子 What Has Changed,觉得对未来很糟糕的样子。

特别是这一段:

the consumer web has matured. we are almost 20 years into the consumer web and we have large platforms that are …

Posted

archive

uWSGI features you want to abuse

按照这个帖子,挖个坑

现代网站架构一般不能缺这几个东西:

  • serialization tool like Protobuf, Apache Thrift, JSON, etc. 跨进程、服务器共享数据
  • Pub-sub system, or RPC system 远程 …

Posted

archive

HackRF这个碉堡了

以前感谢一位名叫lol的网友得到了两个RTL2832U dongle开始玩rtlsdr

这玩意的参数是:

  • 64MHz - 1700 MHz (50 - 2200 MHz also possible)
  • Sample rate: 3.2 MS/s
  • Resolution: 8 bits/sample
  • receive only …

Posted

archive

install uwsgi 1.4 on Ubuntu Lucid 10.04.2 LTS

Instasll new shit on legacy OS is always pain in the ass.

Uwsgi 1.4 includes some awesome new features using zeromq, but it's impossible to install directly using pip. So here's the patch

  1. Download libpgm 5.1.116. This library is multicast protocol blah used by zmq.
  2. dpkg -i …

Posted

archive

关于开源的一些杂念

几天前看到这个新闻

知名FreeBSD开发者、 Varnish web-server缓存作者Poul-Henning Kamp认为,开源软件的市集开发模式(见ESR的《大教堂和市集》)创造了一代 …

Posted

archive

All pointers point to Jeff Dean

微博上看到这个段子,赶快收集下来了。

  • During his own Google interview, Jeff Dean was asked the implications if P=NP were true. He said, "P = 0 or N = 1." Then, before the interviewer had even finished laughing, Jeff examined Google …

Posted

archive

tg搞的激光3D打印

前几天从CSK的微博看了这个视频

今天看到一个讨论:

发信人: i3721pp (noosa), 信区: Aero
标 题: 王华明的报告“航空高性能大型复杂整体构 …

Posted

archive

禅宗 vs 武士

突然觉得这个joke好经典

@法门寺释者慧:#禅宗公案#武士手握一条鱼到一休禅师房间说道:“咱打赌,我手中这鱼是死是活?”一休 …

Posted

archive

我擦,这生成器是要逆天了么

我去看了下,的确太强了

发信人: temporary (昙花一现), 信区: NetNovel
标 题: 网文自动化到这种程度了咩
发信站: 水木社区 (Thu Nov 8 15:32:29 2012), 站 …

Posted

archive

Astrid Tasks & To-do List review

I have a overal negative review on To-Do & GTD apps on android . Today I tried Astrid Tasks (com.timsu.astrid). It was a mess

  • Can't sort by subtask on web UI
  • app freeze and then popup a bullshit dialog saying hi.
  • synced 180+ crap from Google Tasks from previously uninstalled …

Posted

archive

UPnP/DLNA初步

玩了一下Intel UPnP Device Spy很好玩

让设备播放媒体很简单:

  1. 打开AVTransport
  2. 调用SetAVTransportURL() 参数URL是python -m SimpleHTTPServer然后随便指定了一个avi。
  3. 调用Play()

就OK了 …

Posted

archive

Miracast, DLNA

终于搞清楚了几个概念。

DLNA是一套基于UPnP的4层协议,基于HTTP+SOAP的,是Sony在2004年提出的。

有如下几个角色:

  • Digital Media Server (DMS) 存储内容 …

Posted

archive

fix bottle.py / wsgiref.simple_server slow

Running bottlepy with default server (wsgiref.simple_server) is always dog slow for me, after some digging I found that the fucking server is trying to resolve the IP address of 10.x.x.x, both the server and client, into hostnames so the fucking logger can 'properly' display them …

Posted

archive

FEC在网络传输中的应用

It is a bit different than your standard FEC. Traditionally, FEC works on a block (of bits/bytes) by block basis. You need to the entire block to decode the message. So the transmitter needs a good guess on the channel capacity to choose the correct coding strength for the …

Posted

archive

@cached_property

django.utils.functional 里发现的。

class cached_property(object):
    """
    Decorator that creates converts a method with a single
    self argument into a property cached on the instance.
    """
    def __init__(self, func):
        self.func = func

    def __get__(self, instance, type):
        res = instance.__dict__[self.func.__name__] = self.func …

Posted

archive

测试ssh连接速度和带宽

安装pv:
sudo apt-get install pv

下行:
$ ssh est@my_host 'cat /dev/zero' | pv > /dev/null
144kB 0:00:05 [ 121kB/s] [ <=> ]

上行:
$ yes | pv | ssh est@my_host "cat > /dev/null"
2.06MB 0:00:05 [1.96MB/s] [ <=> ]

测试本机IO能 …

Posted

archive

Web墨卡托

最近在android上玩RMaps Ext和Mobile Atlas Creator (MOBAC)

一直觉得tg的天地图其实道路信息和POI做的比其他厂商都好,所以网上找到了这个天地 …

Posted

archive

windows下nslookup的bug

今天才知道的。windows下,干净hosts,可以nslookup 和 ping 的 ip 不一样。

主要是 Primary DNS suffix of this computer 这个功能。

解决方法也很简单,nslookup my.domain.tld. dns.server.ip

注 …

Posted

archive

神一样的摄影君

When Alex Honnold and I discussed the Nikon D4 project several months prior, we locked in on Joshua Tree National Park. Given the area's dry weather in late November, J-Tree seemed to be the obvious climbing location. During our first phone call, we simultaneously suggested Equinox as the climb. At …

Posted

archive

ownCloud, csync

KDE那帮人觉得Dropbox不错于是搞了个山寨品 ownCloud.org 。我很是喜欢。

其中双向同步的关键核心组件是 csync,看了下,是OpenSUSE一帮人搞的类 …

Posted

archive

get current 3fm song in python

>>> import pprint, datetime, json, urllib2
>>> p=lambda:json.loads(urllib2.urlopen('http://radioplayer.omroep.nl/helper/now-on-air.json?ac=%s&channel_id=3' % datetime.datetime.now().strftime('%Y%m%d%H%M')).read())
>>> pprint.pprint(p()['current_song'])

or parsing this HTML

http://radioplayer.omroep.nl/helper/playlist.html?ac …

Posted

archive

ping uwsgi

Here's a handy python script do the job of uwsgi --ping <address>

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function

import socket
import struct

#---------------------------------------------------------------
#---------------------------------------------------------------
def ping_uwsgi(sock_file):
    '''
    Ping UWSGI process trought socket. Return [True,...] if OK,
    return [False,error] if UWSGO not pinging …

Posted

archive

(我的)信息危机

难得夜深人静反思一下。我个人每天12个小时在网上闲逛,自个觉得我现在有几个值得警惕的危险趋势:

  1. 输入越来越多,输 …

Posted

archive