tekker.com
域名年龄: 25年9个月15天HTTP/1.1 200 OK 访问时间:2015年03月17日 00:51:38 语言环境:PHP/5.3.29 X-Pingback: http://tekker.com/xmlrpc.php Keep-Alive: timeout=5, max=100 连接:Keep-Alive Transfer-Encoding: chunked 类型:text/html; charset=UTF-8 网站编码:UTF-8
Tekker BlogMy little home on the internet.Easy hosts file editing on OSX…without commentsA nice little app called Gas Mask that resides in the “notification widgets” portion of the menu bar. It allows you to quickly load /etc/hosts and modify it. When you save it, it prompts for your system password. Easier than terminal + vi Gas Mask can be found here.Written by admin December 1st, 2011 at 6:31 pmPosted inHow to find yesterday’s date with bash…without commentsI have a process that generates files daily. Rather than having to go delete them myself, I wanted to automate the task of removing the files. After all, the more the computer does for me, the less I have to do, right?5 Mins of googling and I found this site. I am blantantly copying and pasting the post, this is NOT my post.Date of yesterday in bash?I recently had to hack a small shell script that would read files in a directory structure generated based on the date, something like 2007/08/16. The trick was that the script would look at yesterday’s file or files generated a few days ago.A quick search on info and here’s the magic commandFILE=”…$(date -d ‘yesterday’ +%Y/%m/%d)”Interestingly, you can also use things like 3 days ago, next Monday, 2 months etc. Cool!Written by Paul November 21st, 2011 at 10:26 amPosted inUTF8 Woes With Ruby 1.9without commentsOne of my projects at work is to consume “halfhose” from Gnip, which is half of the full Twitter firehose. Lots of fast data. Lots of UTF8. When working with the code, I kept getting “ruby 1.9: invalid byte sequence in UTF-8″. Now, being that I am consuming Twitter, it should already be UTF8. You can’t blindly do a .toutf8 on the string, as that actually tries to re-encode the already properly encoded UTF8.So, I went googling and found this post which linked to this which has this snippet of code:ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')valid_string = ic.iconv(untrusted_string + ' ')[0..-2]This block of code did the trick. It basicly removes invalid UTF8 characters. I can’t say that I took the time to fully understand it, I just know that it works.Written by admin August 3rd, 2011 at 11:15 amPosted inDaemon framework for Ruby: Foreverwithout commentsA light weight and simple micro framework for easy Ruby daemons.Found at https://github.com/DAddYE/foreverbWritten by admin July 15th, 2011 at 9:59 amPosted inHow big are those files in that directory on my *nix system?without commentsAh, the command line. It can be awesome and a pain in the ass at the same time. In a GUI file manager, you can just highlight the files you want and get a total size of the selected files. On a *nix command line? Not so simple.find . -iname '*.jpg' | sed "s/ /\\\\ /g" | xargs du -ksb | cut -f1 | xargs echo | sed "s/ /+/g" | bcThat does it Breaking this monster down gives us the following.First cd to the directory you want to check in.cd PicturesList the files. f
© 2010 - 2020 网站综合信息查询 同IP网站查询 相关类似网站查询 网站备案查询网站地图 最新查询 最近更新 优秀网站 热门网站 全部网站 同IP查询 备案查询
2025-02-07 07:29, Process in 0.0075 second.