<?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>ALeX Kazik &#187; Linux</title>
	<atom:link href="https://alex.kazik.de/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://alex.kazik.de</link>
	<description>A blog about Retrocomputing‎ and more</description>
	<lastBuildDate>Wed, 30 Mar 2022 09:54:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Copy sparsebundle to disk on Linux</title>
		<link>https://alex.kazik.de/346/write-sparsebundle/</link>
		<comments>https://alex.kazik.de/346/write-sparsebundle/#comments</comments>
		<pubDate>Fri, 27 Mar 2015 09:00:45 +0000</pubDate>
		<dc:creator><![CDATA[alx]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[sparsebundle]]></category>

		<guid isPermaLink="false">https://alex.kazik.de/?p=346</guid>
		<description><![CDATA[I&#8217;ve figured out an pretty easy way to copy the contents of a OS X sparsebundle onto a whole disk on linux. First go into the Image.sparsebundle directory and have a look at the Info.plist. You need the values for size and band-size. Now in a shell enter: for i in $(seq 0 $(({size}/{band-size}-1))) ; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve figured out an pretty easy way to copy the contents of a OS X sparsebundle onto a whole disk on linux.<br />
First go into the Image.sparsebundle directory and have a look at the Info.plist. You need the values for size and band-size.<br />
Now in a shell enter:<br />
<code>for i in $(seq 0 $(({size}/{band-size}-1))) ; dd if=`printf "%x" $i` of={/dev/sdx} bs={band-size}c seek=$i ; done</code><br />
All in one line and replace everything in curly braces with the desired value, e.g. &#8220;{band-size}&#8221; => &#8220;8388608&#8221;.</p>]]></content:encoded>
			<wfw:commentRss>https://alex.kazik.de/346/write-sparsebundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FireWire hard disk emulation</title>
		<link>https://alex.kazik.de/295/firewire-hdd-emulation/</link>
		<comments>https://alex.kazik.de/295/firewire-hdd-emulation/#comments</comments>
		<pubDate>Mon, 09 Jun 2014 18:48:37 +0000</pubDate>
		<dc:creator><![CDATA[alx]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[FireWire]]></category>
		<category><![CDATA[lio]]></category>
		<category><![CDATA[sbp2]]></category>
		<category><![CDATA[targetcli]]></category>

		<guid isPermaLink="false">http://alex.kazik.de/?p=295</guid>
		<description><![CDATA[I&#8217;ve discovered a way to use a file on a computer as a FireWire Harddisk for another computer. This is a handy way to work with older Apple computers because it&#8217;s way easier than burning CD&#8217;s or using a read FW HDD. The setup is not that complicated but still there is some to do. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p>
<p>I&#8217;ve discovered a way to use a file on a computer as a FireWire Harddisk for another computer. This is a handy way to work with older Apple computers because it&#8217;s way easier than burning CD&#8217;s or using a read FW HDD.</p>
<p>The setup is not that complicated but still there is some to do.</p>
<p><span id="more-295"></span>And in advance: Only HDD&#8217;s are emulated. So you can&#8217;t use CD images (or at least not directly, for Mac OS X I&#8217;ve covered that below) and write access to the disk image is required (shouldn&#8217;t be a hurdle).</p>
<h2>Requirements</h2>
<ul>
<li>Computer with a FireWire interface (of course)</li>
<li>Linux with Kernel 3.4+ and the required module (firewire_sbp2)</li>
<li>targetcli to easily configure it</li>
</ul>
<p>I&#8217;ve tested Ubuntu 14.04 and Fedora 20 on my MacBook Pro (2009): &#8211; Ubuntu&#8217;s targetcli is not able to handle FireWire &#8211; Fedora 20 can be used from Live CD/USB and targetcli supports firewire</p>
<p>After this I&#8217;ve stopped searching for more distributions. And all instructions are for Fedora 20, I only used the Live mode but shouldn&#8217;t be different if installed.</p>
<h2>Setup</h2>
<ul>
<li>Boot into Fedora 20</li>
<li>Ensure you have a network connection to install packages</li>
<li>All commands are executed as root, so do a sudo in front of each command or login / gain access to root</li>
<li>Install targetcli: <code>yum install targetcli</code></li>
<li>Create a disk image or copy one, important: the file must be writeable</li>
<li>Use targetcli to set everything up</li>
</ul>
<h2>Disk images</h2>
<p>Fedora seem to not have HFS+ write support, but since a writeable file is required I added a new ExFat partition (with Disk Utility on OS X) to my system and installed the driver: <code>yum install fuse-exfat</code>.</p>
<p>I&#8217;ve mounted the partition by hand: <code>mount /dev/sha4 /mnt/images</code>.</p>
<p>It seems that targetcli does not work with files and paths which have spaces or the equal sign in it! You have to avoid them, also maybe in volume names because if automatically mounted they are used in the path.</p>
<p>Since only hard disks are emulated a cd imageg can still added but the computer will not boot from it (usually) becuase booting from HDD and CD are handeled differently.</p>
<p>But for OS X DVD&#8217;s it&#8217;s easy to convert them:</p>
<ul>
<li>Using Disk Utility on OS X create a new blank disk image
<ul>
<li>The image must be, of course, big enough to hold the DVD, mount the DVD and use the finder to get the size<br />
but don&#8217;t make the image too big because it will be stored uncompressed</li>
<li>Format: &#8220;Mac OS X Extended (Journaled)&#8221;, maybe without journaling for old OS X</li>
<li>Partitions: &#8220;Single partiotion &#8211; GUID Partition map&#8221; for Intel Macs and<br />
&#8220;Single partition &#8211; Apple Partition Map&#8221; for PowerPC Macs (the one you want to boot not the &#8220;server&#8221;)</li>
</ul>
</li>
<li>Copy all files form the DVD to the Image</li>
<li>Eject both</li>
<li>Use the image</li>
</ul>
<h2>targetcli Basics</h2>
<p>All commands can either be executed in the interactive targetcli shell or as a parameter to targetcli (for perforimg a single action).</p>
<p>In the interactive shell you can either walk around in the tree and perform actions there or pass the working directory as the first argument, examples</p>
<pre><code># "walk around"
cd /backstores
ls
# "as parameter"
/backstores ls
</code></pre>
<p>If not using the interactive shell you of course have always to use the second method. All commands here are given as direct calls to make them easier to batch.</p>
<h2>Usage</h2>
<p>Add a disk image: <code>targetcli /backstores/fileio create name=10.4-PPC file_or_dev=/mnt/images/10.4-PPC.dmg</code>. The name parameter is used to reference to this entry furthermore, feel free to add as many images as you want.</p>
<p>To create the FireWire system you have to figure out your &#8220;WWN&#8221; with <code>targetcli /sbp info</code> and then create it <code>targetcli /sbp create eui.64b9e8fffecd98ca</code>.</p>
<p>Add the image to firewire with: <code>targetcli /sbp/eui.64b9e8fffecd98ca/luns create /backstores/fileio.10.4-PPC</code>. You can add multiple images and all of them will be available.</p>
<p>Enable the FireWire system: <code>targetcli /sbp/eui.64b9e8fffecd98ca enable</code>.</p>
<p>With <code>targetcli / ls</code> you can get a listing of your current setup, here is mine:</p>
<pre><code>o- / ............................................................................... [...]
  o- backstores .................................................................... [...]
  | o- block ........................................................ [Storage Objects: 0]
  | o- fileio ....................................................... [Storage Objects: 1]
  | | o- 10.4-PPC ............... [/mnt/images/10.4-PPC.dmg (2.8GiB) write-back activated]
  | o- pscsi ........................................................ [Storage Objects: 0]
  | o- ramdisk ...................................................... [Storage Objects: 0]
  o- iscsi .................................................................. [Targets: 0]
  o- loopback ............................................................... [Targets: 0]
  o- sbp .................................................................... [Targets: 1]
  | o- eui.64b9e8fffecd98ca ........................................................ [...]
  |   o- luns .................................................................. [LUNs: 1]
  |     o- lun0 ............................. [fileio/10.4-PPC (/mnt/images/10.4-PPC.dmg)]
  o- vhost .................................................................. [Targets: 0]
</code></pre>
<p>Now it&#8217;s time to connect the FireWire cable to the two machines and use it.</p>
<p>Here you can see my boot selection screen with the FireWire image. And yes, it&#8217;s no FireWire symbol but it still is one and works.</p>
<p><a href="/wp-content/uploads/fwhdd-bootscreen.jpg"><img src="/wp-content/uploads/fwhdd-bootscreen-300x225.jpg" alt="fwhdd-bootscreen" width="300" height="225" class="alignnone size-medium wp-image-299" /></a></p>
<p>And a screenshot where you can see my attatched disk image.</p>
<p><a href="/wp-content/uploads/fwhdd-info.png"><img src="/wp-content/uploads/fwhdd-info-300x200.png" alt="fwhdd-info" width="300" height="200" class="alignnone size-medium wp-image-300" /></a></p>
<p>With <code>targetcli /sbp/eui.64b9e8fffecd98ca/luns delete 0</code> you can remove the 1st image from FireWire. You should add or remove luns only when the cable is not connected or the other computer is turned off. The images in &#8216;/backstores/fileio/&#8230;&#8217; does not have to be removed with the lun.</p>]]></content:encoded>
			<wfw:commentRss>https://alex.kazik.de/295/firewire-hdd-emulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apples Integers</title>
		<link>https://alex.kazik.de/183/apples-integers/</link>
		<comments>https://alex.kazik.de/183/apples-integers/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 14:29:57 +0000</pubDate>
		<dc:creator><![CDATA[alx]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[LP64]]></category>
		<category><![CDATA[NSInteger]]></category>

		<guid isPermaLink="false">http://alex.kazik.de/?p=183</guid>
		<description><![CDATA[I was wondering whether I should use int, long or NSInteger. It took me a bit but I figured it out! On OS X and iOS the following table shows you the the size of the types: char 8 bit short 16 bit int 32 bit long system size long long 64 bit So, on [&#8230;]]]></description>
				<content:encoded><![CDATA[<p> I was wondering whether I should use <code>int</code>, <code>long</code> or <code>NSInteger</code>. It took me a bit but I figured it out!</p>
<p>On OS X and iOS the following table shows you the the size of the types:</p>
<pre>char       8 bit
short     16 bit
int       32 bit
long      system size
long long 64 bit</pre>
<p>So, on 32bit OS X <code>long</code> is 32 bit, on 64bit OS X it&#8217;s 64 bit (unsure for iOS).</p>
<p><code>NSInteger</code> has always the size of an pointer.</p>
<p>Often asked: &#8220;Use int or NSInteger?&#8221;. Answer: use <code>NSInteger</code> for pointers, ok usually you should use the pointer type itself, and for everything else use the size you require.</p>
<p>If you want exactly 8 bits, use <code>int8_t</code> for sigend or <code>uint8_t</code> for unsigned, for an integer which has at least those bits, use (<code>u</code>)<code>int_least8_t</code> (analogue for 16/32/64 bits).</p>
<p>Performance: you can use (<code>u</code>)<code>int_fast8_t</code> for the fastest type, which can hold (<code>u</code>)<code>int_8_t</code>. But since (u)int_leastY_t and (u)int_fastY_t are defined as (u)intY_t on OS X and iOS it should make no difference. I use the direct types for when all the bits are used, and the fast types when I don&#8217;t use exactly but less bits.</p>
<p>At last: don&#8217;t forget the <code>LL</code> or <code>ULL</code> suffix for 64bit constants (you can use (<code>U</code>)<code>INT64_C(num)</code> for always the correct suffix, also for 8/16/32), and the &#8220;%lld&#8221; in a formatted string for 64bit variables.<br />
(example: <code>NSLog(@"number: %lld", 1LL << 48);</code>)</p>
<p>If you have more information or maybe corrections, please post a comment.</p>]]></content:encoded>
			<wfw:commentRss>https://alex.kazik.de/183/apples-integers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zero-Mailer</title>
		<link>https://alex.kazik.de/150/zero-mailer/</link>
		<comments>https://alex.kazik.de/150/zero-mailer/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 16:54:55 +0000</pubDate>
		<dc:creator><![CDATA[alx]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[MTA]]></category>
		<category><![CDATA[Nullmailer]]></category>
		<category><![CDATA[Zeromailer]]></category>

		<guid isPermaLink="false">http://alex.kazik.de/?p=150</guid>
		<description><![CDATA[This Zero-Mailer is even less than a nullmailer. It is a sendmail replacement which (basic configuration) send all mails to a single email address (ignoring the destination address). It&#8217;s desigend for servers, which are no mail servers, and only sends logs, notices and such things. So all other software (may be scripts, used from the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p> This Zero-Mailer is even less than a nullmailer. It is a sendmail replacement which (basic configuration) send all mails to a single email address (ignoring the destination address).</p>
<p>It&#8217;s desigend for servers, which are no mail servers, and only sends logs, notices and such things. So all other software (may be scripts, used from the web-server) have to use a SMTP server for outgoing mail (e.g. forum).</p>
<p>It can be configred that when sendmail is invoked by a user, that all those mails are going to another address. (the users which calls sendmail is important, not the destination).</p>
<p><span id="more-150"></span></p>
<p>example configuration:<br />
<code>[default]<br />
to = "destination@address"<br />
from = "sender@address"<br />
subject = "[Server] [To: %TO%] %SUBJECT%"</code></p>
<p>You can add more entries in that form, which usernames instead of &#8220;default&#8221;, in that case all mails sent by that user will be send to the specified address.</p>
<p>The options in detail:
<ul>
<li><code>disabled</code>, optional, defaults to false, if true no mail will be sent (for that user)
<li><code>to</code>, required, the destination
<li><code>host</code>, optional, the destination host, if omitted the MX record of the <code>to</code> address will be used
<li><code>subject</code>, optional, the subject, defaults to &#8220;<code>%SUBJECT%</code>&#8221; (placeholders: <code>%SUBJECT%</code> the original subject, <code>%TO%</code> the list of original recipients)
<li><code>from</code> optional, the sender address, default to &#8220;<code>user@hostname</code>&#8221;
</ul>
<p>Files:</p>
<ul>
<li>/etc/zeromail.conf
<li>/usr/sbin/sendmail
</ul>
<p>You may have problems after uninstalling all MTA software, because some software (e.g. logcheck) requires an installed MTA. I&#8217;ve fixed that problem by installing an dummy deb-package, which (says that it) provides an MTA.</p>
<p>This is the way I&#8217;m using it on my server and a proof of concept.</p>
<p>Some more explanations in the source.</p>
<p>Download: <p><img src="https://alex.kazik.de/wp-includes/images/crystal/archive.png" style="height:20px;vertical-align:middle;" /> <a href="https://alex.kazik.de/download/linux/zeromailer-0.3.tar.bz2" title="Download zeromailer 0.3">zeromailer 0.3</a> (7.2 KiB, 15. June 2010)</p></p>]]></content:encoded>
			<wfw:commentRss>https://alex.kazik.de/150/zero-mailer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
