<?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>SwiftLizard Interactive {Design, Development} &#187; shell</title>
	<atom:link href="http://www.swift-lizard.com/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swift-lizard.com</link>
	<description>all about a it - freelancers life</description>
	<lastBuildDate>Thu, 18 Mar 2010 09:10:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Loging into a page on shell with curl</title>
		<link>http://www.swift-lizard.com/2010/03/05/loging-into-a-page-on-shell-with-curl/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.swift-lizard.com/2010/03/05/loging-into-a-page-on-shell-with-curl/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 16:15:54 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.swift-lizard.com/?p=267</guid>
		<description><![CDATA[Hi guys,
it had been a little bit quite the last time but by now I got a little something you might need to. In my current project I had been running into the problem that I wanted to address a certain Javaservice with a deployment script on the shell. This was the easy part , [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>it had been a little bit quite the last time but by now I got a little something you might need to. In my current project I had been running into the problem that I wanted to address a certain Javaservice with a deployment script on the shell. This was the easy part , the even harder part, which took some time talking to uncle google to get an answer, was that this service needed an authentication by a cookie which needs to have a valid session id in it.<br />
<span id="more-267"></span></p>
<p>Solution is, the time you got to know how it works, quite easy:</p>
<pre name="code" class="php">#!/bin/bash

CookieFileName=cookies.txt

curl --cookie  $CookieFileName --cookie-jar \
$CookieFileName --user-agent Mozilla/4.0 POST \
--data "username={yourUserName}&amp;password={yourPassword}" \
http://websiteToAuthOn.com -v
</pre>
<p>What this basically does is to save the Http Header information in to the cookies.txt file so we can use it later on for instance like this:</p>
<pre name="code" class="php">
curl --cookie cookies.txt --user-agent Mozilla/4.0 \
-X GET http://websiteToAuthOn.com/page/you/want
</pre>
<p>Tada,&#8230; you loged into a page on shell, got a cookie and are ready to play.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swift-lizard.com/2010/03/05/loging-into-a-page-on-shell-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

