<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sysop on Madprof's workshop</title><link>http://www.madprof.net/tags/sysop/</link><description>Recent content in Sysop on Madprof's workshop</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 17 Aug 2012 10:26:00 +0000</lastBuildDate><atom:link href="http://www.madprof.net/tags/sysop/index.xml" rel="self" type="application/rss+xml"/><item><title>Duel Booting, mapping UIDs for different filesystems</title><link>http://www.madprof.net/2012/08/17/duel-booting-mapping-uids-for-different-filesystems/</link><pubDate>Fri, 17 Aug 2012 10:26:00 +0000</pubDate><guid isPermaLink="false">https://blog.madprof.net/?p=315</guid><description>&lt;p&gt;I&amp;rsquo;m dual booting Debian &amp;amp; OSX on my work machine.&lt;/p&gt;
&lt;p&gt;In OSX, users are created starting with UIDs 1000.  So the admin user is 502, I&amp;rsquo;m 501, and so on.  Also, the &amp;lsquo;staff&amp;rsquo; group ID is 20.&lt;/p&gt;
&lt;p&gt;On Debian, users are created starting with UIDs 1000.  So I&amp;rsquo;m 1000, my testing blank account is 1001, and so on.  The &amp;lsquo;staff&amp;rsquo; group ID is 50.&lt;/p&gt;
&lt;p&gt;This is a bit of a problem when I want to share files.  Since it&amp;rsquo;s just me on the computer,&lt;br&gt;
technically I could just mount the drive with full read/write permission to me.  But I don&amp;rsquo;t want that.  I don&amp;rsquo;t want to be able to muck around with stuff outside my /home (or /Users/) directory without really trying hard.&lt;/p&gt;
&lt;p&gt;The way to do it is using &lt;a href="http://fuse.sourceforge.net/"&gt;FUSE&lt;/a&gt; and &lt;a href="http://code.google.com/p/bindfs/"&gt;bindfs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Debian squeeze comes with FUSE installed, and has bindfs, but the version of bindfs that comes in the repo wasn&amp;rsquo;t up to date enough, so you may need to compile your own.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sudo aptitude install bindfs libfuse-dev&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt; Download, compile and install a new bindfs:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://code.google.com/p/bindfs/"&gt;http://code.google.com/p/bindfs/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;tar -zxvf &lt;em&gt;whicheverfileversion&lt;/em&gt;.tar.gz&lt;br&gt;
cd &lt;em&gt;whicheverfileversion&lt;/em&gt;&lt;br&gt;
./configure&lt;br&gt;
make&lt;br&gt;
sudo make install&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Should now leave you with an up to date &lt;strong&gt;/usr/local/bin/bindfs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For the sake of example, I&amp;rsquo;ll show my set up.  /media/OSX is the original.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sudo /usr/local/bin/bindfs &amp;ndash;map=501/1000:@20/@50 OSX OSX&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sweet! It works!&lt;/p&gt;
&lt;p&gt;There will be quite a big performance hit from using bindfs.  Some benchmarks (linked from the bindfs page) reckon about 80%.  Not a problem for me here, since it&amp;rsquo;s fast enough.  But to be aware of.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a script which I put in /etc/init.d/osxfixperms.sh to run this on bootup.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#! /bin/sh&lt;br&gt;
### BEGIN INIT INFO&lt;br&gt;
# Provides:          osxfixperms &lt;br&gt;
# Required-Start:    fuse&lt;br&gt;
# Required-Stop:&lt;br&gt;
# Default-Start:     S&lt;br&gt;
# Default-Stop:      0 6&lt;br&gt;
# Short-Description: remount OSX drive with correct permissions.&lt;br&gt;
# Description:&lt;br&gt;
### END INIT INFO&lt;br&gt;
do_start() {&lt;br&gt;
    /usr/local/bin/bindfs &amp;ndash;map=501/1000:@20/@50 /media/OSX /media/OSX&lt;br&gt;
}&lt;br&gt;
case &amp;ldquo;$1&amp;rdquo; in&lt;br&gt;
  start|&amp;quot;&amp;quot;)&lt;br&gt;
    do_start&lt;br&gt;
    ;;&lt;br&gt;
  restart|reload|force-reload)&lt;br&gt;
    echo &amp;ldquo;Error: argument &amp;lsquo;$1&amp;rsquo; not supported&amp;rdquo; &amp;gt;&amp;amp;2&lt;br&gt;
    exit 3&lt;br&gt;
    ;;&lt;br&gt;
  stop)&lt;br&gt;
    umount /media/OSX&lt;br&gt;
    ;;&lt;br&gt;
  *)&lt;br&gt;
    echo &amp;ldquo;Usage: osxfixperms.sh [start|stop]&amp;rdquo; &amp;gt;&amp;amp;2&lt;br&gt;
    exit 3&lt;br&gt;
    ;;&lt;br&gt;
