`
hanyh
  • 浏览: 228841 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
通过IP地址反查归属地的python模块 业务逻辑由其它C++模块已经完成了开发。 #include <Python.h> #include "iplookup.h" static il_db_t _g_db; ipitem ip_lookup(const char *query) { const char *encoding = "UTF-8"; data_type type = text; ipitem iphm; il_iplookup(query, iphm, _g_db, type, enco ...
就是个EOF问题 #!/bin/sh user="dbuser" pass="dbpassword" db="dbnme" mysql -u "$user" -p"$pass" "$db" <<EOF select * from userinfo1; EOF #!/bin/sh user="dbuser" pass="dbpassword" db="dbnme" ...
http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/
http://johnmeister.com/CS/UNIX/FIND/find-usage.html sudo find / -type f -name *.jpg  -exec cp {} . \; find . -type f -size +10000 -exec ls -al {} \; find . -atime +1 -type f -exec mv {} TMP \; # mv files older then 1 day to dir TMP find . -name "-F" -exec rm {} \;   # a script error cre ...

销售和开发

角度不一样,关注的核心重点绝对差异很大: 一个关注广告售卖形式的多样 特别关注广告主的需求 根据现实的反馈倾向于不向用户要钱,向广告主要钱 关注需要的响应时间 技术人员: 关心技术“高级不高级” 关心代码优美不优美 买卖东西更多的是自己的猜测与想象 关心东西远超过卖东西
一个日志中心化设计收集项目,前端有230台的服务器,使用syslogd收集日志,保存在本地磁盘的同时另外发一份到syslog-ng的日志中心服务器上,中心服务器同时把日志分发到两个目的地:本地磁盘存储和一个FIFO。该FIFO作为Source发给PipeReader Class处理,该类对日志进行预处理,如从用户的IP地址查询出对应的城市等。然后发给LogCenter Daemon处理;该Daemon再根据配置文件对数据进行分发到对应的目的的. 架构图如下: 当前存在的问题主要就在Daemon这块,该Daemon的存在是为了对数据进行M:N分发的时候能有一个统一的监控机制和管理平台,但是在分 ...

spinlock

spinlock is a lock where the thread simply waits in a loop("spins") repeatedly checking until the lock becomes available. -->it's busy waiting -->only likely to be locked for a short period of time.this avoid overhead from operating system process re-scheduling or context switching. - ...
consequently C++, the keyword was intended to:[citation needed]     * allow access to memory mapped devices     * allow uses of variables between setjmp and longjmp     * allow uses of variables in signal handler 易挥发的,避免优化 ===>busy waiting (or spinning) is a technique in which a process repeated ...

source code

_LARGEFILE64_SOURCE #define _GNU_SOURCE #define _BSD_SOURCE #define _SVID_SOURCE _THREAD_SAFE 能使用相应的库和MACRO

C保留字

原来只认为是基本的函数,库名字,今天看libc manual发现限制更加多 You only need to worry about these restrictions if your program includes that particular header file. The header file ‘dirent.h’ reserves names prefixed with ‘d_’. The header file ‘fcntl.h’ reserves names prefixed with ‘l_’, ‘F_’, ‘O_’, and ‘S_’. The header file ...
一来自四川山区的朋友,说她初中的时候个时候她们那有家人非常贫穷,父母没什么本事,养了一个女儿。每年到3月底就没有了粮食吃,需要到处去借,每次来客人,家里面都没有住的地方,需要到她家寄宿。 贫穷,饥饿,让小女孩初二还没结束就出去打工,开始在发廊做洗头妹,挣不了多少就“下海了”,开始做小姐,做了不到3年,回老家新修了房子,有些存款后洗手不干了。回来嫁给了一个离婚的男人,做了和她年龄差不多一个女孩的后妈,不过她自己已经没有了生育能力...
今天做用户登录的日志分析,发现有一些有意思的IP,如       1 219.234.81.104       2 219.234.81.116       6 219.234.81.117       2 219.234.81.123       2 219.234.81.124       2 219.234.81.38       6 219.234.81.63       1 219.234.81.66 ........... 通过反查IP地址来源,如219.234.81.63,     * 本站主数据:北京市 中关村通信     * 参考数据一:北京市 中关村通信     * 参考数据 ...
#!/bin/sh if test "$2" = ""; then echo "Usage: $0 basedir depth" exit 1 fi if test "$2" = "0"; then exit 0 fi for i in a b c d e f ; do path="$1/$i" mkdir $path || exit 1 sh $0 $path `expr $2 - 1` #这里:) done
以前作PHP测试的时候经常用PHPUNIT,现在个人倾向用phpt,因为非常简单,没有那些复杂的多余代码,很有python的doctest味。 --TEST--    Description of the test case goes here --FILE-- <?php    Your test client written in php ?> --EXPECT-- Expected output of the above php script 例子: --TEST-- Sina_Helper_Log: Console Handler --FILE-- < ...
最近发现线上登录Yahoo邮箱取地址薄的代码不能用了,调试发现是登录方式变换了,特通过HttpFox关注,重构代码如下: define("USERAGENT","Mozilla/99.99 (compatible; MSIE 99.99; Windows XP 99.99)"); define("COOKIEJAR",tempnam("/tmp/cookie/","cookie")); define("TIMEOUT",10); define("REF ...
Global site tag (gtag.js) - Google Analytics