<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rdf:RDF [
<!ENTITY % HTMLlat1 PUBLIC
 "-//W3C//ENTITIES Latin 1 for XHTML//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
]>
<rdf:RDF
 xmlns="http://purl.org/rss/1.0/"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:admin="http://webns.net/mvcb/"
>
<channel rdf:about="http://www.tuxx-home.at">
<title>bash</title>
<link>http://www.tuxx-home.at/archives/cat_7/</link>
<description>News from the front</description>
<dc:language>en-us</dc:language>
<dc:creator>Alexander Griesser</dc:creator>
<dc:date>2007-11-11T10:32:32+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.tuxx-home.at/archives/2007/02/01/T17_12_21/" />
<rdf:li rdf:resource="http://www.tuxx-home.at/archives/2006/03/27/T13_14_48/" />
<rdf:li rdf:resource="http://www.tuxx-home.at/archives/2005/02/16/T13_36_14/" />
<rdf:li rdf:resource="http://www.tuxx-home.at/archives/2004/12/01/T16_00_40/" />
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://www.tuxx-home.at/archives/2007/02/01/T17_12_21/">
<link>http://www.tuxx-home.at/archives/2007/02/01/T17_12_21/</link>
<title>Backing up data from a dead Sony Ericsson T630</title>
<dc:date>2007-02-01T17:12:21+01:00</dc:date>
<dc:creator>Alexander Griesser</dc:creator>
<dc:subject>bash</dc:subject>
<description><![CDATA[Today, a workmate has smashed his Sony Ericsson T630 on the ground and the
display broke. The mobile itself seemed to be alive, though. Now we had
to find out, how to activate the infrared connection to transfer files from
the phone to my computer. After some googline, we found out how to do that in &quot;blind&quot; mode:<br /><br />
<pre>
Press:
menu button | 8 | 8 | 6 | 2
</pre>
<br />
Afterwards the phone tries to send a file called &quot;Whole phonebook.vcf&quot; to the other side of the infrared
connection. That worked well, _BUT_ this vcf file is of invalid syntax as it contains all contacts in one big vcf
file and therefore we need to split it up. I wrote a small shell script to do that, so if anyone is interested:<br /><br />
<pre style="background-color: transparent; color: #ffffff;">
<font color="#00ffff"><b>#!/bin/bash</b></font>
<font color="#00ffff"><b># This script contains some bashisms and therefore may need bash,</b></font>
<font color="#00ffff"><b># especially the counter arithmetic is bashy</b></font>
<font color="#00ffff"><b>#</b></font>
<font color="#00ffff"><b># Besides that, this script parses a single vcf file generated by many</b></font>
<font color="#00ffff"><b># Sony Ericsson phones and produces single vcf files (one per contact)</b></font>
<font color="#00ffff"><b># suitable for importing them into Outlook, etc.</b></font>
<font color="#00ffff"><b>#</b></font>
<font color="#00ffff"><b># by Alexander Griesser &lt;work@tuxx-home.at&gt; 2007</b></font>
die<font color="#ffff00"><b>()</b></font> <font color="#ff6060"><b>{</b></font> <font color="#ffff00"><b>echo</b></font><font color="#ff40ff"><b> </b></font><font color="#ffff00"><b>&quot;</b></font><font color="#8080ff"><b>$*</b></font><font color="#ffff00"><b>&quot;;</b></font> <font color="#ffff00"><b>exit</b></font> <font color="#ff40ff"><b>1</b></font><font color="#ffff00"><b>;</b></font> <font color="#ff6060"><b>}</b></font>
<font color="#ffff00"><b>[</b></font> <font color="#ffff00"><b>&quot;</b></font><font color="#8080ff"><b>$#</b></font><font color="#ffff00"><b>&quot;</b></font> <font color="#ffff00"><b>=</b></font> <font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>1</b></font><font color="#ffff00"><b>&quot;</b></font> <font color="#ffff00"><b>]</b></font> <font color="#ffff00"><b>||</b></font> die <font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>usage: </b></font><font color="#8080ff"><b>$(</b></font><font color="#ff6060"><b>basename </b></font><font color="#8080ff"><b>$0</b></font><font color="#8080ff"><b>)</b></font><font color="#ff40ff"><b> phonebookfile.vcf</b></font><font color="#ffff00"><b>&quot;</b></font>
<font color="#ffff00"><b>[</b></font> <font color="#ffff00"><b>-r</b></font> <font color="#ffff00"><b>&quot;</b></font><font color="#8080ff"><b>$1</b></font><font color="#ffff00"><b>&quot;</b></font> <font color="#ffff00"><b>]</b></font> <font color="#ffff00"><b>||</b></font> die <font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>cannot read </b></font><font color="#8080ff"><b>$1</b></font><font color="#ffff00"><b>&quot;</b></font>
<font color="#00ffff"><b>COUNTER</b></font>=<font color="#ff40ff"><b>0</b></font>
while <font color="#ffff00"><b>read</b></font> line<font color="#ffff00"><b>;</b></font> <font color="#ffff00"><b>do</b></font>
  <font color="#ffff00"><b>echo</b></font><font color="#ff40ff"><b> </b></font><font color="#ffff00"><b>&quot;</b></font><font color="#8080ff"><b>$line</b></font><font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b> </b></font><font color="#ffff00"><b>&gt;&gt;</b></font><font color="#8080ff"><b>$COUNTER</b></font>.vcf
  <font color="#ffff00"><b>if</b></font> <font color="#ffff00"><b>echo</b></font><font color="#ff40ff"><b> </b></font><font color="#ffff00"><b>&quot;</b></font><font color="#8080ff"><b>$line</b></font><font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b> </b></font><font color="#ffff00"><b>|</b></font> <font color="#ffff00"><b>grep</b></font> <font color="#ffff00"><b>-q</b></font> <font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>^END:VCARD</b></font><font color="#ffff00"><b>&quot;;</b></font> <font color="#ffff00"><b>then</b></font>
    <font color="#00ffff"><b>COUNTER</b></font>=<font color="#8080ff"><b>$((</b></font><font color="#ff6060"><b>COUNTER + </b></font><font color="#ff40ff"><b>1</b></font><font color="#8080ff"><b>))</b></font>
  <font color="#ffff00"><b>fi</b></font>
<font color="#ffff00"><b>done</b></font> <font color="#ffff00"><b>&lt;</b></font> <font color="#8080ff"><b>$1</b></font>
</pre>
<br /><br />
<strong>Usage:</strong><br />
<pre>
# chmod 755 splitupvcf.sh
# ./splitupvcf.sh "Whole phonebook.vcf"
#
</pre>
<br />
<span class="uln bold">Links:</span><br />
<ul>
  <li><a class="external" href="http://www.se-community.com/forum/viewtopic.php?t=24163">http://www.se-community.com/forum/viewtopic.php?t=24163</a></li>
  <li><a class="file" href="/projects/splitupvcf/splitupvcf.sh">splitupvcf.sh</a>
</ul>]]></description>
</item>
<item rdf:about="http://www.tuxx-home.at/archives/2006/03/27/T13_14_48/">
<link>http://www.tuxx-home.at/archives/2006/03/27/T13_14_48/</link>
<title>Automatically getting a list of all telephone city codes for Austria/Germany</title>
<dc:date>2006-03-27T13:14:48+01:00</dc:date>
<dc:creator>Alexander Griesser</dc:creator>
<dc:subject>bash</dc:subject>
<description><![CDATA[Today I needed a list of all Citys, their ZIP-Codes and telephone city codes
for Austria. Getting the ZIP-Codes wasn't that difficult, because the
Austrian postal agency provides such a list for download on their website
(see external links section below).<br /><br />
I searched quite some time on the web but didn't find anything similar for
the telephone city codes, but I found a website that does have a quite
recent listing of all austrian telephone city codes, so I started to write
a script that downloads the information from this website.<br />
This script should also work - after some minor modifications - to work with
the german city codes part of this website, so if you are interested in it,
write me an e-mail.<br /><br />
As this is only a q'n'd workaround I would be very grateful if anyone
knows about a place where I can download a really recent list of austrian
city codes.<br /><br />
<span class="uln bold">Update:</span><br />
One of the maintainers of this website asked me to put this script down to 
avoid unnecessary traffic to his site. As this script is nothing illegal
and everyone with at least some knowledge in any scripting language is able
to rebuild it, I'm putting it down to avoid bad blood.<br /><br />
<span class="uln bold">Downloads:</span><br />
<ul>
  <li><a class="file" href="/projects/ccfetch/cc-sorted.txt">The sorted outputfile for Austria so that you don't need to run this script yourself ;)</a></li>
</ul><br />

<span class="uln bold">External Links:</span><br />
<ul>
  <li>Austrian ZIP-Code directory [<a class="external" href="http://www.post.at/content/online_service/download/online_service_download_plzverz.html">http://www.post.at/content/online_service/download/online_service_download_plzverz.html</a>]</li>
  <li>German and international country and city codes [<a class="external" href="http://www.vorwahl-nummern.de">http://www.vorwahl-nummern.de</a>]</li>
</ul>]]></description>
</item>
<item rdf:about="http://www.tuxx-home.at/archives/2005/02/16/T13_36_14/">
<link>http://www.tuxx-home.at/archives/2005/02/16/T13_36_14/</link>
<title>restore-dpkg-status skript</title>
<dc:date>2005-02-16T13:36:14+01:00</dc:date>
<dc:creator>Alexander Griesser</dc:creator>
<dc:subject>bash</dc:subject>
<description><![CDATA[In cases, where your /var/lib/dpkg/status file is corrupt it's very difficult
to restore it properly, so I wrote this little script to rebuild the status file.
<br /><br />
Since the first version of this script never really worked, I wrote a new one today
which works flawlessly (as far as I could test that on my systems). This script tries
to rebuild the status-file by using the package-information (grep from /var/lib/dpkg/available)
of all installed packages (ls in /var/lib/dpkg/info/).
<br /><br />
Feature Requests, Comments or Bugreports via e-mail, please.
<br /><br />
You can download this script <a class="file" href="/projects/restore-dpkg-status.sh">here [BASH]</a> and
there's also a html-version of the syntax-highlighted code available <a href="/projects/restore-dpkg-status.sh.html">here [EN]</a>.
<br /><br />
Please read the comment-section on top of the script before first use!]]></description>
</item>
<item rdf:about="http://www.tuxx-home.at/archives/2004/12/01/T16_00_40/">
<link>http://www.tuxx-home.at/archives/2004/12/01/T16_00_40/</link>
<title>Linux playing faxserver</title>
<dc:date>2004-12-01T16:00:40+01:00</dc:date>
<dc:creator>Alexander Griesser</dc:creator>
<dc:subject>bash</dc:subject>
<description><![CDATA[Today I struggled quite a few hours with getting <a class="file" href="http://nleinternet.net/doc/mgetty-contrib-1.1.21/g3tolj.c">g3tolj</a> to print incoming
faxes properly. 99% of all faxes were printed perfectly, but there's another
1% of faxes that occupied two printed pages instead of one.

So, as you could guess, this post is for everyone, who has the same problem.
<br />
<pre>
RES=$(basename $FAX | sed 's/.\(.\).*/\1/')

if [ "$RES" = "n" ]; then
  STRETCH="-aspect 2.0"
else
  STRETCH=""
fi

g3tolj $STRETCH $FAX | lp -d $PRINTER
</pre>
<br />
While trying to understand the G3-Format by reading tons of regarding documents
on the web, I stumbled across <a class="external" href="http://www.elilabs.com/mgarc/05-96/archive/0006.html">this information</a>, that mgetty already sorts out
such faxes for me by renaming them to <strong>fn</strong> instead of <strong>ff</strong>...
Well, it works now and that's important.]]></description>
</item>
</rdf:RDF>