esac&lt;br&gt;
:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which I&amp;rsquo;ve then installed (on debian) with (as root)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;update-rc.d osxfixperms.sh defaults&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You&amp;rsquo;ll need to be mounting the OSX drive *BEFORE* this happens.  Generally, that means stuffing it in /etc/fstab in the appropriate way.  You can ask google / debian docs.  It&amp;rsquo;s fairly well documented.  Unlike using bindfs.&lt;/p&gt;
&lt;p&gt;There.&lt;br&gt;
Easy. (ish).&lt;/p&gt;</description></item><item><title>There is a reason...</title><link>http://www.madprof.net/2011/10/07/there-is-a-reason/</link><pubDate>Fri, 07 Oct 2011 09:07:00 +0000</pubDate><guid isPermaLink="false">https://blog.madprof.net/?p=20</guid><description>&lt;p&gt;There is a reason why I prefer text based / commandline / unix interfaces.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Why?&amp;rdquo; You may ask?&lt;/p&gt;
&lt;p&gt;So I had to update a website – basically changing from &amp;lsquo;2011&amp;rsquo; to &amp;lsquo;2012&amp;rsquo; – for someone.  Once I got in to the file manager (web based) I could find the graphics files to replace, reasonably easily, and upload new ones.&lt;/p&gt;
&lt;p&gt;But I needed to update the text of the banner.  No .html files, or .inc or anything to edit.&lt;/p&gt;
&lt;p&gt;So I went to the &amp;ldquo;WYSIWYG&amp;rdquo; editor section of the site.  I could edit everything, except that part.  And the footer.  And the page title. So, I could edit the &amp;ldquo;articles&amp;rdquo;, but not much else.&lt;/p&gt;
&lt;p&gt;After hunting around for a while, I decided to try the &amp;ldquo;Website Management&amp;rdquo; area.  Total different interface again, loads of settings boxes and tabs.  I found there on different pages where I could set the page title, and so on.  But I couldn&amp;rsquo;t find the banner! Anywhere!&lt;/p&gt;
&lt;p&gt;Eventually, this morning, I found it.&lt;/p&gt;
&lt;p&gt;In &amp;ldquo;Website Management&amp;rdquo; -&amp;gt; &amp;ldquo;Structure&amp;rdquo; -&amp;gt; &amp;ldquo;Website Settings&amp;rdquo; -&amp;gt; &amp;ldquo;Code Injection&amp;rdquo; -&amp;gt; &amp;ldquo;Advanced&amp;rdquo; -&amp;gt; &amp;ldquo;Site Banner HTML Override &amp;ndash; Edited&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I hadn&amp;rsquo;t found it before, because the section I needed was &amp;ldquo;Site Banner HTML Override&amp;rdquo;, and to find that, I needed to look through a drop-down box which was displaying &amp;ldquo;Extra Header Code (within )&amp;rdquo; with some javascript includes.&lt;/p&gt;
&lt;p&gt;SERIOUSLY.&lt;/p&gt;
&lt;p&gt;What is wrong with just having a bunch of text files, and then letting me type&lt;/p&gt;
&lt;p&gt;&amp;ldquo;grep 2011 *&amp;rdquo;&lt;/p&gt;
&lt;p&gt;And it giving me a list of files to edit?  HOW is this graphical interface any easier?&lt;/p&gt;
&lt;p&gt;OK.  So &amp;lsquo;grep&amp;rsquo; isn&amp;rsquo;t common English, I know.  Learning basic unix does have a steep looking learning curve.  At first.&lt;/p&gt;
&lt;p&gt;In case you&amp;rsquo;re interested, I started, months and months ago, writing an &amp;ldquo;English-like&amp;rdquo; command shell.&lt;/p&gt;
&lt;p&gt;So you could type commands like:&lt;/p&gt;
&lt;p&gt;&amp;ldquo;list all files which contain 2011&amp;rdquo;&lt;/p&gt;
&lt;p&gt;and it should tell you.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s on sourceforge, the first alpha versions of the code.&lt;br&gt;
&lt;a href="http://www.blogger.com/goog_1739586617"&gt;&lt;br&gt;
&lt;/a&gt;&lt;br&gt;
&lt;a href="http://sourceforge.net/projects/daftshell/"&gt;http://sourceforge.net/projects/daftshell/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The whole idea of &amp;rsquo;natural language&amp;rsquo; interfaces fascinates me.  I should work on daftshell again, one of these days.&lt;/p&gt;
&lt;p&gt;So. Yeah.  Graphical &amp;ldquo;easy&amp;rdquo; systems aren&amp;rsquo;t always easy.&lt;/p&gt;</description></item></channel></rss>