代码改变世界

How would you print just the 10th line of a file

2016-10-07 10:47 by 三犬风, 175 阅读, 0 推荐, 收藏, 编辑
摘要:awk -F:"\n" '{if(NR==10) {print}}' file.txt 阅读全文

extract the CA cert for a particular server

2016-09-03 05:16 by 三犬风, 274 阅读, 0 推荐, 收藏, 编辑
摘要:Ignore Peer SSL certificate verification libcurl performs peer SSL certificate verification by default. This is done by using a CA certificate store t 阅读全文

be careful with "bash -ex"

2016-08-31 07:32 by 三犬风, 918 阅读, 0 推荐, 收藏, 编辑
摘要:http://tldp.org/LDP/abs/html/options.html -e errexit Abort script at first error, when a command exits with non-zero status (except in until or while 阅读全文

-bash: fork: retry: Resource temporarily unavailable

2016-01-01 03:32 by 三犬风, 1001 阅读, 0 推荐, 收藏, 编辑
摘要:For me, I got the same error message but had a different solution.Cron failed with : (CRON) ERROR (setreuid failed): Resource temporarily unavailableB... 阅读全文

[zz]linux find命令中-print0和xargs中-0的用法

2015-01-28 07:54 by 三犬风, 376 阅读, 1 推荐, 收藏, 编辑
摘要:默认情况下, find命令每输出一个文件名, 后面都会接着输出一个换行符 ('n'), 因此find 的输出都是一行一行的:[bash-4.1.5] ls -ltotal 0-rw-r--r-- 1 root root 0 2010-08-02 18:09 file1.log-rw-r--r-- 1... 阅读全文

[zz]jq简介

2014-10-07 07:40 by 三犬风, 709 阅读, 0 推荐, 收藏, 编辑
摘要:JSON是前端编程经常用到的格式,对于PHP或者Python,解析JSON都不是什么大事,尤其是PHP的json_encode和json_decode,干的相当的漂亮。Linux下也有处理处理JSON的神器:jq。 对于JSON格式而言,jq就像sed/awk/grep这些神器一样的方便,而也,jq... 阅读全文

[zz]How to Disable SELinux

2014-10-07 00:58 by 三犬风, 437 阅读, 0 推荐, 收藏, 编辑
摘要:How to Disable SELinuxYou've setup a new system, or installed something new on your Linux system and its not working. You get the feeling that SELinux... 阅读全文

Fix to "Error Value: Error: rpmdb open failed"

2014-10-07 00:19 by 三犬风, 517 阅读, 0 推荐, 收藏, 编辑
摘要:"An internal system error has occuredA problem that we were not expecting has occured.Please report this bug in your distribution bugtracker withthe e... 阅读全文

[zz]Python 3.4 and Pillow 2.4 with JPEG2000 (openjpeg 2) support in Ubuntu 14.04

2014-08-21 16:28 by 三犬风, 1508 阅读, 0 推荐, 收藏, 编辑
摘要:Pillowsupport for JPEG2000 comes fromopenjpeg2 library. Unfortunatly, Ubuntu's libopenjpeg2 package is not version 2 of the openjpeg library, butactua... 阅读全文

#django filebrowser# problems and solutions

2014-08-19 15:59 by 三犬风, 613 阅读, 0 推荐, 收藏, 编辑
摘要:1.IOError: decoder jpeg not availableHow to fix:1. clear PIL packages (or pip uninstall pillow)rm -rf /usr/lib/python2.7/site-packages/PILrm -rf /usr/... 阅读全文