<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marius van Witzenburg &#187; Curl</title>
	<atom:link href="http://mariusvw.com/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusvw.com</link>
	<description>We fight for our survival, we fight!</description>
	<lastBuildDate>Tue, 27 Dec 2011 10:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to download a range of files with Curl and Bash</title>
		<link>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/</link>
		<comments>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 18:09:09 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Curl]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Range]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=319</guid>
		<description><![CDATA[This is a really simple sniped how to download a range of files. I found this very useful to download an image range of my old avatar script. I lost my images but remembered an url where I uploaded them once. Happy me 1 2 3 4 5 6 7 #!/usr/local/bin/bash &#160; # Range 1 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a really simple sniped how to download a range of files.</p>
<p>I found this very useful to download an image range of my old avatar script.<br />
I lost my images but remembered an url where I uploaded them once. Happy me <img src='http://mariusvw.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/local/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Range 1 to 75</span>
<span style="color: #000000; font-weight: bold;">for</span> x <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>..<span style="color: #000000;">75</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">do</span>
    curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>my.server.com<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>images_<span style="color: #800000;">${x}</span>.jpg
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to send a message to your iPhone via Pushme.to with PHP or Bash and Curl</title>
		<link>http://mariusvw.com/2011/06/14/how-to-send-a-message-to-your-iphone-via-pushme-to-with-php-or-bash-and-curl/</link>
		<comments>http://mariusvw.com/2011/06/14/how-to-send-a-message-to-your-iphone-via-pushme-to-with-php-or-bash-and-curl/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 12:05:21 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Curl]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[GEOM]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pushme]]></category>
		<category><![CDATA[S.M.A.R.T.]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=241</guid>
		<description><![CDATA[After having Pushme.to installed on my iPhone for over 3 months now I finally had the time to work on some scrips to make it work in different languages for use on servers that I manage. The PHP version is the less version I use but may be handy for some people. PHP Version: function [...]]]></description>
			<content:encoded><![CDATA[<p>After having <a href="http://pushme.to/">Pushme.to</a> installed on my <a href="http://www.apple.com/iphone/">iPhone</a> for over 3 months now I finally had the time to work on some scrips to make it work in different languages for use on servers that I manage.</p>
<p>The <a href="http://php.net/">PHP</a> version is the less version I use but may be handy for some people.</p>
<p><strong>PHP Version</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> pushMeTo<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$signature</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$curl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://pushme.to/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">'message='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;signature='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$signature</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
pushMeTo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hello world!'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'God'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A more used version is the commandline (<a href="http://www.gnu.org/software/bash/">Bash</a>) version:</p>
<p><strong>Bash version</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">username</span>=<span style="color: #ff0000;">&quot;username&quot;</span>
<span style="color: #007800;">message</span>=<span style="color: #ff0000;">&quot;Hello world&quot;</span>
<span style="color: #007800;">signature</span>=<span style="color: #ff0000;">&quot;God&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">-F</span> <span style="color: #ff0000;">&quot;message=<span style="color: #007800;">$message</span>&quot;</span> <span style="color: #660033;">-F</span> <span style="color: #ff0000;">&quot;signature=<span style="color: #007800;">$signature</span>&quot;</span> <span style="color: #ff0000;">&quot;http://pushme.to/<span style="color: #007800;">$username</span>/&quot;</span></pre></div></div>

<p>I currently use these for server monitoring on <a href="http://www.freebsd.org/">FreeBSD</a> like the <a href="http://www.freebsd.org/doc/handbook/geom.html">GEOM</a> Raid bay and <a href="http://en.wikipedia.org/wiki/S.M.A.R.T.">S.M.A.R.T.</a> status of the disks and website monitoring which works quite nice. And in case the internet connection drops I have a backup via <a href="http://en.wikipedia.org/wiki/SMS">SMS</a> with a serial connected cellphone. So this should be quite failsafe <img src='http://mariusvw.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>If you have any other language that you want to use such as <a href="http://www.perl.org/">Perl</a> just let me know and I could write it for you.</p>
<p>I hope you find these scripts useful. Happy texting! <img src='http://mariusvw.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2011/06/14/how-to-send-a-message-to-your-iphone-via-pushme-to-with-php-or-bash-and-curl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

