|
News Feeds from the best resources 
|
|
Exposing command line programs as web services |
Exposing command line programs as web services
The web services paradigm of development is based on the Unix philosophy of “small is good”. Web services should do one job, and do it well, allowing users to develop complex solutions by combining small, reliable and proven services. Why not then, expose the power of familiar Unix commands like sort, grep, gzip… to the web? Here [...] |
|
Shell Function - Which Webserver Does That Site Run? |
Shell Function - Which Webserver Does That Site Run?
I just read the following post Python - Script - Which Webserver Does That Site Run? by blogger Corey Goldberg. I prefer the shell version: $ what-http-server() { curl -s -I http://$1 | awk -F: / |
New command: prepend
I am utilizing Google’s project hosting to host software which I create and feel is useful or want to keep track of. I called the project Brock’s Tools. The code that led me to create this project was a command I am calling prepend 1.1. (UPDATE: See this post on sponge as its a better [...] |
|
Performance testing - with curl |
Performance testing - with curl
Often I need or want to do some type of performance testing. Given my ideas on software development, I can usually do this by making simple HTTP requests. I use curl for this. While you may be tempted to do this in a for loop (or worse, actually write something!): $ time for i in {1..1000}; [...] |
|
using kill to see if a process is alive |
using kill to see if a process is alive
I am making some changes to the moreutils sponge command. Sponge provides a method of prepending which is less specialized than my prepend util. However, it has trouble with large amounts of input. Regardless, while testing my changes, I want to watch it operate. Normally, you would just do so from a second terminal. That [...] |
Bug in Curl is fixed
I love curl. I use it quite often to perform HTTP HEAD requests: $ curl -I http://bashcurescancer.com HTTP/1.1 200 OK Date: Mon, 14 Apr 2008 03:11:35 GMT Server: Apache/2.2.6 (Unix) X-Pingback: http://bashcurescancer.com/wordpress/xmlrpc.php Last-Modified: Mon, 14 Apr 2008 02:38:11 GMT Connection: close Content-Type: text/html; charset=UTF-8 However, I sometimes forget if a HEAD request is -I or -i, as such I usually specify them both. Lowercase [...] |
|
prepend to a file with sponge from moreutils |
prepend to a file with sponge from moreutils
A few weeks I wrote about a tool, which helps you easily prepend to a file. I submitted prepend to moreutils and Joey was kind enough to point out this could be done with `sponge’. sponge reads standard input and when done, writes it to a file: Probably the most general purpose tool in moreutils so [...] |
Do not close stderr
A few years ago, I wrote a post commenting on how ugly this was: $ someprog 2>/dev/null I was nearly imploring the reader to close stderr: $ someprog 2>&- Some very knowledgeable anonymous commenter explained why that was a bad idea. At the time, I didn’t understand exactly what they were saying. As such, I deleted the post. Yesterday, [...] |
|
Processing XML on the Command Line |
Processing XML on the Command Line
The other day on the cURL email list, someone asked: Could someone please tell me (preferably with an example) of how I could parse and xml like the following: <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FileRetriever> <FileList> <File name=”AMERI08.D4860.ZIP” /> <File name=”DTCCRSF.D4861.ZIP” /> <File name=”DTGSS01.D4862.ZIP” /> <File name=”DTGSS02.D4863.ZIP” /> <File name=”DTGSS03.D4864.ZIP” / </FileList> </FileRetriever> This is not appropriate for the cURL list, but I thought a fair question. You [...] |
|
The best in command line xml: XMLStarlet |
The best in command line xml: XMLStarlet
Quite some time ago I wrote about using xsltproc to process xml on the command line. Thank fully someone pointed out XMLStarlet. I now use XMLStarlet almost every day. I work with a variety of REST based API’s gather information. XMLStartlet along with a simple for loop or xargs gives you an exceedingly powerful set [...] |
|
|
|
|
|
|
Page 1 of 11 |