<?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>ubuntuverse.at &#187; curl</title>
	<atom:link href="http://www.ubuntuverse.at/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ubuntuverse.at</link>
	<description>Berichte aus dem Ubuntu Universum</description>
	<lastBuildDate>Tue, 01 Jun 2010 09:50:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Diese Woche in der Konsole #10</title>
		<link>http://www.ubuntuverse.at/2009/11/15/diese-woche-in-der-konsole-10/</link>
		<comments>http://www.ubuntuverse.at/2009/11/15/diese-woche-in-der-konsole-10/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 09:41:26 +0000</pubDate>
		<dc:creator>Bernhard Essl</dc:creator>
				<category><![CDATA[Konsole]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[dwik]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.ubuntuverse.at/?p=1803</guid>
		<description><![CDATA[BASH Befehlsübersicht Um alle Befehle der BASH Tools und Programme die in den Pfaden der Umgebungsvariable PATH sich befinden, anzeigen zu lassen reicht 2 mal Tabulator und ein y (oder j) in der Konsole. Online GeoIP Daten einer IP abfragen. Zurück kommt ein json-formatierter String. curl -s "http://geoip.pidgets.com?ip=212.69.178.148&#038;format=json" Eine ganz bestimmte Zeile einer Datei anzeigen [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><del datetime="2009-11-17T13:11:14+00:00">BASH</del> Befehlsübersicht
<p>Um alle <del datetime="2009-11-17T13:11:14+00:00">Befehle der BASH</del> Tools und Programme die in den Pfaden der Umgebungsvariable PATH sich befinden,  anzeigen zu lassen reicht 2 mal Tabulator und ein y (oder j) in der Konsole.</li>
<li>
Online GeoIP Daten einer IP abfragen. Zurück kommt ein json-formatierter String.</p>
<pre>curl -s "http://geoip.pidgets.com?ip=212.69.178.148&#038;format=json"</pre>
</li>
<li>Eine ganz bestimmte Zeile einer Datei anzeigen lassen.
<pre>head -n 23 /etc/passwd | tail -n 1</pre>
<p>oder mit sed</p>
<pre>sed -n 23p /etc/passwd</pre>
</li>
<li>
Eine Datei in mehrere aufteilen. Neue Dateien enthalten jeweils 10 Zeilen und beginnen mit dem<br />
Namen neu-.</p>
<pre>split --lines 10 /etc/passwd neu-</pre>
</li>
<li>Dateien rekursiv durchsuchen mit grep und nur Dateinamen wo etwas gefunden wurde ausgeben.
<pre>grep -r -l suche-nach *</pre>
</li>
<li>
Fortschritts-Anzeige (progress bar) bei Dateien abgleichen mit rsync.</p>
<pre>rsync -avx --progress --stats "/pfad/original/" "/pfad/kopie/"</pre>
</li>
<li>
Eingebauten CPU Namen ermitteln.</p>
<pre>grep "model name" /proc/cpuinfo |uniq</pre>
</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ubuntuverse.at%2F2009%2F11%2F15%2Fdiese-woche-in-der-konsole-10%2F&amp;title=Diese%20Woche%20in%20der%20Konsole%20%2310" id="wpa2a_2"><img src="http://www.ubuntuverse.at/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ubuntuverse.at/2009/11/15/diese-woche-in-der-konsole-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Diese Woche in der Konsole #9</title>
		<link>http://www.ubuntuverse.at/2009/09/13/diese-woche-in-der-konsole-9/</link>
		<comments>http://www.ubuntuverse.at/2009/09/13/diese-woche-in-der-konsole-9/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 09:30:16 +0000</pubDate>
		<dc:creator>Bernhard Essl</dc:creator>
				<category><![CDATA[Konsole]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[dwik]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[tinyurl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ubuntuverse.at/?p=1620</guid>
		<description><![CDATA[Mit diff Unterschiede zwischen zwei Verzeichnissen anzeigen. $ diff folder1 folder2 Das ganze geht auch über zwei per ssh erreichbare Server. $ diff]]></description>
			<content:encoded><![CDATA[<ol>
<li>
Mit <em>diff</em> Unterschiede zwischen zwei Verzeichnissen anzeigen.</p>
<pre>$ diff folder1 folder2</pre>
<p>Das ganze geht auch über zwei per ssh erreichbare Server. </p>
<pre>$ diff <(ssh server01 "ls /tmp/") <(ssh server02 "ls /tmp/")
1,8d0
< lost+found
< mysql.sock
< orbit-root
</pre>
</li>
<li>tinyurl von der Konsole aus verwenden.
<pre>$ curl -s http://tinyurl.com/create.php?url=http://www.ubuntuverse.at/ | \
grep -o "http:\/\/tinyurl.com\/[a-z0-9][a-z0-9]*" | uniq
</pre>
</li>
<li>
Mit <em>time</em> ist es möglich die Zeitdauer eines Befehls oder Skripts anzuzeigen (benchmark).</p>
<pre>
$ time ruby script.rb

real    0m0.017s
user    0m0.008s
sys     0m0.004s
</pre>
</li>
<li>Datum in timestamp umwandeln.
<pre>$ date --utc --date "2009-09-09 09:09:09" +%s
1252487349
</pre>
</li>
<li>Das gesamte interne Netzwerk nach erreichbaren IPs durchsuchen. <em>nmap</em> versucht dabei auch den Hersteller der Netzwerkkarte zu ermitteln.
<pre>$ sudo nmap -sP 192.168.0.0/24

Starting Nmap 4.76 ( http://nmap.org ) at 2009-09-03 18:28 CEST
Host 192.168.1.122 appears to be up.
MAC Address: 00:12:52:73:85:4C (Apple)
Host 192.168.1.181 appears to be up.
MAC Address: 00:0E:A8:D0:87:DE (Cisco Linksys)
</pre>
</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ubuntuverse.at%2F2009%2F09%2F13%2Fdiese-woche-in-der-konsole-9%2F&amp;title=Diese%20Woche%20in%20der%20Konsole%20%239" id="wpa2a_4"><img src="http://www.ubuntuverse.at/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ubuntuverse.at/2009/09/13/diese-woche-in-der-konsole-9/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Diese Woche in der Konsole #1</title>
		<link>http://www.ubuntuverse.at/2009/07/05/diese-woche-in-der-konsole-1/</link>
		<comments>http://www.ubuntuverse.at/2009/07/05/diese-woche-in-der-konsole-1/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 05:23:21 +0000</pubDate>
		<dc:creator>Bernhard Essl</dc:creator>
				<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[dwik]]></category>
		<category><![CDATA[Konsole]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.ubuntuverse.at/?p=868</guid>
		<description><![CDATA[Mit curl von der Komandozeile aus twittern: curl -u Benutzername:Passwort \ -d status=&#34;Nachricht&#34; http://twitter.com/statuses/update.xml Suchen und Ersetzen mit einem Ruby Einzeiler: ruby -i.bkp -pe &#34;gsub(/suche/, 'ersetze')&#34; *.php Hier werden alle PHP Dateien in dem aktuellen Ordner ersetzt und zusätzlich wird eine Backup Datei (.bkp) erstellt. Einen Ordner via ssh mittels rsync clonen: rsync -avz -e [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ubuntuverse.at/wp-content/utilities-terminal.png" alt="Diese Woche in der Konsole" title="Diese Woche in der Konsole" width="64" height="64" /></p>
<ol>
<li>Mit curl von der Komandozeile aus twittern:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-u</span> Benutzername:Passwort \
<span style="color: #660033;">-d</span> <span style="color: #007800;">status</span>=<span style="color: #ff0000;">&quot;Nachricht&quot;</span> http:<span style="color: #000000; font-weight: bold;">//</span>twitter.com<span style="color: #000000; font-weight: bold;">/</span>statuses<span style="color: #000000; font-weight: bold;">/</span>update.xml</pre></div></div>

</li>
<li>Suchen und Ersetzen mit einem Ruby Einzeiler:

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">ruby <span style="color:#006600; font-weight:bold;">-</span>i.<span style="color:#9900CC;">bkp</span> <span style="color:#006600; font-weight:bold;">-</span>pe <span style="color:#996600;">&quot;gsub(/suche/, 'ersetze')&quot;</span> <span style="color:#006600; font-weight:bold;">*</span>.<span style="color:#9900CC;">php</span></pre></div></div>

<p>Hier werden alle PHP Dateien in dem aktuellen Ordner ersetzt und zusätzlich wird eine Backup Datei (.bkp) erstellt.</li>
<li>Einen Ordner via ssh mittels rsync clonen:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-avz</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'ssh -p portnummer'</span> user<span style="color: #000000; font-weight: bold;">@</span>host <span style="color: #000000; font-weight: bold;">/</span>Quellordner <span style="color: #000000; font-weight: bold;">/</span>Zielordner</pre></div></div>

<p>Wird der Quellordner ohne abschliessenden / angegeben, so wird der Quellordner selbst kopiert. Ansonsten nur der Inhalt</li>
<li>Datenbank von einem anderen Server via ssh übernehmen:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> user<span style="color: #000000; font-weight: bold;">@</span>host mysqldump <span style="color: #660033;">-u</span> dbuser_server <span style="color: #660033;">-p</span> dbpwd_server databasename \
<span style="color: #660033;">--lock-tables</span> <span style="color: #000000; font-weight: bold;">|</span> mysql <span style="color: #660033;">--verbose</span> <span style="color: #660033;">-u</span> dbuser_local <span style="color: #660033;">-p</span> dbpwd_local</pre></div></div>

</li>
<li>Verschlüsselte Text-Datei mit Vim anlegen:</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #660033;">-x</span> datei</pre></div></div>

</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ubuntuverse.at%2F2009%2F07%2F05%2Fdiese-woche-in-der-konsole-1%2F&amp;title=Diese%20Woche%20in%20der%20Konsole%20%231" id="wpa2a_6"><img src="http://www.ubuntuverse.at/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ubuntuverse.at/2009/07/05/diese-woche-in-der-konsole-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

