<?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>i live in my own little world, but it&#039;s ok... they know me here &#187; background wissen</title>
	<atom:link href="http://ww.sd.vc/wp/tag/background-wissen/feed/" rel="self" type="application/rss+xml" />
	<link>http://ww.sd.vc/wp</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 21:09:59 +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>erkenntnis des tages: nicht wechselbare hartplatte</title>
		<link>http://ww.sd.vc/wp/2012/01/12/erkenntnis-des-tages-nicht-wechselbare-hartplatte/</link>
		<comments>http://ww.sd.vc/wp/2012/01/12/erkenntnis-des-tages-nicht-wechselbare-hartplatte/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 05:10:32 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=4487</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2012/01/20120112_hartplatten.jpg" alt="" title="20120112_hartplatten" width="465" height="134" class="alignnone size-full wp-image-4488" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2012/01/12/erkenntnis-des-tages-nicht-wechselbare-hartplatte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>erkenntnis des tages: der rechner</title>
		<link>http://ww.sd.vc/wp/2011/12/26/erkenntnis-des-tages-der-rechner/</link>
		<comments>http://ww.sd.vc/wp/2011/12/26/erkenntnis-des-tages-der-rechner/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 05:20:56 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=4418</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2011/12/20111226_rechner.jpg" alt="" title="20111226_rechner" width="465" height="210" class="alignnone size-full wp-image-4419" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2011/12/26/erkenntnis-des-tages-der-rechner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>brustschwellattacke</title>
		<link>http://ww.sd.vc/wp/2011/03/18/brustschwellattacke/</link>
		<comments>http://ww.sd.vc/wp/2011/03/18/brustschwellattacke/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 17:25:09 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[das leben]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3505</guid>
		<description><![CDATA[*hach*.. schoen, auch mal feedback zu bekommen. (per mail von der D.): Ich lerne immer wieder neues durch deinen blog]]></description>
			<content:encoded><![CDATA[<p>*hach*..  schoen, auch mal feedback zu bekommen. (per mail von der D.):</p>
<blockquote><p>Ich lerne immer wieder neues durch deinen blog</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2011/03/18/brustschwellattacke/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>remote filesystem mit sshfs mounten</title>
		<link>http://ww.sd.vc/wp/2011/02/19/remote-filesystem-mit-sshfs-mounten/</link>
		<comments>http://ww.sd.vc/wp/2011/02/19/remote-filesystem-mit-sshfs-mounten/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 09:38:09 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3422</guid>
		<description><![CDATA[wiedermal eine gedankestuetze fuer mich. wenns jemand anders gebrauchen kann &#8211; sehr schoen wie kann ich unter linux ueber ssh ein verzeichnis eines entfernten rechners ins lokale dateisystem mounten? dafuer gibt es z.b. unter ubuntu das paket sshfs. einfach mal installieren (abhaengigkeiten werden aufgeloest): sudo apt-get install sshfs aus sicherheitsgruenden benoetigt man spezielle berechtigungen fuer [...]]]></description>
			<content:encoded><![CDATA[<p>wiedermal eine gedankestuetze fuer mich. wenns jemand anders gebrauchen kann &#8211; sehr schoen <img src='http://ww.sd.vc/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>wie kann ich unter linux ueber ssh ein verzeichnis eines entfernten rechners ins lokale dateisystem mounten? dafuer gibt es z.b. unter ubuntu das paket sshfs. einfach mal installieren (abhaengigkeiten werden aufgeloest):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sshfs</pre></div></div>

<p>aus sicherheitsgruenden benoetigt man spezielle berechtigungen fuer das binary /bin/fusermount. man muss die user, die das verwenden duerfen der gruppe &#8220;fuse&#8221; hinzufuegen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> localuser fuse</pre></div></div>

<p>wenn man das fuer den aktuell angemeldeten user macht, muss man sich einmal ausloggen und wieder einloggen, damit das greift.</p>
<p>dann einfach ein lokales verzeichnis erstellen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>localuser<span style="color: #000000; font-weight: bold;">/</span>remotefs</pre></div></div>

<p>und mit diesem befehl das entfernte verzeichnis mounten (das ist eine zeile):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sshfs remoteuser<span style="color: #000000; font-weight: bold;">@</span>remotehostname:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>remoteuser<span style="color: #000000; font-weight: bold;">/</span>remotedir
 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>localuser<span style="color: #000000; font-weight: bold;">/</span>remotefs<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2011/02/19/remote-filesystem-mit-sshfs-mounten/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>tsql &#8211; zeilenanzahl aller tabellen</title>
		<link>http://ww.sd.vc/wp/2011/01/31/tsql-zeilenanzahl-aller-tabellen/</link>
		<comments>http://ww.sd.vc/wp/2011/01/31/tsql-zeilenanzahl-aller-tabellen/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 12:13:52 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3378</guid>
		<description><![CDATA[es gibt viele unterschiedliche wege, die zeilenanzahl aller tabellen in einer datenbank einzeigen zu lassen. gerade wenn man noch anfaenger ist, landet man erstmal bei dem altbekannten: SELECT COUNT&#40;*&#41; FROM TABELLE &#8230;was man dann fuer jede tabelle machen muss. schnell hat man sich einen cursor drumherum gebaut damit das fuer alle tabellen in einer datenbank [...]]]></description>
			<content:encoded><![CDATA[<p>es gibt viele unterschiedliche wege, die zeilenanzahl aller tabellen in einer datenbank einzeigen zu lassen. gerade wenn man noch anfaenger ist, landet man erstmal bei dem altbekannten:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> TABELLE</pre></div></div>

<p>&#8230;was man dann fuer jede tabelle machen muss. schnell hat man sich einen cursor drumherum gebaut damit das fuer alle tabellen in einer datenbank macht.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- BEISPIEL 1</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DECLARE</span> @<span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #66cc66;">&#40;</span>
	tablename	<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	rowcounter	<span style="color: #993333; font-weight: bold;">INT</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DECLARE</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">DECLARE</span> @SQLSTATEMENT nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">DECLARE</span> @x <span style="color: #993333; font-weight: bold;">INT</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DECLARE</span> cur CURSOR <span style="color: #993333; font-weight: bold;">FOR</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span> 
	<span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span> 
	<span style="color: #993333; font-weight: bold;">WHERE</span> TABLE_TYPE <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'BASE TABLE'</span>
<span style="color: #993333; font-weight: bold;">OPEN</span> cur
FETCH <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
WHILE @@fetch_status <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
	<span style="color: #993333; font-weight: bold;">SET</span> @SQLSTATEMENT <span style="color: #66cc66;">=</span> 
	 N<span style="color: #ff0000;">'SELECT @x = COUNT(*) FROM '</span> <span style="color: #66cc66;">+</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
	<span style="color: #993333; font-weight: bold;">EXEC</span> sp_executesql
		@SQLSTATEMENT<span style="color: #66cc66;">,</span>
		N<span style="color: #ff0000;">'@x int OUTPUT'</span><span style="color: #66cc66;">,</span>
		@x OUTPUT
&nbsp;
	<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #66cc66;">&#40;</span>tablename<span style="color: #66cc66;">,</span> rowcounter<span style="color: #66cc66;">&#41;</span> 
	<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>@<span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">,</span> @x<span style="color: #66cc66;">&#41;</span>
	FETCH <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
<span style="color: #993333; font-weight: bold;">END</span>
CLOSE cur
DEALLOCATE cur
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> @<span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> tablename</pre></div></div>

<p>das ist natuerlich viel code fuer das bischen abfrage. es geht naemlich auch kuerzer mit der (von microsoft undokumentierten) sql-server  internen stored procedure <a href="http://weblogs.asp.net/nunogomes/archive/2008/08/19/sql-server-undocumented-stored-procedure-sp-msforeachtable.aspx" target="_blank">sp_MSforeachtable</a></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- BEISPIEL 2</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> #TABLEROWCOUNT
<span style="color: #66cc66;">&#40;</span>
 TABLENAME sysname<span style="color: #66cc66;">,</span>
 ROWCOUNTER <span style="color: #993333; font-weight: bold;">INT</span>
<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">EXEC</span> sp_MSforeachtable 
<span style="color: #ff0000;">'INSERT #TABLEROWCOUNT (TABLENAME,ROWCOUNTER) 
SELECT '</span><span style="color: #ff0000;">'?'</span><span style="color: #ff0000;">',Count(*) from ?'</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> #TABLEROWCOUNT
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> #TABLEROWCOUNT</pre></div></div>

<p>schick ist das aber immer noch nicht. <del datetime="2011-01-31T08:20:32+00:00">eleganter und</del> performanter und ausfuehrlicher gehts mit einer (auch in sql server inegrierten) stored procedure namens <a href="http://msdn.microsoft.com/de-de/library/ms188776.aspx" target="_blank">sp_spaceused</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- BEISPIEL 3</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DECLARE</span> @<span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #66cc66;">&#40;</span>
	tablename	<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	rowcounter	<span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">,</span>
	reserved	<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	<span style="color: #993333; font-weight: bold;">DATA</span>		<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	index_size	<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	unused		<span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DECLARE</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">DECLARE</span> cur CURSOR <span style="color: #993333; font-weight: bold;">FOR</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span> 
	<span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span> 
	<span style="color: #993333; font-weight: bold;">WHERE</span> TABLE_TYPE <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'BASE TABLE'</span>
<span style="color: #993333; font-weight: bold;">OPEN</span> cur
FETCH <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
WHILE @@fetch_status <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
	<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLES</span>
	<span style="color: #66cc66;">&#40;</span>tablename<span style="color: #66cc66;">,</span> rowcounter<span style="color: #66cc66;">,</span> reserved<span style="color: #66cc66;">,</span>
	<span style="color: #993333; font-weight: bold;">DATA</span><span style="color: #66cc66;">,</span> index_size<span style="color: #66cc66;">,</span> unused<span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">EXEC</span> sp_spaceused @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
	FETCH <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @<span style="color: #993333; font-weight: bold;">TABLE_NAME</span>
<span style="color: #993333; font-weight: bold;">END</span>
CLOSE cur
DEALLOCATE cur
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> @<span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> tablename</pre></div></div>

<p>das schoenste und auch schnellste statement ist dieses hier (funktioniert erst ab sql server 2005):</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- BEISPIEL 4</span>
<span style="color: #808080; font-style: italic;">-- zeigt alle user tables und deren zeilenanzahl der aktuellen </span>
<span style="color: #808080; font-style: italic;">-- datenbank. ohne &quot;IS_MS_SHIPPED = 0&quot; in der where </span>
<span style="color: #808080; font-style: italic;">-- klausel werden noch die system objekte angezeigt. </span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> T2<span style="color: #66cc66;">.</span>NAME<span style="color: #66cc66;">,</span> T3<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">ROW_COUNT</span> 
<span style="color: #993333; font-weight: bold;">FROM</span> SYS<span style="color: #66cc66;">.</span>INDEXES T1 
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> SYS<span style="color: #66cc66;">.</span>OBJECTS T2 <span style="color: #993333; font-weight: bold;">ON</span> T1<span style="color: #66cc66;">.</span>OBJECT_ID <span style="color: #66cc66;">=</span> T2<span style="color: #66cc66;">.</span>OBJECT_ID 
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> SYS<span style="color: #66cc66;">.</span>DM_DB_PARTITION_STATS T3 <span style="color: #993333; font-weight: bold;">ON</span> 
T1<span style="color: #66cc66;">.</span>OBJECT_ID <span style="color: #66cc66;">=</span> T3<span style="color: #66cc66;">.</span>OBJECT_ID <span style="color: #993333; font-weight: bold;">AND</span> T1<span style="color: #66cc66;">.</span>INDEX_ID <span style="color: #66cc66;">=</span> T3<span style="color: #66cc66;">.</span>INDEX_ID
<span style="color: #993333; font-weight: bold;">WHERE</span> T1<span style="color: #66cc66;">.</span>INDEX_ID <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">2</span> 
<span style="color: #993333; font-weight: bold;">AND</span> T2<span style="color: #66cc66;">.</span>IS_MS_SHIPPED <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span> 
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> T2<span style="color: #66cc66;">.</span>NAME</pre></div></div>

<p>wenn man sich die performance der vier beispiele betrachtet wird schnell klar, welches man fuer groessere datenbanken nicht mehr gebrauchen kann. ich hatte eine datenbank zum &#8220;ausprobieren&#8221;, in der 475 millionen datensaetze auf 60 tabellen verteilt waren. das waren die laufzeiten in millisekunden:</p>
<p>BEISPIEL 1: 156183 ms ( ~ 2 minuten 60 sekunden)<br />
BEISPIEL 2: 155573 ms ( ~ 2 minuten 59 sekunden)<br />
BEISPIEL 3: 173 ms<br />
BEISPIEL 4: 13 ms</p>
<p>ich denke, dass es zu den ergebnissen nicht viel zu sagen gibt. </p>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2011/01/31/tsql-zeilenanzahl-aller-tabellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dateien rekursiv von iso-8859-1 in utf-8 konvertieren</title>
		<link>http://ww.sd.vc/wp/2011/01/09/dateien-rekursiv-von-iso-8859-1-in-utf-8-konvertieren/</link>
		<comments>http://ww.sd.vc/wp/2011/01/09/dateien-rekursiv-von-iso-8859-1-in-utf-8-konvertieren/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 21:43:37 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3301</guid>
		<description><![CDATA[immer wieder holen einem die gleichen probleme ein. gerade windows nutzer, die keine vernuenftigen editoren benutzen, machen dem rest das leben schwer. in 95% aller faelle ist es vollkommen schnurzegal, wie man seine dateien abspeichert. ein webserver unter linux nimmts halt etwas genauer (hat er ja auch recht). das passende shirt dazu (siehe bild) gibt [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2011/01/20110109_scheiss_encoding.jpg" alt="" title="20110109_scheiss_encoding" width="117" height="156" class="alignright size-full wp-image-3302" />immer wieder holen einem die gleichen probleme ein. gerade windows nutzer, die keine vernuenftigen editoren benutzen, machen dem rest das leben schwer. in 95% aller faelle ist es vollkommen schnurzegal, wie man seine dateien abspeichert. ein webserver unter linux nimmts halt etwas genauer (hat er ja auch recht). das passende shirt dazu (siehe bild) gibt bei <a href="http://www.getdigital.de/products/scheiss_encoding" target="_blank">getdigital</a></p>
<p>mal so als gedaechtnisstuetze fuer mich und falls jemand auch mal so ein problem hat. ich musste dateien einer webpraesenz auf einen neuen server umziehen. das problem dabei war, dass manche schon in utf-8 abgespeichert waren und der rest in iso-8859-1. abhilfe schafft ein kleines bash scriptchen, welches man als &#8220;convert.sh&#8221; abspeichert:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> UTF-<span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #666666; font-style: italic;"># datei ist kein utf-8 -&gt; auflisten</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;kein_utf8.txt&quot;</span>
    <span style="color: #666666; font-style: italic;"># konvertieren</span>
    iconv <span style="color: #660033;">-f</span> ISO-<span style="color: #000000;">8859</span>-<span style="color: #000000;">1</span> <span style="color: #660033;">-t</span> UTF-<span style="color: #000000;">8</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;$1&quot;</span>_conv
    <span style="color: #666666; font-style: italic;"># original loeschen</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
    <span style="color: #666666; font-style: italic;"># konvertierte datei umbenennen</span>
    <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #ff0000;">&quot;$1&quot;</span>_conv <span style="color: #ff0000;">&quot;$1&quot;</span>
    <span style="color: #666666; font-style: italic;"># falls das charset angegeben ist, dann ersetzen</span>
    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'s/charset=iso-8859-1/charset=utf-8/g'</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #666666; font-style: italic;"># datei ist bereits utf-8 -&gt; auflisten</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;ist_utf8.txt&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>sicherlich nicht das non plus ultra und noch verbesserungsfaehig, aber fuer meinen zweck hat es das getan. in der datei &#8220;kein_utf8.txt&#8221; werden die aufgelistet, die umgewandelt wurden und in der &#8220;ist_utf8.txt&#8221; nur die, die schon utf-8 encoding hatten.</p>
<p>diese datei ruft man dann einfach in dem verzeichnis auf, von dem aus man abwaerts die z.b. html dateien konvertieren will:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.html&quot;</span> <span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-t</span> .<span style="color: #000000; font-weight: bold;">/</span>convert.sh <span style="color: #ff0000;">'{}'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2011/01/09/dateien-rekursiv-von-iso-8859-1-in-utf-8-konvertieren/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>27c3</title>
		<link>http://ww.sd.vc/wp/2010/12/30/27c3/</link>
		<comments>http://ww.sd.vc/wp/2010/12/30/27c3/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 20:38:49 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[das leben]]></category>
		<category><![CDATA[nachrichten]]></category>
		<category><![CDATA[politik]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3257</guid>
		<description><![CDATA[wie (fast) jedes jahr war ich auch dieses jahr zwischen weihnachten und silvester beim chaos communication congress in berlin. inmitten von lauter club-mate-suechtigen gibt es immer wieder viel neues zu sehen und zu lernen. das mit der koerperhygiene scheinen die meisten nun hin zu bekommen und sogar mit anzug sind einige freaks rumgelaufen. mit serioesem, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-3258" title="20101227_fernsehturm" src="http://ww.sd.vc/wp/wp-content/uploads/2010/12/20101227_fernsehturm.jpg" alt="" width="300" height="659" />wie (fast) jedes jahr war ich auch dieses jahr zwischen weihnachten und silvester beim chaos communication congress in berlin. inmitten von lauter club-mate-suechtigen gibt es immer wieder viel neues zu sehen und zu lernen. das mit der koerperhygiene scheinen die meisten nun hin zu bekommen und sogar mit anzug sind einige freaks rumgelaufen. mit serioesem, schickem, whatever aussehen hatte das aber nichts zu tun, sondern hat eher an fasching erinnert.</p>
<p>aufgrund der wetterlage war ich ja schonmal froh, dass mein flugzeug ueberhaupt flog und mich heil nach berlin brachte. waehrend des fluges servierte die (wie immer) nette crew von air berlin lecker gluehwein.</p>
<p>weniger lustig war dann die taxi knappheit auf dem flughafen tegel. die leute haben sich fast gepruegelt, um mit einem taxi der kaelte entfliehen zu koennen, denn die schlange am taxistand wurde immer laenger statt kuerzer. ich konnte nach 20 minuten eines ergattern, das aber komischerweise keiner mit mir teilen wollte. eigentlich dachte ich, dass nur die stadt offenbach es nicht geregelt bekommen mit dem streuen und raeumen, aber in berlin ists noch schlechter. genauso hat es fuer mich den anschein, dass die regelung, dass man den schnee vor seiner haustuer wegraeumen muss, in berlin anscheinend nicht gilt, oder sich zumindest niemand daran haelt.</p>
<p>mein hotel war ok fuer den preis. modern, aber sehr spartanisch. fruehstueck bis um 11 uhr, 24h besetzte rezeption, getraenke und cafe-bar. nur die heizung in meinem zimmer wollte nicht funktionieren. mitten in der nacht habe ich dann aber anstandslos ein anderes bekommen.</p>
<p><img class="alignnone size-full wp-image-3259" title="20101228_wlan_for_mac" src="http://ww.sd.vc/wp/wp-content/uploads/2010/12/20101228_wlan_for_mac.jpg" alt="" width="465" height="265" /></p>
<p>eigentlich mehr als gedankenstuetze fuer mich gedacht, aber vielleicht findet ja jemand in der folgenden aufstellung was interessantes. die aufzeichnungen zu den vortraegen werden hoffentlich in ein paar tagen online sein.</p>
<p>am tag 1 des 27c3 habe ich mir in der zeit von 12:00 bis 22:45 vortraege und diskussionen zu diesen themen angesehen:</p>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4175.en.html" target="_blank">From robot to robot &#8211; Restoring creativity in school pupils using robotics</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4252.en.html" target="_blank">Von Zensursula über Censilia hin zum Kindernet &#8211; Jahresrückblick rund um Internet-Sperren, Sendezeitbegrenzungen im Internet und vermeintlichen Jugendschutz</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4185.en.html" target="_blank">Whistleblowing &#8211; Licht ins Dunkel!</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4164.en.html" target="_blank">Friede sei mit Euren Daten &#8211; Ein datenschutzrechtlicher Ausflug in ein kirchliches Parelleluniversum</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4094.en.html" target="_blank">Netzneutralität und QoS &#8211; ein Widerspruch? &#8211; Fakten auf den Tisch</a> war eine podiumsdiskussion und wurde live vom DLF im radio uebertragen. sehr sehens bzw. hoerenswert.</li>
</ul>
<ul>
<li> <a href="http://events.ccc.de/congress/2010/Fahrplan/events/4297.en.html" target="_blank">&#8220;Die gesamte Technik ist sicher&#8221; &#8211; Besitz und Wissen: Relay-Angriffe auf den neuen Personalausweis.</a> nachdem wir ja lle wissen, dass die basisleser sehr leicht angreifbar sind, haben ein paar studenten gezeigt, dass es mit den &#8220;sicheren&#8221; standard- und komfortesern auch nicht weit her ist.</li>
</ul>
<p><img class="alignnone size-full wp-image-3260" title="20101227_bike" src="http://ww.sd.vc/wp/wp-content/uploads/2010/12/20101227_bike.jpg" alt="" width="465" height="222" /></p>
<p><strong>tag 2: 11:30 bis 00:00 uhr</strong></p>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4081.en.html" target="_blank">Netzmedienrecht, Lobbyismus und Korruption &#8211; Wie wirkt die Lobby von Medienkonzernen? </a>&#8230; ist leider aufgrund des fernbleibens des vortragenden ausgefallen. als ersatz ist der eine mann vom <a href="http://events.ccc.de/congress/2010/Fahrplan/events/4185.en.html" target="_blank">whistleblowing vortrag</a> eingesprungen und hat seine ausfuehrungen vom vortag zu ende gebracht.</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4210.en.html" target="_blank">Lying To The Neighbours &#8211; Nasty effects with tracker-less BitTorrent </a>&#8230; konnte ich mir nicht zu ende ansehen. der votrag haette besser wie angekuendigt in deutscher sprache stattfinden sollen. das englisch des referenten war sehr anstrengend.</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4073.en.html" target="_blank">Logikschaltungen ohne Elektronik &#8211; logische Schaltungen mit Pneumatik </a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4090.en.html" target="_blank">The Baseband Apocalypse &#8211; all your baseband are belong to us </a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4263.en.html" target="_blank">The importance of resisting Excessive Government Surveillance &#8211; Join me in exposing and challenging the constant violations of our right to privacy </a></li>
</ul>
<p>zu sehen gabs wie immer tolle und nicht tolle sachen:</p>
<p><img class="alignnone size-full wp-image-3261" title="20101228_schoen_und_nicht_schoen" src="http://ww.sd.vc/wp/wp-content/uploads/2010/12/20101228_schoen_und_nicht_schoen.jpg" alt="" width="465" height="175" /></p>
<p><strong>tag 3: 11:30 bis 23:00 uhr</strong></p>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4298.en.html" target="_blank">CCC-Jahresrückblick 2010</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4326.en.html" target="_blank">Radio der Zukunft &#8211; Was kommt nach dem analogen Radio?</a> auch wieder live uebertragen im dlf oder irgend sowas in der art.</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4206.en.html" target="_blank">IMMI, from concept to reality &#8211; How far can wie bring the Icelandic Modern Media Initiative</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4187.en.html" target="_blank">Your Infrastructure Will Kill You</a> &#8230;hab ich nur angerissen. komisches amerikanisches geschwaetz.</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4211.en.html" target="_blank">Chip and PIN is broken &#8211; Vulnerabilities in the EMV Protocol</a> &#8230;kann ich nicht viel dazu sagen, denn zu beginn des vortrages habe ich den saal verlassen. das ding war gestopft voll, weil alle leute einen platz fuer die folgeveranstaltung (fefe&#8217;s und frank&#8217;s fnord jahresrueckblick) ergattern wollten. die auf dem boden sitzenden wurden aufgefordert, sich doch bitte hin zu stellen, damit mehr leute in den saal reinpassen. das war mir dann echt zu doof und ich bin gegangen. zurueck im hotel konnte ich gerade noch die letzten paar minuten davon per umts und livestrem verfolgen. aber eigentlich gings mir ja auch um den naechsten vortrag:</li>
</ul>
<ul>
<li> <a href="http://events.ccc.de/congress/2010/Fahrplan/events/4070.en.html" target="_blank">Fnord Jahresrückblick 2010 &#8211; von Atomausstieg bis Zwangsintegration</a> &#8230; wie immer lustig und quasi pfichtprogramm. das schauen des streams im hotelzimmer war trotz vorhandenem schoppen nicht sehr entspannend, da es alle paar minuten gestockt hat. nach zwanzig minuten bin ich dann auf den stream &#8220;slides only&#8221; mit ton umgestiegen. das hat dann besser funktioniert.</li>
</ul>
<p><img class="alignnone size-full wp-image-3267" title="20101229_gucken" src="http://ww.sd.vc/wp/wp-content/uploads/2010/12/20101229_gucken.jpg" alt="" width="465" height="210" /></p>
<p><strong>tag 3: 11:30 bis 19:00 uhr</strong></p>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4221.en.html" target="_blank">OMG WTF PDF &#8211; What you didn&#8217;t know about Acrobat</a> &#8230;warum man mit PDFs vorsichtig sein muss.</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4089.en.html" target="_blank">Ich sehe nicht, dass wir nicht zustimmen werden &#8211; Die Sprache des politischen Verrats und seiner Rechtfertigung</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4301.en.html" target="_blank">How the Internet sees you &#8211; demonstrating what activities most ISPs see you doing on the Internet</a></li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4230.en.html" target="_blank">Security Nightmares</a>&#8230; wie jedes jahr pflichtprogramm!</li>
</ul>
<p>wenn die videos der veranstaltung online sind, werde ich zuhause ein paar vortraege nachholen. z.b.:</p>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4295.en.html" target="_blank">High-speed high-security cryptography: encrypting and authenticating the whole Internet</a> (der artikel bei <a href="http://www.heise.de/newsticker/meldung/27C3-Vorschlag-zur-Rundum-Verschluesselung-des-Datenverkehrs-1161545.html" target="_blank">heise</a> hat mich erst richtig neugierig gemacht.)</li>
</ul>
<ul>
<li><a href="http://events.ccc.de/congress/2010/Fahrplan/events/4245.en.html" target="_blank">Adventures in analyzing Stuxnet</a> (oder <a href="http://www.heise.de/newsticker/meldung/27C3-Hacker-analysieren-Stuxnet-Maschinencode-1159659.html" target="_blank">heise</a>)</li>
</ul>
<ul>
<li>&#8230;und nich ein paar der vielen votraege ueber GSM. nicht, dass ich davon ahnung haette&#8230; ich bin aber neugierig, was da geht und wo es hin geht.</li>
</ul>
<p>abschliessend noch ein paar allgemeine worte (aus der high and wide perspektive). seit ein paar jahren steht ja schon die diskussion im raum, dass der congress in einer anderen location stattfinden koennte/sollte/muesste, da das bcc aus allen naehten platzt. dieses jahr gab es erstmals die karten im vorverkauf. gefuehlt waren weniger leute da, wobei ich mich da auch taeuschen koennte.</p>
<p>auf jeden fall hat sich der ganze congress geaendert im vergleich zu den letzten acht jahren, die ich (bis auf ein mal) da war. bei meinen ersten besuchen herrschte echt noch chaos. leute lagen einfach mit schlafsaecken in der ecke oder unter der treppe. ueberall wurde geraucht, so dass es teilweise schon eklig war. waehrend den vortraegen  lagen und sassen die leute in den gaengen rum. muellberge stapelten sich.</p>
<p>heute sieht das anders aus. alles laeuft geordnet ab. die saeaele haben (durch &#8220;ordner&#8221; gesteuert) festgelegte ein- und ausgaenge. die gaenge und ausgaenge muessen unbedingt freigehalten werden. die leute wurden aufgefordert, ihren muell ordnungsgemaess zu entsorgen. (frueher ist niemand ueber die muellberge gestolpert, aber heute gibts schon schwere unfaelle, wenn eine flasche auf dem boden rumliegt). zwischen den vortraegen gibt es <del datetime="2010-12-30T20:01:12+00:00">animateuere</del> pausenclowns die das publikum bei laune halten.</p>
<p>wie soll ich sagen&#8230; es ist (so scheint es zumindest) professioneller geworden. mich persoenlich nervten ein bischen die &#8220;engel&#8221;, die einem staendig irgendwas vorschreiben oder verbieten wollen bzw. muessen. klar, alles nachvollziehbar aus sicherheitsgruenden usw. die ganze veranstaltung ist nicht mehr so &#8220;authentisch&#8221; wie frueher. den permanenten schweissgeruch vermisse ich nicht, aber wenn leute anzug tragen, nur um irgendwas an ihrem image zu aendern oder cool auszusehen, finde ich das auch albern.</p>
<p>UPDATE: das mit den anzuegen hatte wohl einen <a href="http://blog.fefe.de/?ts=b3e6bf8b" target="_blank">hintergrund</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2010/12/30/27c3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mehr verschluesselung</title>
		<link>http://ww.sd.vc/wp/2010/11/27/mehr-verschluesselung/</link>
		<comments>http://ww.sd.vc/wp/2010/11/27/mehr-verschluesselung/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 07:22:54 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3148</guid>
		<description><![CDATA[als ich das erste mal was ueber die firefox erweiterung &#8220;https-everywhere&#8221; gehoert habe, stiegen in mir die erwartungen an dieses addon. ich hab mir sofort vorgestellt, dass dieses teil immer bei allen webseitenaufrufen ueberprueft, ob auch eine https variante existiert und dann dahin umleitet. natuerlich ist das nicht so einfach, wie man sich das vorstellt. [...]]]></description>
			<content:encoded><![CDATA[<p>als ich das erste mal was ueber die firefox erweiterung &#8220;<a href="https://www.eff.org/https-everywhere" target="_blank">https-everywhere</a>&#8221; gehoert habe, stiegen in mir die erwartungen an dieses addon. ich hab mir sofort vorgestellt, dass dieses teil immer bei allen webseitenaufrufen ueberprueft, ob auch eine https variante existiert und dann dahin umleitet. </p>
<p>natuerlich ist das nicht so einfach, wie man sich das vorstellt. vor allem deswegen, weil es manche webseitenbetreiber es einfach nicht hinbekommen, dass die ssl seite die gleiche ist wie die ohne ssl. bei groesseren systemen steigt natuerlich die komplexitaet enorm. siehe facebook&#8230; ein <a href="http://www.heise.de/security/meldung/Mehr-Verschluesselung-1141590.html" target="_blank">zitat von heise.de</a>:</p>
<blockquote><p>&#8220;Entschärft wurde die Facebook-Regel – in der bisherigen Version waren einige Facebook-Apps aufgrund eines Zertifikatsfehlers nicht nutzbar. Wer seine Facebook-Cookies vor Diebstahl mit Tools wie Firesheep schützen will – und auf die Apps verzichten kann – muss nach der Installation des Add-ons nun den erweiterten Regelsatz Facebook+ aktivieren. Wer hingegen den Facebook-Chat nutzen will, muss bei der Seite auf sämtliche Schutzmaßnahmen verzichten und alle Facebook-Regeln deaktivieren.&#8221;</p></blockquote>
<p>und den <a href="https://www.eff.org/https-everywhere/faq" target="_blank">faq</a> steht nochmal beschrieben, warum es nicht so einfach ist, wie ich mir das (ohne drueber nachzudenken) vorgestellt hatte:</p>
<blockquote><p>&#8220;There are several problems with the idea of trying to automatically detect HTTPS on every site. Firstly, there is no guarantee that sites are going to give the same response via HTTPS that they give via HTTP. As of 2010, LiveJournal is a good example of this problem: compare these HTTP and HTTPS responses. Secondly, we don&#8217;t think it&#8217;s possible to test for HTTPS in real time without introducing security vulnerabilities (What should the extension do if the HTTPS connection attempt fails? Falling back to insecure HTTP isn&#8217;t safe). Lastly, in some cases, HTTPS Everywhere has to perform quite complicated transformations on URIs — for example the Wikipedia rule turns an address like http://en.wikipedia.org/wiki/World_Wide_Web into one like https://secure.wikimedia.org/wikipedia/en/wiki/World_Wide_Web.&#8221;</p></blockquote>
<p>also ist es nun erstmal so, dass dieses addon nur die webseiten bedienen kann, die es auch von haus aus kennt. mag sein, dass da fuer viele was dabei ist, aber die seiten daraus, die ich persoenlich nutze, kann ich an einer hand abzaehlen: </p>
<p><a href="http://ww.sd.vc/wp/wp-content/uploads/2010/11/20101127_httpseverywhere.jpg" rel="lightbox[3148]" target="_blank"><img src="http://ww.sd.vc/wp/wp-content/uploads/2010/11/20101127_httpseverywhere-465x192.jpg" alt="" title="20101127_httpseverywhere" width="465" height="192" class="alignnone size-large wp-image-3149" /></a></p>
<p>wer will, kann sich eigene rulesets bauen und hinzufuegen. wie das geht steht hier geschrieben: <a href="https://www.eff.org/https-everywhere/rulesets" target="_blank">https://www.eff.org/https-everywhere/rulesets</a>. </p>
<p>fuer diese seite hier hab ichs mal gemacht und abgespeichert als sdvc.xml im verzeichnis &#8220;HTTPSEverywhereUserRules&#8221; unterhalb des firefox profile verzeichnises:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ruleset</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sd.vc&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">host</span>=<span style="color: #ff0000;">&quot;ww.sd.vc&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">host</span>=<span style="color: #ff0000;">&quot;www.sd.vc&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;^http://(ww?\.)?sd\.vc/&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;https://ww.sd.vc/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ruleset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>im screenshot rechts unten sieht man mein beispiel &#8220;sd.vc&#8221;. das kleine, aber feine plugin sollte aber nicht &#8220;https-everywhere&#8221; heissen sondern &#8220;https-somewhere&#8221; oder aehnlich&#8230; weil everywhere ist anders&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2010/11/27/mehr-verschluesselung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blogtuning</title>
		<link>http://ww.sd.vc/wp/2010/11/12/blogtuning/</link>
		<comments>http://ww.sd.vc/wp/2010/11/12/blogtuning/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 08:44:12 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3109</guid>
		<description><![CDATA[da diese webseite ja nur in einer kleinen, virtuellen maschine laeuft, die an einem lehmen dsl anschluss haengt, neige ich ja schon laenger dazu, die eingebetteten bilder vor dem hochladen so weit zu verkleinern, dass sie ins layout &#8220;reinpassen&#8221;. die qualitaet schraube ich zudem meist so weit runter dass man nicht mehr von schoenen bildern [...]]]></description>
			<content:encoded><![CDATA[<p>da diese webseite ja nur in einer kleinen, virtuellen maschine laeuft, die an einem lehmen dsl anschluss haengt, neige ich ja schon laenger dazu, die eingebetteten bilder vor dem hochladen so weit zu verkleinern, dass sie ins layout &#8220;reinpassen&#8221;. die qualitaet schraube ich zudem meist so weit runter dass man nicht mehr von schoenen bildern reden kann. ich sehe aber schon zu, dass die bilder entsprechend dem inhalt noch &#8220;nutzbar&#8221; sind. vor ein paar tagen habe ich dazu noch das apache modul &#8220;<a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" target="_blank">mod_deflate</a>&#8221; aktiviert. </p>
<p>das an sich geht ja ganz easy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ww:~<span style="color: #666666; font-style: italic;"># a2enmod deflate</span>
Enabling module deflate.
Run <span style="color: #ff0000;">'/etc/init.d/apache2 restart'</span> to activate new configuration<span style="color: #000000; font-weight: bold;">!</span></pre></div></div>

<p>damit diverse alte browser noch zurechtkommen, habe ich die datei /etc/apache2/mods-available/deflate.conf ergaenzt um zeilen 3 bis 5:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_deflate.c&gt;
  <span style="color: #00007f;">AddOutputFilterByType</span> DEFLATE text/html text/plain text/xml
  <span style="color: #00007f;">BrowserMatch</span> ^Mozilla/<span style="color: #ff0000;">4</span> gzip-only-text/html
  <span style="color: #00007f;">BrowserMatch</span> ^Mozilla/<span style="color: #ff0000;">4</span>\.0[<span style="color: #ff0000;">678</span>] no-gzip
  <span style="color: #00007f;">BrowserMatch</span> \bMSIE !no-gzip !gzip-only-text/html
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></td></tr></table></div>

<p>&#8230;und am ende der .htaccess datei im documentroot das hinzugefuegt:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">FilesMatch</span> <span style="color: #7f007f;">&quot;<span style="color: #000099; font-weight: bold;">\.</span>(js|css|html|htm|php|xml)$&quot;</span>&gt;
  <span style="color: #00007f;">SetOutputFilter</span> DEFLATE
&lt;/<span style="color: #000000; font-weight:bold;">FilesMatch</span>&gt;</pre></div></div>

<p><a href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">hier</a> gibts eine seite, mit der man dann ausprobieren kann, ob die komprimierung wie gewuenscht funktioniert. so sieht das ergebnis aus:</p>
<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2010/11/20101112_mod_deflate.gif" alt="" title="20101112_mod_deflate" width="313" height="110" class="alignnone size-full wp-image-3111" /></p>
<p>das ist doch schon mal ordentlich. um dann noch etwas bandbreite zu &#8220;sparen&#8221; habe ich ein paar bots per .htaccess datei ausgesperrt. die stellen zwar die anfrage, aber bekommen nur eine fehlermeldung zurueck. die hier angezeigte .htaccess ist stark verkuerzt. die komplette version gibts als <a href='http://ww.sd.vc/wp/wp-content/uploads/2010/11/htaccess.txt'>download</a></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;^AESOP_com_SpiderMan&quot;</span> bad_bot
<span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;^Alexibot&quot;</span> bad_bot
<span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;Anonymouse.org&quot;</span> bad_bot
<span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;^asterias&quot;</span> bad_bot
<span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;^attach&quot;</span> bad_bot
<span style="color: #00007f;">SetEnvIfNoCase</span> user-Agent <span style="color: #7f007f;">&quot;^BackDoorBot&quot;</span> bad_bot
[...]
&lt;<span style="color: #000000; font-weight:bold;">Files</span> *&gt;
<span style="color: #00007f;">Order</span> <span style="color: #00007f;">Allow</span>,<span style="color: #00007f;">Deny</span>
<span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
<span style="color: #00007f;">Deny</span> from env=bad_bot
&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;</pre></div></div>

<p>die liste mit den bad bots habe ich mir zusammengegoogelt. zum testen hab ich einfach mal den safari eingetragen. so wuerde das dann fuer einen bot &#8220;aussehen&#8221;, der in der .htaccess gelistet ist:</p>
<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2010/11/20101112_bad_bots_ausgesperrt.gif" alt="" title="20101112_bad_bots_ausgesperrt" width="465" height="220" class="alignnone size-full wp-image-3114" /></p>
<p>und im apache error-logfile steht dann:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">[Fri Nov <span style="color: #ff0000;">12</span> 09:<span style="color: #ff0000;">26</span>:<span style="color: #ff0000;">57</span> <span style="color: #ff0000;">2010</span>] [error] [client <span style="color: #ff0000;">85</span>.xxx.xx.xxx] 
client denied by server configuration: /xxxxxxx/sd.vc/wp/</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2010/11/12/blogtuning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tsql regex oder nicht regex (teil 2)</title>
		<link>http://ww.sd.vc/wp/2010/11/08/tsql-regex-oder-nicht-regex-teil-2/</link>
		<comments>http://ww.sd.vc/wp/2010/11/08/tsql-regex-oder-nicht-regex-teil-2/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 12:39:33 +0000</pubDate>
		<dc:creator>sd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background wissen]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://ww.sd.vc/wp/?p=3081</guid>
		<description><![CDATA[ich habe meine untersuchung der sehr beschraenkten moeglichkeiten regex mit microsofts tsql zu nutzen fortgefuehrt. dabei kam mir noch das &#8220;^&#8221; unter. laut dokumentation dient es der negierung: &#8220;Any single character not within the specified range&#8221;. was dann in der praxis wie beim vorangegangenen beispiel wieder nicht mit den kleinbuchstaben &#8220;[a-z]&#8221; funktioniert: der vollstaendigkeit halber [...]]]></description>
			<content:encoded><![CDATA[<p>ich habe <a href="http://ww.sd.vc/wp/2010/11/04/tsql-regex-oder-nicht-regex/">meine untersuchung der sehr beschraenkten moeglichkeiten</a> regex mit microsofts tsql zu nutzen fortgefuehrt. </p>
<p>dabei kam mir noch das &#8220;^&#8221; unter. laut dokumentation dient es der negierung: &#8220;Any single character not within the specified range&#8221;. was dann in der praxis <a href="http://ww.sd.vc/wp/2010/11/04/tsql-regex-oder-nicht-regex/">wie beim vorangegangenen beispiel</a> wieder nicht mit den kleinbuchstaben  &#8220;[a-z]&#8221; funktioniert:</p>
<p><img src="http://ww.sd.vc/wp/wp-content/uploads/2010/11/20101108_tsql_regex2.gif" alt="" title="20101108_tsql_regex2" width="250" height="207" class="alignnone size-full wp-image-3082" /></p>
<p>der vollstaendigkeit halber noch der code zum ergaenzen des ersten beispiels:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">CASE</span>
 <span style="color: #993333; font-weight: bold;">WHEN</span> <span style="color: #66cc66;">&#40;</span>wert <span style="color: #993333; font-weight: bold;">COLLATE</span> Latin1_General_CS_AS <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'[^a-z]'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">THEN</span> @x
  <span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #ff0000;">''</span> <span style="color: #993333; font-weight: bold;">END</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'[^a-z]'</span><span style="color: #66cc66;">,</span>
<span style="color: #993333; font-weight: bold;">CASE</span>
 <span style="color: #993333; font-weight: bold;">WHEN</span> <span style="color: #66cc66;">&#40;</span>wert <span style="color: #993333; font-weight: bold;">COLLATE</span> Latin1_General_CS_AS <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'[^A-Z]'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">THEN</span> @x
  <span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #ff0000;">''</span> <span style="color: #993333; font-weight: bold;">END</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'[^A-Z]'</span><span style="color: #66cc66;">,</span>
<span style="color: #993333; font-weight: bold;">CASE</span>
 <span style="color: #993333; font-weight: bold;">WHEN</span> <span style="color: #66cc66;">&#40;</span>wert <span style="color: #993333; font-weight: bold;">COLLATE</span> Latin1_General_CS_AS <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'[^0-9]'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">THEN</span> @x
  <span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #ff0000;">''</span> <span style="color: #993333; font-weight: bold;">END</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'[^0-9]'</span>
<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#93;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ww.sd.vc/wp/2010/11/08/tsql-regex-oder-nicht-regex-teil-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

