<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D08EQXo7cSp7ImA9WhVUFU0.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331</id><updated>2012-05-20T02:23:20.409-07:00</updated><category term="nptl" /><category term="macos" /><category term="active directory" /><category term="synergy" /><category term="so" /><category term="Dell Vostro 3550" /><category term="display" /><category term="rsync" /><category term="uinput" /><category term="gentoo" /><category term="gadgets" /><category term="backlight" /><category term="ntfs volume mount point" /><category term="lvm" /><category term="ghostscript" /><category term="modesetting" /><category term="pairing" /><category term="banshee" /><category term="ldapmodify" /><category term="widescreen" /><category term="channels" /><category term="bless" /><category term="iphone" /><category term="ggl" /><category term="zeroconf" /><category term="altServer" /><category term="dov4l" /><category term="gs" /><category term="G200eW" /><category term="gaim" /><category term="convert pdf" /><category term="v4l" /><category term="Mac" /><category term="video4linux" /><category term="pam" /><category term="mdadm" /><category term="efi" /><category term="tv" /><category term="grub-efi" /><category term="raid" /><category term="kerberos" /><category term="bind" /><category term="move documents and settings" /><category term="broken" /><category term="lame" /><category term="tv card" /><category term="delete excluded" /><category term="pdf restrictions" /><category term="itunes remote" /><category term="remote reboot" /><category term="kms" /><category term="gdm" /><category term="mysql" /><category term="ntfs" /><category term="arch" /><category term="gssapi" /><category term="Xorg" /><category term="i915" /><category term="pdf" /><category term="filter" /><category term="usb flash drive" /><category term="ldapadd" /><category term="initrd" /><category term="macmini" /><category term="winbind" /><category term="intel" /><category term="ubuntu 10.04" /><category term="samba4" /><category term="ebuild" /><category term="dhcp" /><category term="ubuntu" /><category term="ipod touch" /><category term="itunes" /><category term="x264" /><category term="google" /><category term="setup" /><category term="grub" /><category term="gparted" /><category term="alfresco 3.3" /><category term="syslinux" /><category term="apple" /><category term="nss" /><category term="reboot" /><category term="perl" /><category term="maverick" /><category term="refit" /><category term="lucid" /><category term="2ndw" /><category term="remote keyboard" /><category term="tomcat" /><category term="softraid" /><category term="contextcsn" /><category term="gzip" /><category term="youtube" /><category term="hoffman" /><category term="curl" /><category term="http" /><category term="osx" /><category term="mplayer" /><category term="tomcat6" /><category term="sqlite3" /><category term="lts" /><category term="mp4" /><category term="avahi" /><category term="subschema" /><category term="945" /><category term="ldap" /><category term="delete" /><category term="touchmoused" /><category term="frontend" /><category term="olcAccess" /><category term="itouch" /><category term="logitech touch mouse" /><category term="tuner" /><category term="windows" /><category term="ext4" /><category term="alfresco share" /><category term="slapd" /><category term="genkernel" /><category term="grub2" /><category term="v4l2src" /><category term="OpenLdapRootDSE" /><category term="ubuntu-desktop" /><category term="comments" /><category term="hfsplus" /><category term="flash drive" /><category term="touch mouse" /><category term="pxe" /><category term="lid" /><category term="awn" /><category term="gstreamer" /><category term="linux" /><category term="recovery" /><category term="slapadd" /><category term="alfresco" /><category term="glue" /><category term="usb" /><category term="howto" /><category term="convert" /><category term="sqlite" /><category term="remote" /><category term="mac os x" /><category term="DELL PowerEdge T110" /><category term="flv" /><category term="noob" /><category term="ssh" /><category term="daap" /><category term="Matrox" /><category term="mythtv" /><category term="openldap" /><category term="samsung" /><category term="config" /><category term="television" /><category term="915" /><category term="alfresco ubuntu" /><category term="remote mouse" /><category term="stack" /><category term="objectclass" /><category term="sudo" /><category term="olcDefaultSearchBase" /><category term="matroska" /><category term="slapindex" /><category term="mac mini" /><category term="kernel" /><category term="dlna" /><category term="grub4dos" /><category term="server" /><category term="samba" /><category term="gst-plugins" /><category term="gcc" /><category term="olcRootDSE" /><category term="lucid lynx" /><category term="xnest" /><category term="ldif" /><category term="bonjour" /><category term="fdisk" /><category term="netcat" /><category term="rootDSE" /><title>mycroes' blog</title><subtitle type="html">There's always time to play</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.mycroes.nl/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MycroesBlog" /><feedburner:info uri="mycroesblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DU4NRXo4eip7ImA9WhVWEE0.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-5931888606014853889</id><published>2012-04-21T04:33:00.001-07:00</published><updated>2012-04-21T04:33:14.432-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-21T04:33:14.432-07:00</app:edited><title>When security matters ...</title><content type="html">... password restrictions are retarded. When I wanted to activate an online account for my creditcard I entered the same secure password I always use, but guess what, it was not accepted. The password restrictions are as follows:

&lt;blockquote&gt;Het door u gekozen wachtwoord voldoet niet aan de eisen. Uw wachtwoord moet bestaan uit minimaal &amp;eacute;&amp;eacute;n cijfer en vijf letters. De maximale lengte is tien cijfers en/of letters. Leestekens en symbolen zoals !@#$%&amp;^*_ worden niet herkend. Let op: uw wachtwoord is hoofdlettergevoelig.&lt;/blockquote&gt;

... in English:

&lt;blockquote&gt;The chosen password does not meet our requirements. Your password has to contain at least one digit and five characters. The maximum length is ten digits and/or characters. Punctuation marks and symbols such as !@#$%&amp;^*_ are not recognized. Attention: your password is case sensitive.&lt;/blockquote&gt;

Seriously? Please &lt;em&gt;International Card Services&lt;/em&gt;, get your stuff together and stop the retarded password restrictions and accept secure passwords for a change...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-5931888606014853889?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8kCpcIRyB4IxP_zsYrfEwezofsA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8kCpcIRyB4IxP_zsYrfEwezofsA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8kCpcIRyB4IxP_zsYrfEwezofsA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8kCpcIRyB4IxP_zsYrfEwezofsA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/Fh9WV2YxYvM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/5931888606014853889/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=5931888606014853889" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5931888606014853889?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5931888606014853889?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/Fh9WV2YxYvM/when-security-matters.html" title="When security matters ..." /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2012/04/when-security-matters.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQHSXk9eCp7ImA9WhRbGUw.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-4908993593319383143</id><published>2012-02-10T10:50:00.000-08:00</published><updated>2012-02-10T14:52:18.760-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-10T14:52:18.760-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="active directory" /><category scheme="http://www.blogger.com/atom/ns#" term="winbind" /><category scheme="http://www.blogger.com/atom/ns#" term="sudo" /><category scheme="http://www.blogger.com/atom/ns#" term="samba4" /><category scheme="http://www.blogger.com/atom/ns#" term="kerberos" /><category scheme="http://www.blogger.com/atom/ns#" term="ssh" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="pam" /><category scheme="http://www.blogger.com/atom/ns#" term="nss" /><title>Linux integration with Active Directory: part 1</title><content type="html">At work I've been running Samba 4 for quite a while. Because Samba 4 is still in Alpha I didn't just move everything over to use Samba 4 for authentication, but instead I started out by moving services over one by one. I actually started with e-mail routing (will detail in a later post) and authentication. Later on I added proxy authentication and fileserver authentication / authorization, Windows XP and Windows 7 clients and last but not least actual Linux (PAM) user authentication.&lt;br /&gt;&lt;br /&gt;In this post I will detail how to join a (Debian / Ubuntu) Linux machine to the domain, setup Kerberos, setup nss to make Linux aware of domain users and setting up PAM to allow domain user authentication. I'm using Samba 4 as Active Directory implementation, however this should all just work against a Windows server hosted Active Directory as well. I'm going to make use of a feature that requires Windows Server 2003R2 or newer, or IDMU (&lt;a href="http://technet.microsoft.com/de-de/library/cc782782%28WS.10%29.aspx" title="IDMU"&gt;Identity Management for Unix&lt;/a&gt;), but that's only used to store the users' shell in Active Directory.&lt;br /&gt;&lt;br /&gt;First off, I'm assuming that DNS is properly set up. It's not needed, since both Kerberos and Samba can be made to work without DNS, but best case that means a lot of hosts file mess on almost all involved computers. Honestly it's easier to even do a manual DNS setup than to keep such a hosts file mess up to date. I will detail some parts for the non-DNS case as well, since it's useful information.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up Kerberos&lt;/h3&gt;&lt;br /&gt;Now on to the real work. Setting up Kerberos is really easy:&lt;pre&gt;# &lt;em&gt;apt-get install krb5-config&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should probably ask just one question: the default Kerberos realm. This normally is the uppercase Active Directory domain name. If you don't have DNS setup it will also ask two more questions:&lt;ul&gt;&lt;li&gt;The kerberos servers&lt;/li&gt;&lt;li&gt;The kerberos admin servers&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;These are the Active Directory Domain Controllers (although Samba 4 doesn't provide the kadmin interface right now). You probably need to add these to your hosts file as well.&lt;br /&gt;&lt;br /&gt;If you actually want to check if it's working, you should probably install &lt;em&gt;krb5-user&lt;/em&gt; as well and try to do a &lt;code&gt;&lt;em&gt;kinit&lt;/em&gt;&lt;/code&gt; to acquire a Kerberos ticket, but if you've done a few servers you'll probably believe me when I tell you you don't need krb5-user for Kerberos support.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Joining the domain&lt;/h3&gt;&lt;br /&gt;Now it's time to join the Linux machine to the domain (since Kerberos is working). We start by installing winbind:&lt;pre&gt;# &lt;em&gt;apt-get install winbind&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;/etc/init.d/winbind stop&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;We don't need an active winbind instance around, so let's stop it right away. If &lt;em&gt;smbd&lt;/em&gt; or &lt;em&gt;nmbd&lt;/em&gt; are running stop those as well.&lt;br /&gt;&lt;br /&gt;Now continue by editing &lt;em&gt;/etc/samba/smb.conf&lt;/em&gt; to contain all of the required configuration for Active Directory support:&lt;pre&gt;[global]&lt;br /&gt;netbios name = &lt;em&gt;yourhostname&lt;/em&gt;&lt;br /&gt;server string = &lt;em&gt;your host description&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;realm = &lt;em&gt;YOUR.REALM&lt;/em&gt;&lt;br /&gt;workgroup = &lt;em&gt;YOURWORKGROUP&lt;/em&gt;&lt;br /&gt;security = ADS&lt;br /&gt;local master = no&lt;br /&gt;preferred master = no&lt;br /&gt;dns proxy = no&lt;br /&gt;&lt;br /&gt;# set password server if you don't have functional DNS&lt;br /&gt;#password server = dc.domain.tld&lt;br /&gt;&lt;br /&gt;encrypt passwords = true&lt;br /&gt;# setting kerberos method = system keytab prevents pam_winbind from&lt;br /&gt;# authenticating users for me, but the following does work&lt;br /&gt;kerberos method = secrets and keytab&lt;br /&gt;&lt;br /&gt;# Using winbind default domain = yes makes usernames work without domain part&lt;br /&gt;winbind use default domain = yes&lt;br /&gt;winbind enum groups = yes&lt;br /&gt;winbind enum users = yes&lt;br /&gt;# winbind nss info = rfc2307 makes winbind use posix attributes from AD&lt;br /&gt;winbind nss info = rfc2307&lt;br /&gt;&lt;br /&gt;# map untrusted to domain = yes allows any user to be mapped to the domain user&lt;br /&gt;# with the same username, but also prevents local samba accounts from being used&lt;br /&gt;map untrusted to domain = no&lt;br /&gt;&lt;br /&gt;# template homedir can be used to designate the location of users' home&lt;br /&gt;# directories&lt;br /&gt;template homedir = /home/%U&lt;br /&gt;# template shell defines the default shell for when none is set in the posix&lt;br /&gt;# loginShell attribute for a user. Setting this to /bin/false allows login only&lt;br /&gt;# for those users that have this attribute set. pam_winbind also has an option&lt;br /&gt;# to limit access to several groups only, which is actually a real security&lt;br /&gt;# measure unlike this attribute which might be changed by users&lt;br /&gt;template shell = /bin/false&lt;br /&gt;&lt;br /&gt;# The first two idmap lines are for the domain, the other two for local samba&lt;br /&gt;# accounts. Using the rid backend maps the ids to the end of the user's SID,&lt;br /&gt;# which makes consistent id mapping across servers possible.&lt;br /&gt;idmap config &lt;em&gt;yourworkgroup&lt;/em&gt; : backend = rid&lt;br /&gt;idmap config &lt;em&gt;yourworkgroup&lt;/em&gt; : range = 10000 - 49999&lt;br /&gt;idmap uid = 50000 - 100000&lt;br /&gt;idmap gid = 50000 - 100000&lt;/pre&gt;Replace all the fields in bold with values applicable to your domain.&lt;br /&gt;&lt;br /&gt;Now it's time to join the domain:&lt;pre&gt;# &lt;em&gt;net join -UAdministrator&lt;/em&gt;&lt;br /&gt;Enter Administrator's password:&lt;br /&gt;Using short domain name -- YOURDOM&lt;br /&gt;Joined 'YOURHOST' to realm 'your.domain'&lt;br /&gt;[2012/02/10 21:15:35,  0] libads/kerberos.c:333(ads_kinit_password)&lt;br /&gt;  kerberos_kinit_password YOURHOST$@YOUR.REALM failed: Client not found in Kerberos database&lt;br /&gt;DNS update failed!&lt;br /&gt;# &lt;em&gt;/etc/init.d/winbind start&lt;/em&gt;&lt;br /&gt; * Starting the Winbind daemon winbind                                   [ OK ]&lt;br /&gt;# &lt;/pre&gt;&lt;br /&gt;If DNS is not properly set up, use &lt;code&gt;net join -UAdministrator -Sdc.yourdom&lt;/code&gt;, this tells net what server it should use for the join.&lt;br /&gt;&lt;br /&gt;As far as I know these errors are nothing to be concerned about, but the DNS update failed means that net/Samba wasn't able to register the host in DNS. If you have DDNS updates from a DHCP server or there's already a static entry for the server in DNS then you don't need to worry at all. Now try &lt;code&gt;&lt;em&gt;wbinfo -u&lt;/em&gt;&lt;/code&gt; and see if the Active Directory users show up.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up nss&lt;/h3&gt;&lt;br /&gt;Setting up nss is another easy step, we just need to add two references to winbind, for both &lt;em&gt;passwd&lt;/em&gt; and &lt;em&gt;group&lt;/em&gt;. Edit &lt;em&gt;/etc/nsswitch.conf&lt;/em&gt; and change the passwd and group lines:&lt;pre&gt;...&lt;br /&gt;passwd:         compat&lt;ins&gt; winbind&lt;/ins&gt;&lt;br /&gt;group:          compat&lt;ins&gt; winbind&lt;/ins&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;Verify with &lt;code&gt;getent passwd&lt;/code&gt; that all the domain users are listed and their home directories make sense. Now would be a good time to change the loginShell attribute for your user, because as you can see it now is &lt;em&gt;/bin/false&lt;/em&gt; for all users.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up PAM&lt;/h3&gt;&lt;br /&gt;Now that the users actually 'exist' on the machine, let's enable authentication for them as well (if your package manager hasn't already done that for you):&lt;pre&gt;# &lt;em&gt;pam-auth-update&lt;/em&gt;&lt;br /&gt;...&lt;br /&gt;Some PAM module packages provide profiles that can be used to&lt;br /&gt;automatically adjust the behavior of all PAM-using applications on the&lt;br /&gt;system.  Please indicate which of these behaviors you wish to enable.&lt;br /&gt;&lt;br /&gt;PAM profiles to enable:&lt;br /&gt;&lt;br /&gt;   [*] Unix authentication&lt;br /&gt;   [&lt;em&gt;*&lt;/em&gt;] Winbind NT/Active Directory authentication&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now let's logon to the server from another computer:&lt;pre&gt;$ &lt;em&gt;ssh user@yourhost&lt;/em&gt;&lt;br /&gt;user@yourhost's password: &lt;br /&gt;...&lt;br /&gt;Could not chdir to home directory /home/user: No such file or directory&lt;br /&gt;user@yourhost:/$&lt;/pre&gt;&lt;br /&gt;That's not good is it? Well, it is, but let's make it better, but first...&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;It doesn't work!&lt;/h3&gt;&lt;br /&gt;Oh well, bad things can happen. It should work, it works for me on multiple machines, both freshly installed and some older installations, both latest and long-term Ubuntu releases and different Debian releases. But it doesn't work for you... There's a few places you can check right now, one is &lt;em&gt;/var/log/auth.log&lt;/em&gt;. However, this might not be the most useful log file in case of authentication failures against Active Directory. A good help though is to start winbind in debug mode:&lt;pre&gt;# &lt;em&gt;winbindd -d 3 -i&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This will list a lot of debug information. Look at the messages that occur during a login attempt, it helped me to discover that I needed to use &lt;em&gt;kerberos method = secrets and keytab&lt;/em&gt; in &lt;em&gt;smb.conf&lt;/em&gt;. It wasn't saying so directly, and don't expect it to tell you the solution to all your problems, but the error messages can be informative...&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Finishing touches&lt;/h3&gt;&lt;br /&gt;Now to continue where we left off, apparently we don't have a home directory on the server yet. This makes sense, and there's a proper solution. We just need to tell pam to use a module that will make a home directory for a user logging in. Let's do so by adding one line to the end of &lt;em&gt;/etc/pam.d/common-account&lt;/em&gt;:&lt;pre&gt;session required pam_mkhomedir.so umask=0077 skel=/etc/skel&lt;/pre&gt;You can change the umask, but 0077 means that the directory is owned by the user and that group and other have no permissions at all. Now if we login we end up in our newly created home directory.&lt;br /&gt;&lt;br /&gt;Next up is &lt;em&gt;sudo&lt;/em&gt;. There's a possibility you want to grant sudo rights to someone in your domain, for instance to the &lt;em&gt;Domain Admins&lt;/em&gt; group. Of course this is not any different from granting permissions to a local group, I'm detailing it here for a more complete solution. Edit &lt;em&gt;/etc/sudoers&lt;/em&gt; in your favorite editor and add the following line:&lt;pre&gt;%domain\ admins ALL=(ALL) ALL&lt;/pre&gt;&lt;br /&gt;The backslash is just used to escape the space in the group name, otherwise this is no different than any other sudoers entry.&lt;br /&gt;&lt;br /&gt;We've come a long way from where we started, but there's still room for improvement. We enabled login using Active Directory credentials, but what if we already logged in somewhere else? In Windows SSO (Single SignOn) works out of the box, but let's add it to our Linux machine(s) as well. What we need for SSO is Kerberos, and since we just set that up we can use it for other services as well. For now I'll only discuss on setting this up for OpenSSH. In &lt;em&gt;/etc/ssh/sshd_config&lt;/em&gt; there are two commented lines that we need to change and uncomment so they look like this:&lt;pre&gt;...&lt;br /&gt;GSSAPIAuthentication yes&lt;br /&gt;GSSAPICleanupCredentials yes&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;Don't be fooled by the Kerberos lines, they're not needed for Single SignOn. Now restart SSH:&lt;pre&gt;# &lt;em&gt;/etc/init.d/ssh restart&lt;/em&gt;&lt;br /&gt;Rather than invoking init scripts through /etc/init.d, use the service(8)&lt;br /&gt;utility, e.g. service ssh restart&lt;br /&gt;&lt;br /&gt;Since the script you are attempting to invoke has been converted to an&lt;br /&gt;Upstart job, you may also use the restart(8) utility, e.g. restart ssh&lt;br /&gt;ssh start/running, process 32441&lt;/pre&gt;&lt;br /&gt;Now back to the other computer to do a ssh login and see if you can log in without having to supply a password. If it doesn't work, try the following command:&lt;pre&gt;$ &lt;em&gt;ssh -vvv -o PreferredAuthentications=gssapi-with-mic user@yourhost&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This will show a lot of debug messages, probably with a descriptive error message near the end. One thing to keep in mind is that the client needs to know the Kerberos principal for the host it's connecting to. This is because with Kerberos, the client is also verifying that the server is actually (according to Kerberos) who it's trying to connect to. The way ssh determines the principal is by using the &lt;em&gt;HostKeyAlias&lt;/em&gt;, which defaults to the host you're connecting to. However, it's easy to cheat if there's no working dns by supplying &lt;em&gt;-o HostKeyAlias=yourhost&lt;/em&gt; on the ssh commandline.&lt;br /&gt;&lt;br /&gt;We can make this even better than it is right now. You might have noticed that if you're logging in using password authentication that you actually get a Kerberos ticket, pam_winbind makes sure this happens. But now that we log in using Kerberos authentication, we don't get a ticket. Seems strange, but it's not. Ssh has decided to turn credential delegation off by default, but we can turn it on again. To do this on a per-user basis you can edit &lt;em&gt;~/.ssh/config&lt;/em&gt; and add the following line:&lt;pre&gt;GSSAPIDelegateCredentials yes&lt;/pre&gt;Now if you logon to the machine using Kerberos your ticket is delegated and you can use it to ssh to other computers as well.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Final notes&lt;/h3&gt;&lt;br /&gt;You should now have a quite-well-integrated Linux machine. In future parts I will discuss mail routing and authentication and proxy server authentication and authorization. This post might be expanded to include some topics that were missing at first, I will try to keep an update list in here as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-4908993593319383143?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CTRckADtnZrngNYN4o13LvUgyv8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CTRckADtnZrngNYN4o13LvUgyv8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CTRckADtnZrngNYN4o13LvUgyv8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CTRckADtnZrngNYN4o13LvUgyv8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/MeCJUCEA-bw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/4908993593319383143/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=4908993593319383143" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/4908993593319383143?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/4908993593319383143?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/MeCJUCEA-bw/linux-integration-with-active-directory.html" title="Linux integration with Active Directory: part 1" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2012/02/linux-integration-with-active-directory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04NQ3s4fyp7ImA9WhdbFEw.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-1922441269763282346</id><published>2011-10-12T02:21:00.000-07:00</published><updated>2011-10-12T02:33:12.537-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-12T02:33:12.537-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Matrox" /><category scheme="http://www.blogger.com/atom/ns#" term="widescreen" /><category scheme="http://www.blogger.com/atom/ns#" term="DELL PowerEdge T110" /><category scheme="http://www.blogger.com/atom/ns#" term="G200eW" /><title>Enabling higher resolutions on Matrox G200eW</title><content type="html">Recently we bought 5 DELL PowerEdge T110 servers to deploy to customers. After installing Windows XP on the PERC S100 RAID (more on that in a future post) I had to look for a driver for the graphics card. Of course you can't easily find it at Matrox's site, so I went over to DELL support and downloaded the Windows Server 2003 Matrox driver. Server 2003 and XP both being NT5 this worked like a charm, as was to be expected. There is another issue however, by default the Matrox driver supports 4:3 resolutions up to 1280x1024, but we use widescreen monitors which can do 1920x1080, and we're relying on that.&lt;br /&gt;&lt;br /&gt;Just a week ago I was fiddling with Matrox drivers for a G450, where I had the same issue with resolutions, where the latest driver did support the correct 16:9 resolutions. When I was comparing the drivers, I noticed there's a resolution reference directly in the driver inf file. For the G200eW, this listed just a few resolutions, but for the G450 there was a long list. Changing this value to what the G450 had listed was enough to get it working, so now our G200eW can do 1920x1080 without issues. Here's the changed value for future reference:&lt;br /&gt;&lt;pre&gt;HKR,,Mga.SingleResolutions,0x00000001,\&lt;br /&gt;40,01,C8,00,40,01,F0,00,00,02,80,01,80,02,90,01,\ ; 320x 200,  320x 240,  512x 384,  640x 400&lt;br /&gt;80,02,E0,01,20,03,58,02,50,03,E0,01,58,03,E0,01,\ ; 640x 480,  800x 600,  848x 480,  856x 480&lt;br /&gt;60,03,E0,01,C0,03,60,09,00,04,00,02,00,04,00,03,\ ; 864x 480,  960x2400, 1024x 512, 1024x 768&lt;br /&gt;00,04,00,05,00,04,00,06,30,04,58,02,80,04,60,03,\ ;1024x1280, 1024x1536, 1072x 600, 1152x 864&lt;br /&gt;B0,04,40,06,00,05,D0,02,00,05,00,03,00,05,20,03,\ ;1200x1600, 1280x 720, 1280x 768, 1280x 800&lt;br /&gt;00,05,C0,03,00,05,00,04,00,05,40,06,50,05,00,03,\ ;1280x 960, 1280x1024, 1280x1600, 1360x 768&lt;br /&gt;58,05,00,03,60,05,00,03,78,05,1A,04,A0,05,84,03,\ ;1368x 768, 1376x 768, 1400x1050, 1440x 900&lt;br /&gt;40,06,00,04,40,06,B0,04,40,06,00,05,90,06,1A,04,\ ;1600x1024, 1600x1200, 1600x1280, 1680x1050&lt;br /&gt;00,07,40,05,08,07,A0,05,40,07,70,05,80,07,0A,04,\ ;1792x1344, 1800x1440, 1856x1392, 1920x1034&lt;br /&gt;80,07,38,04,80,07,B0,04,80,07,A0,05,00,08,00,06   ;1920x1080, 1920x1200, 1920x1440, 2048x1536&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-1922441269763282346?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KfX1s3MZAQkX2KZlvOZqTFk_zC8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KfX1s3MZAQkX2KZlvOZqTFk_zC8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KfX1s3MZAQkX2KZlvOZqTFk_zC8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KfX1s3MZAQkX2KZlvOZqTFk_zC8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/Kgoj1xWN4vQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/1922441269763282346/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=1922441269763282346" title="17 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1922441269763282346?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1922441269763282346?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/Kgoj1xWN4vQ/enabling-higher-resolutions-on-matrox.html" title="Enabling higher resolutions on Matrox G200eW" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>17</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/10/enabling-higher-resolutions-on-matrox.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMCRHs6fyp7ImA9WhdSF0s.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-8932228168782829842</id><published>2011-07-27T04:41:00.000-07:00</published><updated>2011-07-27T04:51:05.517-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-27T04:51:05.517-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="lid" /><category scheme="http://www.blogger.com/atom/ns#" term="backlight" /><category scheme="http://www.blogger.com/atom/ns#" term="Dell Vostro 3550" /><category scheme="http://www.blogger.com/atom/ns#" term="stack" /><title>DELL Vostro 3550 stacking issue</title><content type="html">At work I often order a few laptops at the same time. Because of this it often occurs I install one of the laptops, then put another one on top to install that one. Now I had a Vostro 3550 on my desk and I put another one on top of it. When I turned it on the screen stayed black, or at least so it seemed. After a while I noticed there was a faint graphic showing, so my guess was the backlight was broken. I pushed the power button, pressed F2 to enter BIOS hoping that would help, then when I turned the laptop to the light to see if there was something on the screen it turned on. I put the laptop down again, it turned off. Lift the front up half a centimeter, screen turns on.&lt;br /&gt;&lt;br /&gt;So I was thinking, must be a bad connection, right? Well I had another 3550 still in the box, so I removed the top 3550, put it aside, put the other one on there, turned it on, same issue! This was too much coincidence for me and I quickly noticed that the 3550 doesn't have any buttons to detect whether the lid is closed, so it uses magnets to do this. Well of course if you stack two laptops on top there's always a lid nearby, I didn't expect it to be this sensitive though...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-8932228168782829842?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BCcwRveWftA9nqOaj8X75yrvxVw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCcwRveWftA9nqOaj8X75yrvxVw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BCcwRveWftA9nqOaj8X75yrvxVw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCcwRveWftA9nqOaj8X75yrvxVw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/FAPJHqQVY4k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/8932228168782829842/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=8932228168782829842" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/8932228168782829842?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/8932228168782829842?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/FAPJHqQVY4k/dell-vostro-3550-stacking-issue.html" title="DELL Vostro 3550 stacking issue" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/07/dell-vostro-3550-stacking-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YMSHk8eSp7ImA9WhZVF0g.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-6250705267829043385</id><published>2011-05-30T05:17:00.000-07:00</published><updated>2011-05-30T05:39:49.771-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-30T05:39:49.771-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="move documents and settings" /><category scheme="http://www.blogger.com/atom/ns#" term="ntfs volume mount point" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Moving "Documents and Settings" to another partition in Windows XP</title><content type="html">Because you can't depend on Windows, it's nice to have some kind of backup scheme for when things go wrong. One of those solutions is to store important data on a seperate drive. I've seen a lot of people doing this the wrong way. User folder in &lt;em&gt;C:\Documents and Settings\[user]&lt;/em&gt; and a partition D: or E: which then contains folders like &lt;em&gt;Documents&lt;/em&gt;, &lt;em&gt;Downloads&lt;/em&gt;, &lt;em&gt;Photos&lt;/em&gt; and &lt;em&gt;Music&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;A home directory is not just a home directory for nothing, so store your files in there. The solution is simple, with NTFS drivers you can have a &lt;em&gt;volume mount point&lt;/em&gt;, which allows you to use a seperate NTFS filesystem as if it was just a folder in another NTFS filesystem. Of course this doesn't make it easy yet, so these are the steps that need to be taken to have it fully functional:&lt;ol&gt;&lt;li&gt;Format the new partition as NTFS&lt;/li&gt;&lt;li&gt;In &lt;em&gt;Disk Management&lt;/em&gt; in Windows setup the new filesystem as volume mount point on C:\newdoc&lt;/li&gt;&lt;li&gt;Boot to something that is capable of moving stuff around on your drive (&lt;a href="http://partedmagic.com/"&gt;Parted Magic&lt;/a&gt; will do)&lt;/li&gt;&lt;li&gt;Copy the contents of &lt;em&gt;Documents and Settings&lt;/em&gt; to the new filesystem&lt;/li&gt;&lt;li&gt;Move &lt;em&gt;Documents and Settings&lt;/em&gt; to &lt;em&gt;olddoc&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Move &lt;em&gt;newdoc&lt;/em&gt; to &lt;em&gt;Documents and Settings&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Reboot into Windows&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Depending on what you used to copy the contents of Documents and Settings you might have to reset some of the file attributes (or permissions even), because otherwise a lot of Desktop.ini files will pop up.&lt;br /&gt;&lt;br /&gt;One last improvement that can be made is to fix the icon for the mount point. By default this will show as a disk icon, but because we abstracted this fact we might also want to show it as a folder. Just create &lt;em&gt;C:\Documents and Settings\autorun.inf&lt;/em&gt; with the following contents:&lt;br /&gt;&lt;pre&gt;[autorun]&lt;br /&gt;icon=%SystemRoot%\system32\SHELL32.dll,3&lt;/pre&gt;&lt;br /&gt;This requires a reboot before visible, but after that will work great.&lt;br /&gt;&lt;br /&gt;Because we make effective use of NTFS volume mount points all legacy applications that probe for &lt;em&gt;C:\Documents and Settings&lt;/em&gt; instead of using the proper functions to find profile directories will work as ever before. Just keep in mind to follow these steps after a Windows reinstall, except for the file copy part!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-6250705267829043385?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LPHPnFYN1_JC6ZmzA-vFQyEjUns/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LPHPnFYN1_JC6ZmzA-vFQyEjUns/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LPHPnFYN1_JC6ZmzA-vFQyEjUns/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LPHPnFYN1_JC6ZmzA-vFQyEjUns/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/H-v6e8bVyKE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/6250705267829043385/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=6250705267829043385" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6250705267829043385?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6250705267829043385?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/H-v6e8bVyKE/moving-documents-and-settings-to.html" title="Moving &quot;Documents and Settings&quot; to another partition in Windows XP" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/05/moving-documents-and-settings-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIHQn89eyp7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-5446483501809483934</id><published>2011-05-11T13:09:00.000-07:00</published><updated>2011-05-13T13:28:53.163-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-13T13:28:53.163-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="access point" /><category scheme="http://www.blogger.com/atom/ns#" term="Linksys" /><category scheme="http://www.blogger.com/atom/ns#" term="E4200" /><category scheme="http://www.blogger.com/atom/ns#" term="wireless" /><title>Linksys E4200 as an access point</title><content type="html">At work we bought two Linksys E4200's to extend our wireless network. We wanted to use them as access points / wireless gateways instead of their normal router configuration. Googling turns up a few half-documented solutions, which might even work in case you've got a small home network set up, but I still couldn't get it to work. So I took one of the routers home, and this is what I've come up with (tested at home only right now):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start the router&lt;/li&gt;&lt;li&gt;Connect a cable between your computer and one of the E4200 LAN ports&lt;/li&gt;&lt;li&gt;Turn on remote management on the E4200&lt;/li&gt;&lt;li&gt;Verify that the E4200 doesn't have a local address that belongs in your network's subnet (change it otherwise)&lt;/li&gt;&lt;li&gt;Connect a cable between the E4200 WAN port and your network&lt;/li&gt;&lt;li&gt;Connect a cable between your computer and network&lt;/li&gt;&lt;li&gt;Turn off the DHCP server on the E4200&lt;/li&gt;&lt;li&gt;Connect a cable between your network and one of the E4200 LAN ports&lt;/li&gt;&lt;li&gt;Connect a cable between the E4200 WAN port and one of the E4200 LAN ports&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now you can wirelessly connect to your network using the E4200 and you can still access the E4200 admin interface as well!&lt;br /&gt;&lt;br /&gt;Of course this all won't be necessary when DD-WRT or other alternative firmware releases are available for the E4200, but right now this probably is the best solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-5446483501809483934?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NC4kyX_ReIFgcta2JrEuo1Ne1Ms/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NC4kyX_ReIFgcta2JrEuo1Ne1Ms/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NC4kyX_ReIFgcta2JrEuo1Ne1Ms/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NC4kyX_ReIFgcta2JrEuo1Ne1Ms/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/tLBDrD81xOo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/5446483501809483934/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=5446483501809483934" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5446483501809483934?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5446483501809483934?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/tLBDrD81xOo/linksys-e4200-as-access-point.html" title="Linksys E4200 as an access point" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>8</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/05/linksys-e4200-as-access-point.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QDR3o6fip7ImA9WhZXEE8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-2477044334681078512</id><published>2011-04-28T13:50:00.000-07:00</published><updated>2011-04-28T14:16:16.416-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-28T14:16:16.416-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="remote keyboard" /><category scheme="http://www.blogger.com/atom/ns#" term="logitech touch mouse" /><category scheme="http://www.blogger.com/atom/ns#" term="remote mouse" /><category scheme="http://www.blogger.com/atom/ns#" term="touchmoused" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="touch mouse" /><category scheme="http://www.blogger.com/atom/ns#" term="uinput" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><title>touchmoused: Logitech Touch Mouse server for Linux</title><content type="html">Recently I was looking at a way to control the Mac Mini I have connected to my TV. I don't have a keyboard or mouse connected (only a gamepad), but I do have an iPod Touch. Soon I found &lt;a href="http://itunes.apple.com/nl/app/touch-mouse/id338237450?mt=8"&gt;Logitech Touch Mouse&lt;/a&gt;, a simple app providing a keyboard and mouse over the network. Of course Logitech isn't capable of delivering a Linux server for it's app, so I decided to write it myself.&lt;br /&gt;&lt;br /&gt;After a quick Wireshark dump I started hacking away. Using the recently released &lt;a href="http://mafipulation.org/blagoblig/reversing"&gt;Shairport&lt;/a&gt; as a reference I started hacking away on my first Perl program. This also being my first program where I had no documentation on protocol whatsoever, it took me a while to figure out I had to listen both on TCP and UDP. Then it also took me a while before I figured Perl doesn't write directly on a &lt;code&gt;print&lt;/code&gt; statement unless autoflush is set on the file descriptor. I managed to find that one on a page detailing serial port communication with Perl.&lt;br /&gt;&lt;br /&gt;When these hurdles were overcome I could really start interpreting events, sending them through to the Linux UInput facility. Today another big issue was fixed, mouse movement was broken until I added left mouse button support. So anyone trying to send mouse movements using uinput, be sure to enable left mouse button events!&lt;br /&gt;&lt;br /&gt;Anyway, I've now come to a point where the Touch Mouse app can be effectively used as a trackpad replacement. Moving, clicking, (two-finger) scrolling, it all works. Also alphanumeric keys are working, &lt;strong&gt;Ctrl&lt;/strong&gt; and &lt;strong&gt;Alt&lt;/strong&gt; are working and some character keys are working. This also means I think I've come far enough to promote the app here on my blog, so anyone willing to try it out should move on to my &lt;a href="https://github.com/mycroes/touchmoused"&gt;github project page&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-2477044334681078512?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xVY7osMqgw-ZdHReMcuUrCBlHg8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xVY7osMqgw-ZdHReMcuUrCBlHg8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xVY7osMqgw-ZdHReMcuUrCBlHg8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xVY7osMqgw-ZdHReMcuUrCBlHg8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/yH86P5-4YrI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/2477044334681078512/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=2477044334681078512" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2477044334681078512?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2477044334681078512?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/yH86P5-4YrI/touchmoused-logitech-touch-mouse-server.html" title="touchmoused: Logitech Touch Mouse server for Linux" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>8</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/04/touchmoused-logitech-touch-mouse-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcCR3c-eCp7ImA9Wx9XGEs.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-1195487652320606026</id><published>2011-01-12T12:10:00.000-08:00</published><updated>2011-01-12T12:27:46.950-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-12T12:27:46.950-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pxe" /><category scheme="http://www.blogger.com/atom/ns#" term="dhcp" /><title>DHCP for PXE booting only</title><content type="html">At work we use a Novell Netware 5 server (don't worry, it will be replaced) for, amongst others, DHCP. Not much of an issue, but I wanted to netboot clients so I could do easy operating system installations. When I wanted to add the appropriate options to the DHCP server, I noticed it wasn't possible. Some searching on the internet revealed some hacks, but nothing you'd easily try on a server in use.&lt;br /&gt;&lt;br /&gt;So then what? I noticed before when I was trying to boot PXE clients and they were attached to the main network (instead of my private network) that they wouldn't get (accept?) DHCP leases, so there was my solution: add a DHCP server that gives leases to PXE clients only.&lt;br /&gt;&lt;br /&gt;Although this may sound hard, it's actually pretty easy. PXE clients send along a so-called &lt;em&gt;vendor class identifier&lt;/em&gt; containing the string PXEClient. Using the ISC DHCP server we can easily check for this string, and then hand out a lease to those clients only. One last thing to keep in mind: don't hand out leases in the same range as the authorative DHCP server.&lt;br /&gt;&lt;br /&gt;Finally, here's a sample config (/etc/dhcp3/dhcpd.conf):&lt;br /&gt;&lt;pre&gt;ddns-update-style none;&lt;br /&gt;option domain-name "mycroes.nl";&lt;br /&gt;option domain-name-servers 192.168.5.1;&lt;br /&gt;&lt;br /&gt;default-lease-time 600;&lt;br /&gt;max-lease-time 7200;&lt;br /&gt;log-facility local7;&lt;br /&gt;&lt;br /&gt;class "pxeclients" {&lt;br /&gt; match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";&lt;br /&gt; filename "pxelinux.0";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;shared-network 5 {&lt;br /&gt; subnet 192.168.5.0 netmask 255.255.255.0 {&lt;br /&gt; }&lt;br /&gt; pool {&lt;br /&gt;  allow members of "pxeclients";&lt;br /&gt;  range dynamic-bootp 192.168.5.201 192.168.5.240;&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-1195487652320606026?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IEsENdVVXARbaDohjHKST1iWBAk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IEsENdVVXARbaDohjHKST1iWBAk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IEsENdVVXARbaDohjHKST1iWBAk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IEsENdVVXARbaDohjHKST1iWBAk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/6QS-R67S9mE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/1195487652320606026/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=1195487652320606026" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1195487652320606026?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1195487652320606026?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/6QS-R67S9mE/dhcp-for-pxe-booting-only.html" title="DHCP for PXE booting only" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2011/01/dhcp-for-pxe-booting-only.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcDQn4-fCp7ImA9Wx5WGEo.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-3063608228386435988</id><published>2010-09-30T11:02:00.000-07:00</published><updated>2010-09-30T11:07:53.054-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-30T11:07:53.054-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grub" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><title>Updating Ubuntu without removing grub-efi</title><content type="html">Ubuntu still is trying to remove grub-efi everytime a new kernel arrives. I have a Mac Mini without a display, so grub-pc is useless for me, so how do I prevent this grub-efi removal all the time?&lt;br /&gt;&lt;br /&gt;Simple solution, just tell apt you also want to install grub-efi, regardless of the availability of a new version:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get install linux-generic-pae grub-efi&lt;/em&gt;&lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree       &lt;br /&gt;Reading state information... Done&lt;br /&gt;grub-efi is already the newest version.&lt;br /&gt;The following extra packages will be installed:&lt;br /&gt;  linux-image-2.6.35-22-generic-pae linux-image-generic-pae&lt;br /&gt;Suggested packages:&lt;br /&gt;  fdutils linux-doc-2.6.35 linux-source-2.6.35 linux-tools&lt;br /&gt;Recommended packages:&lt;br /&gt;  grub-pc grub lilo&lt;br /&gt;The following NEW packages will be installed:&lt;br /&gt;  linux-image-2.6.35-22-generic-pae&lt;br /&gt;The following packages will be upgraded:&lt;br /&gt;  linux-generic-pae linux-image-generic-pae&lt;br /&gt;2 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.&lt;br /&gt;Need to get 34.1MB of archives.&lt;br /&gt;After this operation, 107MB of additional disk space will be used.&lt;br /&gt;Do you want to continue [Y/n]?&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And voila, grub-pc is a suggested package and no longer forced upon me! Thanks go out to &lt;a href="http://frankgroeneveld.nl/"&gt;Frank Groeneveld&lt;/a&gt; for suggesting the solution!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-3063608228386435988?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qPNfErbnmNc2UnlVi-24tLefrlY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qPNfErbnmNc2UnlVi-24tLefrlY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qPNfErbnmNc2UnlVi-24tLefrlY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qPNfErbnmNc2UnlVi-24tLefrlY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/DiAVRFE51nk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/3063608228386435988/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=3063608228386435988" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3063608228386435988?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3063608228386435988?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/DiAVRFE51nk/updating-ubuntu-without-removing-grub.html" title="Updating Ubuntu without removing grub-efi" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/09/updating-ubuntu-without-removing-grub.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MCSXsyeSp7ImA9Wx9SGEk.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-7471970735547452370</id><published>2010-09-30T10:54:00.000-07:00</published><updated>2010-12-08T13:57:48.591-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-08T13:57:48.591-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="active directory" /><category scheme="http://www.blogger.com/atom/ns#" term="maverick" /><category scheme="http://www.blogger.com/atom/ns#" term="samba" /><category scheme="http://www.blogger.com/atom/ns#" term="kerberos" /><category scheme="http://www.blogger.com/atom/ns#" term="bind" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><title>Installing Samba 4 on Ubuntu Maverick (10.10)</title><content type="html">Samba 4 is currently able to serve as a active directory domain controller for both Windows XP and Windows 7 (as tested by me) and probably for other Windows versions too. With Ubuntu 10.10 there finally is a recent enough version to make use of all the current Samba 4 functionality, however some issues still remain. This post will provide a short guide to setting up Samba 4 on your Ubuntu Maverick system, but it won't go into more advanced Samba topics. At first I wanted this to be a full step-by-step guide, however I can't find the time to complete it as such (I started writing when Maverick was in beta). I welcome comments adding more details and I hope everyone will be able to follow this howto.&lt;br /&gt;&lt;br /&gt;Let's start by updating the system.&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get update&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next add a PPA which includes a more recent Bind 9 version. I believe this is mainly needed so your Windows clients can send DNS updates to the domain controller, but I can't say I thoroughly tested with the Ubuntu Maverick distributed version.&lt;br /&gt;&lt;br /&gt;Personally I used bind9 from Hauke Lampe's PPA (&lt;a href="https://launchpad.net/~hauke/+archive/bind9"&gt;BIND 9 Updates : Hauke Lampe&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Install samba4 and bind9:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get install samba4 samba4-clients bind9&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Move existing smb.conf:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo mv /etc/samba/smb.conf{,.old}&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a samba 4 config and provision the database:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo LD_PRELOAD=/usr/lib/libdcerpc.so.0.0.1 /usr/share/samba/setup/provision --realm=samdom.example.com --domain=SAMDOM --adminpass=SOMEPASSWORD --server-role='domain controller'&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;You might be wondering what this &lt;em&gt;LD_PRELOAD&lt;/em&gt; is about, well it's needed because some stuff is missing the link to the dcerpc library.&lt;br /&gt;&lt;br /&gt;Now we want to start samba, there's another issue ahead. The samba4 init script doesn't check for the existence of the samba directory in /var/run, so let's add that ourselves.&lt;br /&gt;&lt;pre&gt;# /etc/init.d/samba4&lt;br /&gt;...&lt;br /&gt;  log_daemon_msg "Starting Samba 4 daemon" "samba"&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;  if [ ! -d $(dirname $SAMBAPID) ]; then&lt;br /&gt;   mkdir -p $(dirname $SAMBAPID)&lt;br /&gt;  fi&lt;/ins&gt;&lt;br /&gt;&lt;br /&gt;  if !...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We're still not there yet... Remember the missing library link? It will also return while running Samba, so let's work around it by creating local versions of the samba programs that will load the library:&lt;br /&gt;&lt;br /&gt;Create &lt;em&gt;/usr/local/sbin/samba&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;LD_PRELOAD=/usr/lib/libdcerpc.so.0.0.1 /usr/sbin/$(basename $0)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now symlink samba_dnsupdate and samba_spnupdate to the same file:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo ln -s /usr/local/sbin/samba{,_dnsupdate}&lt;/em&gt;&lt;br /&gt;$ &lt;em&gt;sudo ln -s /usr/local/sbin/samba{,_spnupdate}&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now start samba:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo /etc/init.d/samba4 start&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let's do a quick test if it's working:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;smbclient -UAdministrator -Llocalhost&lt;/em&gt;&lt;br /&gt;Password for [SAMDOM\Administrator]:&lt;br /&gt;&lt;br /&gt; Sharename       Type       Comment&lt;br /&gt; ---------       ----       -------&lt;br /&gt; netlogon        Disk       &lt;br /&gt; sysvol          Disk       &lt;br /&gt; IPC$            IPC        IPC Service (Samba 4.0.0alpha12-GIT-UNKNOWN)&lt;br /&gt; ADMIN$          Disk       DISK Service (Samba 4.0.0alpha12-GIT-UNKNOWN)&lt;br /&gt;REWRITE: list servers not implemented&lt;/pre&gt;&lt;br /&gt;Seems to be working!&lt;br /&gt;&lt;br /&gt;Now let's get DNS working too. Start by editing named.conf.local:&lt;br /&gt;&lt;pre&gt;// /etc/bind/named.conf.local&lt;br /&gt;...&lt;br /&gt;//include "/etc/bind/zones.rfc1918";&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;include "/var/lib/samba/private/named.conf";&lt;/ins&gt;&lt;/pre&gt;&lt;br /&gt;Thought we were done? Think again! AppArmor is protecting our samba4 files from bind, I'd rather have bind read them though...&lt;br /&gt;&lt;pre&gt;# /etc/apparmor.d/usr.sbin.named&lt;br /&gt;...&lt;br /&gt;&lt;ins&gt;/var/lib/samba/private/* rw,&lt;br /&gt;/var/lib/samba/private/dns/* rw,&lt;/ins&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Reload AppArmor profiles and restart bind:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo /etc/init.d/apparmor reload&lt;/em&gt;&lt;br /&gt;$ &lt;em&gt;sudo /etc/init.d/bind9 restart&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Bind should now start without any issues. Next is to actually use bind for DNS:&lt;br /&gt;&lt;pre&gt;# /etc/resolv.conf&lt;br /&gt;&lt;ins&gt;nameserver 127.0.0.1&lt;/ins&gt;&lt;/pre&gt;&lt;br /&gt;You can verify it's working by querying dns for kerberos:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;host -t SRV _kerberos._udp.samdom.example.com&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should return an SRV record, if not, something's broken!&lt;br /&gt;&lt;br /&gt;Now let's move the Kerberos config into place:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo cp /var/lib/samba/private/krb5.conf /etc/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can verify it's working by installing &lt;em&gt;krb5-user&lt;/em&gt; and doing a &lt;em&gt;kinit Administrator&lt;/em&gt;, but since Kerberos comes out of the box with samba, I'm assuming it's working (it always did for me).&lt;br /&gt;&lt;br /&gt;If you chose to add a PPA with a recent Bind version, you can enable Kerberized DNS updates by pointing named to the correct principal and keytab. More details on this can be found on the &lt;a href="http://wiki.samba.org/index.php/Samba4/HOWTO"&gt;Samba 4 howto&lt;/a&gt;, I will add my own details here later.&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;pre&gt;# /etc/bind/named.conf.options&lt;br /&gt;&lt;/pre&gt;--&gt;&lt;br /&gt;&lt;br /&gt;You should now be able to administer your Samba 4 domain controller using the microsoft utilities for windows server management, the Samba net tool or direct LDAP queries.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Updates&lt;/b&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;&lt;dt&gt;dec 8 2010, 22:56&lt;/dt&gt;&lt;br /&gt;&lt;dd&gt;Added missing apparmor policy changes&lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-7471970735547452370?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FhRfjoqnzXVHY4uu1ArlEWHuy_w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FhRfjoqnzXVHY4uu1ArlEWHuy_w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FhRfjoqnzXVHY4uu1ArlEWHuy_w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FhRfjoqnzXVHY4uu1ArlEWHuy_w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/ePjELqRj4qI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/7471970735547452370/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=7471970735547452370" title="20 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/7471970735547452370?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/7471970735547452370?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/ePjELqRj4qI/installing-samba-4-on-ubuntu-maverick.html" title="Installing Samba 4 on Ubuntu Maverick (10.10)" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>20</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/09/installing-samba-4-on-ubuntu-maverick.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMNR3szeSp7ImA9Wx5QGE0.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-3132542805559779434</id><published>2010-09-06T12:56:00.000-07:00</published><updated>2010-09-06T13:04:56.581-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-06T13:04:56.581-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sudo" /><category scheme="http://www.blogger.com/atom/ns#" term="ssh" /><category scheme="http://www.blogger.com/atom/ns#" term="rsync" /><title>Rsync and remote sudo</title><content type="html">Running rsync with superuser privileges can be hard at times, but here's an easy solution works on Ubuntu 10.04 (some other solutions failed to work):&lt;br /&gt;&lt;pre&gt;&lt;code&gt;$  echo "password" | ssh sudo -S -v&lt;br /&gt;$ sudo rsync -a -e ssh --rsync-path="sudo rsync"&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The first line will touch the timestamp for sudo, the second line will really sync. Keep in mind that this doesn't take care of credentials for ssh, so you will need to take care of this using keys, agents or some external authentication mechanism like Kerberos.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-3132542805559779434?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v57Q2AKmqLfVYsspE8yBui9jOc8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v57Q2AKmqLfVYsspE8yBui9jOc8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v57Q2AKmqLfVYsspE8yBui9jOc8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v57Q2AKmqLfVYsspE8yBui9jOc8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/pIpdH6U1-kM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/3132542805559779434/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=3132542805559779434" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3132542805559779434?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3132542805559779434?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/pIpdH6U1-kM/rsync-and-remote-sudo.html" title="Rsync and remote sudo" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/09/rsync-and-remote-sudo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04BQ3o_eCp7ImA9Wx5RGE8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-6769127995251511135</id><published>2010-08-26T04:04:00.000-07:00</published><updated>2010-08-26T04:25:52.440-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-26T04:25:52.440-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="delete" /><category scheme="http://www.blogger.com/atom/ns#" term="filter" /><category scheme="http://www.blogger.com/atom/ns#" term="rsync" /><category scheme="http://www.blogger.com/atom/ns#" term="delete excluded" /><title>rsync with --delete-excluded</title><content type="html">While setting up daily (offsite) automated backups I ran into a few issues. First of all backups didn't complete before people were getting to work again, so I had to manually stop them and start them at a lower transferrate. This is easily done by passing rsync the &lt;code&gt;--bwlimit=&amp;lt;kbps&amp;gt;&lt;/code&gt; option.&lt;br /&gt;&lt;br /&gt;Next I often want to sync just part of the tree, so I would add &lt;code&gt;--exclude=/&amp;lt;folder&amp;gt;&lt;/code&gt; to the options to exclude all folders I don't want. However, I also exclude some files and I use &lt;code&gt;--delete&lt;/code&gt;, which has the nasty side-effect of &lt;em&gt;not&lt;/em&gt; deleting the excluded files on the receiving end (if they were deleted on the sender), thus leaving non-empty folders on the receiver and generating errors because the non-empty folders aren't deleted. There's an option that 'fixes' this, and that's &lt;code&gt;--delete-excluded&lt;/code&gt;. This option will delete excluded files on the receiving end. You can guess that combined with my &lt;code&gt;--exclude=/&amp;lt;folder&amp;gt;&lt;/code&gt; this would result in deleting an entire branch of the tree that should not be removed... The solution is to specify that the exclude is a &lt;em&gt;r&lt;/em&gt;eceiving side exclude, because excludes are server side exclude by default when &lt;code&gt;--delete-excluded&lt;/code&gt; is also provided. This can be done by using a filter rule instead of an exclude rule, resulting in the following option: &lt;code&gt;--filter=-r_/&amp;lt;folder&amp;gt;&lt;/code&gt;. The &lt;code&gt;-&lt;/code&gt; is to specify it's an exclude, the &lt;code&gt;r&lt;/code&gt; specifies it's for the receiving side and the &lt;code&gt;_&lt;/code&gt; seperates the modifiers from the path (space is also allowed, but using an underscore prevents the need for quoting or even double-quoting). Now there's one nasty issue remaining: the excluded folder will still be parsed on the sender, so let's make it an exclude for both sender and receiver: &lt;code&gt;--filter=-rs_/&amp;lt;folder&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Using the above it's now possible to exclude files from an rsync transfer, without removing them on the receiving side, but with deletion of exclude files on the receiving end. In short: &lt;code&gt;rsync --exclude='*.tmp' --filter='-rs_/important/' --delete --delete-excluded &amp;lt;source&amp;gt; &amp;lt;dest&amp;gt;&lt;/code&gt; will leave the &lt;em&gt;important&lt;/em&gt; folder alone on the destination, but will remove all &lt;em&gt;.tmp&lt;/em&gt; files in the destination.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-6769127995251511135?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VfMSRY7iyscLwrUHHHGNl5cTJyA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VfMSRY7iyscLwrUHHHGNl5cTJyA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VfMSRY7iyscLwrUHHHGNl5cTJyA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VfMSRY7iyscLwrUHHHGNl5cTJyA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/nby5nNPkR_k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/6769127995251511135/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=6769127995251511135" title="10 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6769127995251511135?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6769127995251511135?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/nby5nNPkR_k/rsync-with-delete-excluded.html" title="rsync with --delete-excluded" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>10</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/08/rsync-with-delete-excluded.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEGRHw8eSp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-2420734677253834639</id><published>2010-06-21T06:46:00.000-07:00</published><updated>2010-08-04T04:17:05.271-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:17:05.271-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="frontend" /><category scheme="http://www.blogger.com/atom/ns#" term="ldif" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap" /><category scheme="http://www.blogger.com/atom/ns#" term="olcDefaultSearchBase" /><category scheme="http://www.blogger.com/atom/ns#" term="ldap" /><title>OpenLDAP default search base</title><content type="html">Although it's possible to specify a search base on the client when doing an &lt;em&gt;ldapsearch&lt;/em&gt;, it's often nicer if the server can have it set correctly already. I noticed there's an &lt;em&gt;olcDefaultSearchBase&lt;/em&gt; attribute for olcDatabase entries, however you can only use it on entry &lt;em&gt;-1&lt;/em&gt;, the &lt;em&gt;frontend&lt;/em&gt; database. This makes sense, because for one LDAP server instance you can only have a single default search base.&lt;br /&gt;&lt;br /&gt;The following LDIF will set the default search base to &lt;em&gt;dc=denc,dc=nl&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;dn: olcDatabase={-1}frontend,cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcDefaultSearchBase&lt;br /&gt;olcDefaultSearchBase: dc=denc,dc=nl&lt;/pre&gt;&lt;br /&gt;Works like a charm for me!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-2420734677253834639?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/j0HlXaIqDUX0P2h0w4O47Eii3Ck/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j0HlXaIqDUX0P2h0w4O47Eii3Ck/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/j0HlXaIqDUX0P2h0w4O47Eii3Ck/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j0HlXaIqDUX0P2h0w4O47Eii3Ck/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/JqRrxCvyLU8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/2420734677253834639/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=2420734677253834639" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2420734677253834639?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2420734677253834639?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/JqRrxCvyLU8/openldap-default-search-base.html" title="OpenLDAP default search base" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/06/openldap-default-search-base.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEMQng9eSp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-2195181625423758086</id><published>2010-06-17T02:07:00.000-07:00</published><updated>2010-08-04T04:18:03.661-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:18:03.661-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="slapd" /><category scheme="http://www.blogger.com/atom/ns#" term="slapadd" /><category scheme="http://www.blogger.com/atom/ns#" term="slapindex" /><category scheme="http://www.blogger.com/atom/ns#" term="ldif" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap" /><category scheme="http://www.blogger.com/atom/ns#" term="ldapmodify" /><category scheme="http://www.blogger.com/atom/ns#" term="recovery" /><category scheme="http://www.blogger.com/atom/ns#" term="glue" /><category scheme="http://www.blogger.com/atom/ns#" term="objectclass" /><category scheme="http://www.blogger.com/atom/ns#" term="contextcsn" /><category scheme="http://www.blogger.com/atom/ns#" term="ldapadd" /><title>Recovering from glue objects in OpenLDAP</title><content type="html">After some syncing issues and a few transfers of /var/lib/ldap between servers, our company LDAP database had lost it's root organization entry. Doing a &lt;code&gt;&lt;em&gt;slapcat&lt;/em&gt;&lt;/code&gt; resulted in the entry listed with objectClass glue and all of it's attributes gone. However, this was the same at all of our servers.&lt;br /&gt;&lt;br /&gt;The first thing that came to mind to fix this issue was doing an &lt;code&gt;&lt;em&gt;ldapmodify&lt;/em&gt;&lt;/code&gt; on the entry, however ldapmodify would return &lt;em&gt;ldap_modify: No such object (32)&lt;/em&gt;. The logical next step would then be to add the object, since ldapmodify complains it's not there... However, that would result in &lt;em&gt;ldap_add: Already exists (68)&lt;/em&gt;! Amazing, one program telling me the object can't be modified because it's not there, the other telling me I can't add it because it exists.&lt;br /&gt;&lt;br /&gt;I did some searching, but couldn't find a proper solution or anyone with a similar issue. I could of course start from scratch, but that would destroy the sync status, modified timestamp, modifier's name, create timestamp and creators name and perhaps even more, so that wouldn't really be an option in my humble opinion.&lt;br /&gt;&lt;br /&gt;During my (re)search I did come across &lt;em&gt;slapadd&lt;/em&gt;. slapadd can be used to do offline database edits (at least additions to the database). So I stopped slapd, and fired up slapadd and entered my LDIF... Same issue! The entry exists, so it can't be added. slapadd doesn't seem to support modify either (I'm not complaining, just stating the facts), so I had to figure out something else...&lt;br /&gt;&lt;br /&gt;Suddenly I had it all figured out. slapadd and slapcat are similar tools in that they operate directly on the database instead of talking to slapd. Thus if you slapcat your database you can give the output back to slapadd!&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;slapcat -n 1 &gt; entries.ldif&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;slapadd -n 1 -l entries.ldif&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Of course this very simple code example will result in similar errors, because all your entries are already there. Besides, it would also be nice to edit the broken entry while we're at it, which will result in the following list of commands to complete it all (code assumes broken tree is database number 1, replace with your database index if it's not the first database):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;cp -ar /var/lib/ldap{,.bak}&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;slapcat -n 1 &gt; entries.ldif&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;rm -r /var/lib/ldap&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;mkdir -p /var/lib/ldap/bdb&lt;/em&gt;&lt;/code&gt;&lt;br /&gt;&lt;span class="quiet"&gt;This line assumes a BDB database, you can probably replace bdb with hdb if you're using HDB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Now edit entries.ldif so your entry makes sense again. Just fix the &lt;em&gt;objectClass&lt;/em&gt; (be sure to create a correct objectClass chain, i.e. &lt;em&gt;top&lt;/em&gt;, &lt;em&gt;dcObject&lt;/em&gt;, &lt;em&gt;organization&lt;/em&gt;), &lt;em&gt;structuralObjectClass&lt;/em&gt; and attributes required by the newly set objectClasses (i.e. &lt;em&gt;dc&lt;/em&gt;, &lt;em&gt;o&lt;/em&gt;).&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;slapadd -n 1 -l entries.ldif&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now your entry should be back again, with a proper objectClass and related attributes. If you get errors along the way, make sure there aren't more entries with attributes that aren't available in the schema files. Just remove the incorrect attributes (and probably incorrect objectClasses accompanying the attributes) from the LDIF and repeat the database delete and add steps (or remove everything earlier in the LDIF and just add the new entries using slapadd, of course!)&lt;br /&gt;&lt;br /&gt;The last step would be to index the database. I don't know if it's required (slapd will run fine without), but before starting slapd run the following:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;slapindex -n 1&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Now your LDAP tree should be back to a proper state again!&lt;br /&gt;&lt;br /&gt;There's just one issue left... If you didn't change contextCSN attributes, slapd won't sync the entry to other servers because they will all think the entry never changed (and thus the other servers will keep the broken entry). There's an easy solution: just use ldapmodify to change an attribute and the contextCSN will update and the change will propagate to the other servers. The real fix would be to change the contextCSN for the rid of the server you're editing to the current time, however this is more prone to mistakes and the result should be the same (unless using delta syncrepl, where it is possible that only the change will get propagated.)&lt;br /&gt;&lt;br /&gt;This was my not-so-short introduction to LDAP disaster recovery without losing contextual information. I'm hoping you enjoyed reading this post and that it helped you to recover from long-standing errors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-2195181625423758086?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JclgJtmVvtZPSh6nhtOK5zV-6ZI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JclgJtmVvtZPSh6nhtOK5zV-6ZI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JclgJtmVvtZPSh6nhtOK5zV-6ZI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JclgJtmVvtZPSh6nhtOK5zV-6ZI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/3X4cytxcXps" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/2195181625423758086/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=2195181625423758086" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2195181625423758086?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2195181625423758086?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/3X4cytxcXps/recovering-from-glue-objects-in.html" title="Recovering from glue objects in OpenLDAP" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/06/recovering-from-glue-objects-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAERHgzcSp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-3826948976994913535</id><published>2010-06-16T00:28:00.000-07:00</published><updated>2010-08-04T04:18:25.689-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:18:25.689-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac os x" /><category scheme="http://www.blogger.com/atom/ns#" term="kerberos" /><category scheme="http://www.blogger.com/atom/ns#" term="ssh" /><category scheme="http://www.blogger.com/atom/ns#" term="osx" /><category scheme="http://www.blogger.com/atom/ns#" term="gssapi" /><title>Kerberos SSH logins on Mac OS X</title><content type="html">As a testing step of our Kerberos / Mac OS X integration I was testing SSH using a Kerberos ticket. At first it didn't seem to work. However, SSH can easily provide some more detailed debugging information, which I could compare with debugging information from a Linux machine which would successfully login with a Kerberos ticket. Turned out GSSAPI authentication is disabled by default for SSH on Mac OS X, you can enable it by editing /etc/ssh_config:&lt;br /&gt;&lt;pre title="/etc/ssh_config"&gt;Host *&lt;br /&gt;GSSAPIAuthentication yes&lt;/pre&gt;&lt;br /&gt;or by passing the option to SSH on every connection:&lt;br /&gt;&lt;pre title="Passing GSSAPIAuthentication option to SSH"&gt;$ &lt;em&gt;ssh -o GSSAPIAuthentication=yes &amp;lt;host&amp;gt;&lt;/em&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-3826948976994913535?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PRu1sxIiMfv_E9lk3Ox-yCSPr_g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PRu1sxIiMfv_E9lk3Ox-yCSPr_g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PRu1sxIiMfv_E9lk3Ox-yCSPr_g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PRu1sxIiMfv_E9lk3Ox-yCSPr_g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/wd-a34KDBwk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/3826948976994913535/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=3826948976994913535" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3826948976994913535?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3826948976994913535?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/wd-a34KDBwk/kerberos-ssh-logins-on-mac-os-x.html" title="Kerberos SSH logins on Mac OS X" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/06/kerberos-ssh-logins-on-mac-os-x.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAFR3k7fyp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-6178574002164718925</id><published>2010-06-03T13:39:00.000-07:00</published><updated>2010-08-04T04:18:36.707-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:18:36.707-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rootDSE" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac" /><category scheme="http://www.blogger.com/atom/ns#" term="mac os x" /><category scheme="http://www.blogger.com/atom/ns#" term="macos" /><category scheme="http://www.blogger.com/atom/ns#" term="osx" /><category scheme="http://www.blogger.com/atom/ns#" term="olcRootDSE" /><category scheme="http://www.blogger.com/atom/ns#" term="OpenLdapRootDSE" /><category scheme="http://www.blogger.com/atom/ns#" term="subschema" /><category scheme="http://www.blogger.com/atom/ns#" term="altServer" /><category scheme="http://www.blogger.com/atom/ns#" term="apple" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="olcAccess" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap" /><category scheme="http://www.blogger.com/atom/ns#" term="config" /><category scheme="http://www.blogger.com/atom/ns#" term="ldap" /><category scheme="http://www.blogger.com/atom/ns#" term="avahi" /><title>Mac OS X and OpenLDAP</title><content type="html">At work we had some issues trying to join Mac OS X machines into our Samba Windows domain. Turned out Mac OS X was doing a search with scope base and empty base, which is meant to return some information that can be used for compatibility or some global knowledge about the LDAP tree. This object is the RootDSE object. In our case that search would return nothing, instead of the descriptive entry.&lt;br /&gt;&lt;br /&gt;After quite a while we noticed closed bug &lt;a href="https://bugs.launchpad.net/ubuntu/+source/openldap/+bug/427842"&gt;#427842&lt;/a&gt; on Launchpad. The bug describes some missing access control rules that can lead to this problem. Although this bug is closed, it can still show up when migrating data from an older release, which was also the case for us. The bug also has the required ldif, which I'll copy here for future reference:&lt;br /&gt;&lt;pre title="Access control LDIF for RootDSE access"&gt;dn: olcDatabase={-1}frontend,cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcAccess&lt;br /&gt;olcAccess: to dn.base="" by * read&lt;br /&gt;olcAccess: to dn.base="cn=subschema" by * read&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can feed this to ldapmodify or ldapadd (yes, ldapadd can also do modifies). A quick ldapsearch will reveal if it worked:&lt;br /&gt;&lt;pre title="Search the RootDSE object"&gt;$ &lt;em&gt;ldapsearch -x -b '' -s base&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should return an object of the OpenLDAPRootDSE objectClass (and empty distinguished name).&lt;br /&gt;&lt;br /&gt;Now we're at it, let's add another useful gem for Mac OS X: altServer attributes. Mac OS X searches for altServer attributes in order to find other servers that should provide the same data, in case the server is down (although I don't know when this data is cached).&lt;br /&gt;&lt;br /&gt;It's possible to add attributes to the OpenLDAPRootDSE object by creating an LDIF file and pointing the olcRootDSE attribute on the config object to the created LDIF file. Create the following file, place it at /etc/ldap/rootdse.ldif:&lt;br /&gt;&lt;pre title="/etc/ldap/rootdse.ldif"&gt;dn:&lt;br /&gt;altServer: ldap://server2.domain.tld/dc=domain,dc=tld&lt;br /&gt;altServer: ldap://server3.domain.tld/dc=domain,dc=tld&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now add the following LDIF to OpenLDAP:&lt;br /&gt;&lt;pre title="LDIF to enable additional RootDSE attributes"&gt;dn: cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcRootDSE&lt;br /&gt;olcRootDSE: /etc/ldap/rootdse.ldif&lt;/pre&gt;&lt;br /&gt;You can add this one using ldapmodify again.&lt;br /&gt;&lt;br /&gt;Another quick ldapsearch will verify the attributes are really there:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;ldapsearch -x -b '' -s base "+"&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should present quite a list detailing some support, including the just added altServer attributes.&lt;br /&gt;&lt;br /&gt;Now there's one last thing that we should add to offer our Mac OS X users (or better, ourselves as sys admins!) a more pleasant experience: an Avahi (bonjour/zeroconf) entry for our OpenLDAP server. This will make the server show up as an option in some dialogs, for instance when adding an LDAPv3 directory server for authentication or contacts. To do this, add the following service file to avahi, for instance as /etc/avahi/services/slapd.service:&lt;br /&gt;&lt;pre title="Avahi service file for LDAP service"&gt;&amp;lt;?xml version="1.0" standalone='no'?&amp;gt;&amp;lt;!--*-nxml-*--&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE service-group SYSTEM "avahi-service.dtd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;service-group&amp;gt;&lt;br /&gt;    &amp;lt;name replace-wildcards="yes"&amp;gt;%h&amp;lt;/name&amp;gt;&lt;br /&gt;    &amp;lt;service&amp;gt;&lt;br /&gt;        &amp;lt;type&amp;gt;_ldap._tcp&amp;lt;/type&amp;gt;&lt;br /&gt;        &amp;lt;port&amp;gt;389&amp;lt;/port&amp;gt;&lt;br /&gt;        &amp;lt;host-name&amp;gt;atlas.denc.nl&amp;lt;/host-name&amp;gt;&lt;br /&gt;    &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/service-group&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The only additional step to integrating OpenLDAP even more with Mac OS X would be by adding the Apple schemas and providing OpenDirectory support using OpenLDAP on Linux. I'll probably come to that later, but one thing I'll definitely post about is authentication against our existing OpenLDAP user tree.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-6178574002164718925?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uSGLQIiEFj_90BDAtIEhfoLI1Rs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uSGLQIiEFj_90BDAtIEhfoLI1Rs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uSGLQIiEFj_90BDAtIEhfoLI1Rs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uSGLQIiEFj_90BDAtIEhfoLI1Rs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/tTHWcK6XpQg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/6178574002164718925/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=6178574002164718925" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6178574002164718925?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6178574002164718925?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/tTHWcK6XpQg/mac-os-x-and-openldap.html" title="Mac OS X and OpenLDAP" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/06/mac-os-x-and-openldap.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAGRnc9eSp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-3302045738036509572</id><published>2010-04-06T01:03:00.000-07:00</published><updated>2010-08-04T04:18:47.961-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:18:47.961-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu 10.04" /><category scheme="http://www.blogger.com/atom/ns#" term="alfresco 3.3" /><category scheme="http://www.blogger.com/atom/ns#" term="lucid lynx" /><category scheme="http://www.blogger.com/atom/ns#" term="howto" /><category scheme="http://www.blogger.com/atom/ns#" term="lts" /><category scheme="http://www.blogger.com/atom/ns#" term="lucid" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat6" /><category scheme="http://www.blogger.com/atom/ns#" term="alfresco" /><title>Installing Alfresco 3.3 on Ubuntu Lucid Lynx LTS (10.04)</title><content type="html">I happily reused my previous installing Alfresco post to provide you with a new post detailing the setup of the forthcoming Alfresco release on the forthcoming Ubuntu release.&lt;br /&gt;&lt;br /&gt;I'm still trying to figure a proper way to format content, but it should be readable at all times.&lt;br /&gt;&lt;br /&gt;Note that lines starting with a # (in typable commands) mean they should be executed as root. There's many ways to do this, my advice would be to prepend the commands with sudo. I'm trying to visually distuingish everything you need to type yourself (as opposed to shell output or existing file contents), but I'm human so I will make mistakes every now and then. Quick tip: if you can't write a file from vim because you opened as non-root, use &lt;em&gt;:w !sudo tee %&lt;/em&gt; to write the file using sudo.&lt;br /&gt;&lt;br /&gt;Start with updating your system:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;apt-get update&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Install Tomcat, MySQL and mysql-connector:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;apt-get install tomcat6 mysql-server libmysql-java&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Edit &lt;em&gt;/etc/default/tomcat6&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC"&lt;br /&gt;&lt;em&gt;JAVA_OPTS="${JAVA_OPTS} -Xms512m -Xmx512m"&lt;/em&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;In contrary to in Ubuntu 9.04, the Tomcat security manager is disabled by default in 10.04. I guess this means that the security manager is more of a problem than a solution, so I'm already feeling better about not using it.&lt;br /&gt;&lt;br /&gt;Create the Alfresco directory tree:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;mkdir /opt/alfresco&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;cd /opt/alfresco&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;wget http://dev.alfresco.com/downloads/nightly/dist/alfresco-community-war-3.3.tar.gz&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;tar xf alfresco-community-war-3.3.tar.gz&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;You can use something else instead of &lt;em&gt;/opt&lt;/em&gt;, but it seems to me this is a desirable location.&lt;br /&gt;&lt;br /&gt;I consider myself somewhat experienced with Alfresco, so I'm not downloading the sample extensions...&lt;br /&gt;&lt;br /&gt;Create Alfresco database and user:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;mysql -u root -p &lt; extras/databases/mysql/db_setup.sql&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create Alfresco and Tomcat directories:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;mkdir -p /srv/alfresco/alf_data&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;mkdir -p /var/lib/tomcat6/shared/classes&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;I'm using &lt;em&gt;/srv&lt;/em&gt; as data root, I should also move the shared/classes to that location. In my previous guide I used /var/lib/tomcat6/shared/lib/ as base for additional JARs (in this case the mysql-connector), but the default config assumes that these JARs reside in &lt;em&gt;/var/lib/tomcat6/shared/&lt;/em&gt;, so I'm not going to deviate from that assumption.&lt;br /&gt;&lt;br /&gt;Add links to war files to tomcat webapps:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;ln -s /opt/alfresco/alfresco.war /var/lib/tomcat6/webapps/&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;ln -s /opt/alfresco/share.war /var/lib/tomcat6/webapps/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Add mysql connector to path where tomcat finds it:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;ln -s /usr/share/java/mysql-connector-java.jar /var/lib/tomcat6/shared/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Setup Alfresco global settings:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;cp /opt/alfresco/extensions/extension/alfresco-global.properties /var/lib/tomcat6/shared/classes/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Edit the just copied file:&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;&lt;em&gt;#&lt;/em&gt;dir.root=./alf_data&lt;br /&gt;&lt;em&gt;dir.root=/srv/alfresco/alf_data&lt;/em&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;&lt;br /&gt;It seems that in some cases it's necessary to also include the hibernate dialect in this config file. You can do so by adding the following line:&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/ins&gt;&lt;br /&gt;&lt;br /&gt;Create the Alfresco extension root:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;mkdir -p /var/lib/tomcat6/shared/classes/alfresco/extension/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This directory is used to override alfresco configuration without changing the deployed WAR.&lt;br /&gt;&lt;br /&gt;Setup logging in &lt;em&gt;/var/lib/tomcat6/shared/classes&lt;ins&gt;/alfresco&lt;/ins&gt;&lt;ins&gt;/extension&lt;/ins&gt;/custom-log4j.properties&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;&lt;em&gt;log4j.rootLogger=error, File&lt;br /&gt;&lt;br /&gt;log4j.appender.File=org.apache.log4j.DailyRollingFileAppender&lt;br /&gt;log4j.appender.File.File=/var/log/tomcat6/alfresco.log&lt;br /&gt;log4j.appender.File.Append=true&lt;br /&gt;log4j.appender.File.DatePattern='.'yyyy-MM-dd&lt;br /&gt;log4j.appender.File.layout=org.apache.log4j.PatternLayout&lt;br /&gt;log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Make sure permissions are reasonable:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;chown -R tomcat6:tomcat6 /var/lib/tomcat6 /srv/alfresco&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Restart Tomcat and enjoy!&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;/etc/init.d/tomcat6 restart&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you should be able to reach Alfresco on [ip]:8080/alfresco and Alfresco Share on [ip]:8080/share.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-3302045738036509572?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8ZnCfL7gI2a4T8gmRk5krmRIRBU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ZnCfL7gI2a4T8gmRk5krmRIRBU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8ZnCfL7gI2a4T8gmRk5krmRIRBU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ZnCfL7gI2a4T8gmRk5krmRIRBU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/wqgUykCUQ_U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/3302045738036509572/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=3302045738036509572" title="37 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3302045738036509572?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3302045738036509572?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/wqgUykCUQ_U/installing-alfresco-33-on-ubuntu-lucid.html" title="Installing Alfresco 3.3 on Ubuntu Lucid Lynx LTS (10.04)" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>37</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/04/installing-alfresco-33-on-ubuntu-lucid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4NQHs_cCp7ImA9WxFTFEw.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-567048488429086815</id><published>2010-04-04T13:48:00.000-07:00</published><updated>2010-04-04T14:36:31.548-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-04T14:36:31.548-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac mini" /><category scheme="http://www.blogger.com/atom/ns#" term="macmini" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac" /><category scheme="http://www.blogger.com/atom/ns#" term="mac os x" /><category scheme="http://www.blogger.com/atom/ns#" term="lucid" /><category scheme="http://www.blogger.com/atom/ns#" term="grub2" /><category scheme="http://www.blogger.com/atom/ns#" term="hfsplus" /><category scheme="http://www.blogger.com/atom/ns#" term="grub" /><category scheme="http://www.blogger.com/atom/ns#" term="efi" /><category scheme="http://www.blogger.com/atom/ns#" term="grub-efi" /><category scheme="http://www.blogger.com/atom/ns#" term="bless" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="refit" /><title>Ubuntu Lucid on (X86) Mac Mini with EFI</title><content type="html">I was gonna use my Mac Mini as replacement home server (uses less power than an idle Core 2 Duo + Geforce 8800GTS + 4 Harddisks), so I decided to put Ubuntu Lucid on it. Installation was really easy. I used the Lucid Lynx Beta 1 Server install CD, and installation went just fine. Press/hold &lt;em&gt;c&lt;/em&gt; to boot from CD, be sure to create a seperate boot partition or keep some free space to create a seperate boot partition afterwards.&lt;br /&gt;&lt;br /&gt;Just installing Ubuntu is no issue at all. You don't even need to create a seperate boot partition, because it'll boot just fine using the Mac's legacy booter. However if you're a Mac Mini owner and want to boot headless, there is only one solution (and a workaround that uses a 'dummy monitor dongle', which is not what I would want). This solution is making use of the EFI features of GRUB 2, which I'll detail in the rest of this post.&lt;br /&gt;&lt;br /&gt;When the installation is done, install &lt;em&gt;hfsplus&lt;/em&gt; and &lt;em&gt;hfsprogs&lt;/em&gt; so you're able to create HFS+ volumes (you probably only need one of those, but it wasn't exactly clear for me which one to use and due to lack of time I haven't looked any further yet). Copy files from your boot partition to a temporary space, then unmount and format the boot partition as HFS+ (mine is /dev/sda2):&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;mkfs.hfsplus -v boot /dev/sda2&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;Edit /etc/fstab to use the new boot partition as boot partition:&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;/dev/sda2 /boot hfsplus defaults 0 2&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;Unfortunately it seems UUID's can't be used for HFS+ volumes at the moment, so hardcode the device name in there.&lt;br /&gt;&lt;br /&gt;After creating the volume mount it again and copy over all the files from your temporary space.&lt;br /&gt;&lt;br /&gt;Now install &lt;em&gt;grub-efi&lt;/em&gt;, this will automatically remove grub-pc. Generate a GRUB EFI executable using the following command:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;grub-mkimage -o /boot/grub/grub.efi -p /grub part_gpt hfsplus fat ext2 normal sh boot configfile linux&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;You actually don't even need the fat and ext2 modules and probably more can be stripped, but I haven't experimented with GRUB 2 a lot yet, that'll be for another day (and another post).&lt;br /&gt;&lt;br /&gt;We're almost done, now it's on to getting the Mac to actually use our EFI enabled GRUB. First toggle the boot flag on your shiny HFS+ partition. Run &lt;em&gt;parted&lt;/em&gt; (or any other GPT-aware partitioning tool) and type:&lt;br /&gt;&lt;pre&gt;(parted) &lt;b&gt;set 2 boot off&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;Parted will probably tell you the disk is in use and you need to reboot for the change to become effective, but it doesn't matter for us.&lt;br /&gt;&lt;br /&gt;Now the final step is to tell the Mac (or actually, the filesystem) that our grub.efi is bootable so it'll show up in the Mac boot menu. There should be a utility call hfspbless, which allows you to do this from within Linux, however the first hit on Google doesn't seem to offer a quick guide, so I skipped this part. Instead, put in the Mac OS X install DVD. As soon as a menu bar shows up (I believe you have to click next at least once), fire up a terminal. In the terminal, enter the following:&lt;br /&gt;&lt;pre&gt;# &lt;b&gt;mkdir /Volumes/boot&lt;/b&gt;&lt;br /&gt;# &lt;b&gt;mount_hfs /dev/disk0s2 /Volumes/boot&lt;/b&gt;&lt;br /&gt;# &lt;b&gt;bless --folder=/Volumes/boot --file=/Volumes/boot/grub/grub.efi --label boot --setBoot&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;The bless command has now set some metadata on the HFS+ filesystem that the Mac uses to identify a native bootable image. I assumed label should set the label accordingly for the boot menu, however my entry showed up as 'EFI something' IIRC, but I can't care more or less since it's a server and I'll never see the menu anyway. Now reboot and enjoy!&lt;br /&gt;&lt;br /&gt;This did the job for me, however there are a few issues I still have to take care of. The Mac created a fake MBR partition map for me, which I don't need and don't use. It now shows 'Windows' as option in the Mac boot menu, but luckily it starts Linux by default. Also, the MBR partition map is out of sync if you do stuff with the GPT partition table. I used rEFIt to resync the MBR table, but when I figure out how to remove the MBR that's what I'm going to do.&lt;br /&gt;&lt;br /&gt;Also, there's a file called &lt;em&gt;Volume Name Icon&lt;/em&gt; on my boot partition. I guess this is used for the Mac boot menu, so it probably can be changed easily too. However I have no clue what the format is, I'll have to look this up some day and change it for a genuine Tux!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-567048488429086815?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KQcFoQ___94lcxNNRrOttIH_EKs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KQcFoQ___94lcxNNRrOttIH_EKs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KQcFoQ___94lcxNNRrOttIH_EKs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KQcFoQ___94lcxNNRrOttIH_EKs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/aqpuGdYS4dU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/567048488429086815/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=567048488429086815" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/567048488429086815?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/567048488429086815?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/aqpuGdYS4dU/ubuntu-lucid-on-x86-mac-mini-with-efi.html" title="Ubuntu Lucid on (X86) Mac Mini with EFI" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>9</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/04/ubuntu-lucid-on-x86-mac-mini-with-efi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAAQ3o-eyp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-2436807150526064703</id><published>2010-02-01T06:06:00.000-08:00</published><updated>2010-08-04T04:19:02.453-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:19:02.453-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="howto" /><category scheme="http://www.blogger.com/atom/ns#" term="alfresco share" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat6" /><category scheme="http://www.blogger.com/atom/ns#" term="alfresco ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="alfresco" /><title>Installing Alfresco on Ubuntu Jaunty (9.04)</title><content type="html">Some of the information in here comes from http://wiki.alfresco.com/wiki/Installing_Alfresco_Community_WAR_on_Centos_5. Even though the guide is old, most of the information is still correct, albeit some file locations and names have changed and it's written for another distribution.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Start with updating your system&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# apt-get update&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Install tomcat and mysql-connector&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# apt-get install tomcat6 libmysql-java&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Edit tomcat startup settings&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;# /etc/defaults/tomcat6&lt;br /&gt;&lt;br /&gt;#JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"&lt;br /&gt;JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m"&lt;br /&gt;&lt;br /&gt;#TOMCAT6_SECURITY="yes"&lt;br /&gt;TOMCAT6_SECURITY="no"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;em&gt;Take note of the fact I disabled security&lt;/em&gt;, otherwise you need to create a policy file with everything that is allowed in it. I guess it is not that hard, but I wanted to get Alfresco running at all first.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Create the Alfresco root&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# mkdir /opt/alfresco&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# cd /opt/alfresco&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# wget http://dl.alfresco.com/release/community/build-2440/alfresco-community-wcm-3.2r2.zip&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# wget http://dl.alfresco.com/release/community/build-2440/alfresco-community-sample-extensions-3.2r2.zip&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# wget http://dl.alfresco.com/release/community/build-2440/alfresco-community-war-3.2r2.zip&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# unzip alfresco-community-war-3.2r2.zip&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;# mkdir wcm&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# unzip http://dl.alfresco.com/release/community/build-2440/alfresco-community-wcm-3.2r2.zip -d wcm&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Create Alfresco database and user&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;$ mysql -u root -p &lt; extras/databases/mysql/db_setup.sql&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Create Alfresco and tomcat directories&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# mkdir -p /var/lib/alfresco/alf_data/&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# mkdir -p /var/lib/tomcat6/shared/{classes,lib}&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Add Alfresco and Alfresco share wars to tomcat&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# ln -s /opt/alfresco/alfresco.war /var/lib/tomcat6/webapps/&lt;/code&gt;&lt;br /&gt;&lt;code&gt;# ln -s /opt/alfresco/share.war /var/lib/tomcat6/webapps/&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Add mysql connector to path where tomcat finds it&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# ln -s /usr/share/java/mysql-connector-java-1.5.6.jar /var/lib/tomcat6/shared/lib/mysql-connector-java.jar&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Add extension sample files to tomcat&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# unzip alfresco-community-sample-extensions-3.2r2.zip -d /var/lib/tomcat6/shared/classes/&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Setup Alfresco global settings&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;cp /opt/alfresco/extensions/extension/alfresco-global.properties /var/lib/tomcat6/shared/classes/&lt;/code&gt;&lt;br /&gt;Edit the contents of the file:&lt;br /&gt;&lt;pre&gt;# /var/lib/tomcat6/shared/classes/alfresco-global.properties&lt;br /&gt;&lt;br /&gt;#dir.root=./alf_data&lt;br /&gt;dir.root=/var/lib/alfresco/alf_data&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Add WCM bootstrap&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# cp wcm/wcm-bootstrap-context.xml /var/lib/tomcat6/shared/classes/alfresco/extension/&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Setup catalina loader paths&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;# /var/lib/tomcat6/conf/catalina.properties&lt;br /&gt;#shared.loader=&lt;br /&gt;shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Fix permissions&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# chown -R tomcat6:tomcat6 /var/lib/{tomcat6,alfresco}&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Do a first run so the wars get extracted&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# /etc/init.d/tomcat6 restart&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Setup log file&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt; # /var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/log4j.properties&lt;br /&gt;&lt;br /&gt;#log4j.appender.File.File=alfresco.log&lt;br /&gt;log4j.appender.File.File=/var/log/tomcat6/alfresco.log&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;h3&gt;Restart tomcat so log settings are re-read&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;# /etc/init.d/tomcat6 restart&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Now you should be able to reach Alfresco on [ip]:8080/alfresco and Alfresco Share on [ip]:8080/share.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt;&lt;br /&gt;Seems that Alfresco prefers to run on OpenJDK for me, getting out of memory errors when using Sun's JDK. However, if OpenJDK is installed on Jaunty, there's a symlink for rhino in /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar, which prevents loading of rhino included in the Alfresco WAR and will result in errors in Alfresco Share (and probably other places too). A &lt;code&gt;# rm /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar&lt;/code&gt; fixes this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-2436807150526064703?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6BkGmsI6av-cBbeuQ3IDmfgkaV8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6BkGmsI6av-cBbeuQ3IDmfgkaV8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6BkGmsI6av-cBbeuQ3IDmfgkaV8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6BkGmsI6av-cBbeuQ3IDmfgkaV8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/NHS-rPH0NhA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/2436807150526064703/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=2436807150526064703" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2436807150526064703?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2436807150526064703?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/NHS-rPH0NhA/installing-alfresco-on-ubuntu-jaunty.html" title="Installing Alfresco on Ubuntu Jaunty (9.04)" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://blog.mycroes.nl/2010/02/installing-alfresco-on-ubuntu-jaunty.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkABQns8fCp7ImA9Wx5TGU8.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-1395041031152554714</id><published>2009-12-23T00:54:00.000-08:00</published><updated>2010-08-04T04:19:13.574-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T04:19:13.574-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pdf restrictions" /><category scheme="http://www.blogger.com/atom/ns#" term="gs" /><category scheme="http://www.blogger.com/atom/ns#" term="ghostscript" /><category scheme="http://www.blogger.com/atom/ns#" term="pdf" /><category scheme="http://www.blogger.com/atom/ns#" term="convert pdf" /><category scheme="http://www.blogger.com/atom/ns#" term="convert" /><title>Convert PDF to ... PDF</title><content type="html">I keep running into people having issues with PDF files. Most of the times there's a very easy solution to fix their issues: convert the PDF to a PDF.&lt;br /&gt;&lt;br /&gt;The following ghostscript command will successfully convert a PDF to a new PDF without any restrictions, suitable for printing, editing with PDF editors or whatever you want:&lt;br /&gt;&lt;code&gt;gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPassThroughJPEGImages=true -sOutputFile=out_file.pdf in_file.pdf&lt;/code&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-1395041031152554714?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BcG9hSrd3D3_KeVKuzoOEa6AlUg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BcG9hSrd3D3_KeVKuzoOEa6AlUg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BcG9hSrd3D3_KeVKuzoOEa6AlUg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BcG9hSrd3D3_KeVKuzoOEa6AlUg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/9w9kls6GPn8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/1395041031152554714/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=1395041031152554714" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1395041031152554714?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1395041031152554714?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/9w9kls6GPn8/convert-pdf-to-pdf.html" title="Convert PDF to ... PDF" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/12/convert-pdf-to-pdf.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4NQXw-fyp7ImA9WxNVFU0.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-3039883776579545412</id><published>2009-10-25T14:56:00.001-07:00</published><updated>2009-10-25T14:59:50.257-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-25T14:59:50.257-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="broken" /><category scheme="http://www.blogger.com/atom/ns#" term="samsung" /><category scheme="http://www.blogger.com/atom/ns#" term="mp4" /><category scheme="http://www.blogger.com/atom/ns#" term="dlna" /><title>When something's broken...</title><content type="html">I've spent a large amount of today figuring out how to get some MP4 files playing on my TV (Samsung LE37B650T2, with DLNA support). Turned out that my TV doesn't like a MP4 file with the video track before the audio track, so I now add the audio tracks first. That at least got one movie playing, I guess I can get more to play this way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-3039883776579545412?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DXLusTzfL8tY6UNfiyi7-aRbMwg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DXLusTzfL8tY6UNfiyi7-aRbMwg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DXLusTzfL8tY6UNfiyi7-aRbMwg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DXLusTzfL8tY6UNfiyi7-aRbMwg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/NiGLKRCzX3Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/3039883776579545412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=3039883776579545412" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3039883776579545412?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/3039883776579545412?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/NiGLKRCzX3Y/when-somethings-broken.html" title="When something's broken..." /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/10/when-somethings-broken.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEICRXsycSp7ImA9WxNQFUw.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-5075676999172354922</id><published>2009-09-20T12:58:00.000-07:00</published><updated>2009-09-21T00:02:44.599-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-21T00:02:44.599-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sqlite3" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlite" /><category scheme="http://www.blogger.com/atom/ns#" term="banshee" /><title>Moving files in Banshee library</title><content type="html">I moved most of my music to the localized music folder (yay for localized name fail). Of course Banshee didn't know I moved them, so I had to tell it they were moved. I knew Banshee uses sqlite, so I just had to find the db and do the replacement. Banshee's database can be found in &lt;strong&gt;~/.config/banshee-1/banshee.db&lt;/strong&gt;. The following block highlights all you need to do to change the path for your files:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ &lt;strong&gt;sqlite3 ~/.config/banshee-1/banshee.db&lt;/strong&gt;&lt;br /&gt;SQLite version 3.6.10&lt;br /&gt;Enter ".help" for instructions&lt;br /&gt;Enter SQL statements terminated with a ";"&lt;br /&gt;sqlite&amp;gt; &lt;strong&gt;UPDATE CoreTracks SET Uri = replace(Uri, '/home/mycroes/Music/', '/home/mycroes/Muziek/') WHERE Uri LIKE 'file:///home/mycroes/Music/%';&lt;/strong&gt;&lt;br /&gt;sqlite&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Of course you need to pass in the correct arguments to 'replace', but that should be an easy one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-5075676999172354922?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3u02Fn4CGdzfkL0g-Qc2QLMYLYE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3u02Fn4CGdzfkL0g-Qc2QLMYLYE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3u02Fn4CGdzfkL0g-Qc2QLMYLYE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3u02Fn4CGdzfkL0g-Qc2QLMYLYE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/FX1xbf54UVM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/5075676999172354922/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=5075676999172354922" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5075676999172354922?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/5075676999172354922?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/FX1xbf54UVM/moving-files-in-banshee-library.html" title="Moving files in Banshee library" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/09/moving-files-in-banshee-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEEQns6cSp7ImA9WxJVEkw.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-2335992718788440922</id><published>2009-06-28T11:48:00.000-07:00</published><updated>2009-06-28T12:16:43.519-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-28T12:16:43.519-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="channels" /><category scheme="http://www.blogger.com/atom/ns#" term="tv" /><category scheme="http://www.blogger.com/atom/ns#" term="mplayer" /><title>Watching TV with mplayer</title><content type="html">Occassionally I want to watch something on my computer, and currently I'm using mplayer to do so. When I finally was able to play video and sound at the same time, I decided I wanted to have a bit easier way to watch tv then constantly searching for my mplayer command. So I made a small shell script, and while I was at it I added in the channel list so I can just start watching without searching frequencies too, so here it is:&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;#OPTS="-fs"&lt;br /&gt;FILTER="-vf pp=lb,crop=672:420"&lt;br /&gt;OUTPUT="-vo gl -ao pulse"&lt;br /&gt;&lt;br /&gt;CHANNELS="768000-Nederland_1,\&lt;br /&gt;776000-Nederland_2,\&lt;br /&gt;784000-Nederland_3,\&lt;br /&gt;752000-RTL_4,\&lt;br /&gt;744000-RTL_5,\&lt;br /&gt;736000-SBS_6,\&lt;br /&gt;728000-RTL_7,\&lt;br /&gt;712000-Veronica,\&lt;br /&gt;704000-Net_5,\&lt;br /&gt;496000-Discovery_Channel"&lt;br /&gt;&lt;br /&gt;TV="-tv outfmt=i420:chanlist=europe-west:width=720:height=576:amode=1:alsa:adevice=hw.2,0:forceaudio:immediatemode=0:channels=$CHANNELS"&lt;br /&gt;&lt;br /&gt;mplayer $OPTS $FILTER $OUTPUT $TV tv://$1&lt;/pre&gt;&lt;br /&gt;As you can see I'm using the first argument as channel, so you can invoke this script with a channel number to immediately select a channel on startup, but leaving out the argument will just start mplayer on the first channel.&lt;br /&gt;&lt;br /&gt;Last but not least, you can switch channels by binding keys to &lt;em&gt;tv_step_channel 1&lt;/em&gt; and &lt;em&gt;tv_step_channel -1&lt;/em&gt;, in Ubuntu these are bound to &lt;strong&gt;h&lt;/strong&gt; and &lt;strong&gt;l&lt;/strong&gt; by default, and I suspect this to be the upstream default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-2335992718788440922?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lftrUYgMIxoKAJ18dvvlkruOMAQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lftrUYgMIxoKAJ18dvvlkruOMAQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lftrUYgMIxoKAJ18dvvlkruOMAQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lftrUYgMIxoKAJ18dvvlkruOMAQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/dvWy366u-ZE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/2335992718788440922/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=2335992718788440922" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2335992718788440922?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/2335992718788440922?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/dvWy366u-ZE/watching-tv-with-mplayer.html" title="Watching TV with mplayer" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/06/watching-tv-with-mplayer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQNRX4zeSp7ImA9WxVaF04.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-1124373852032324706</id><published>2009-04-14T12:04:00.000-07:00</published><updated>2009-04-14T12:29:54.081-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-14T12:29:54.081-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="comments" /><title>Magic comments</title><content type="html">So you're writing some code, and there seems to be an error somewhere. As a real programmer, you're going to use printf or echo to debug your code. I happen to be writing a lot of PHP lately, so I also debug with var_dump. Not that it really matters, because after all it boils down to eliminating lines with errors, and as long as you use a programming language that supports &lt;strong&gt;//&lt;/strong&gt; for single line comments and &lt;strong&gt;/*&lt;/strong&gt; ... &lt;strong&gt;*/&lt;/strong&gt; for multiline comments you can use magic comments.&lt;br /&gt;&lt;br /&gt;Honestly, there's no magic involved, just a bit of logic. Let's say there's some code consisting of 3 blocks of lines:&lt;br /&gt;&lt;pre&gt;[block 1]&lt;br /&gt;&lt;br /&gt;[block 2]&lt;br /&gt;&lt;br /&gt;[block 3]&lt;/pre&gt;&lt;br /&gt;If I want to comment one block, I could simply put &lt;strong&gt;/*&lt;/strong&gt;, &lt;strong&gt;*/&lt;/strong&gt; around it like this:&lt;br /&gt;&lt;pre&gt;&lt;em&gt;/*&lt;br /&gt;[block 1]&lt;br /&gt;*/&lt;/em&gt;&lt;br /&gt;[block 2]&lt;br /&gt;&lt;br /&gt;[block 3]&lt;/pre&gt;&lt;br /&gt;However, soon enough I figure I needed to comment block 2 for a while. Because I'm lazy, I try to type no more than needed, so it becomes this:&lt;br /&gt;&lt;pre&gt;//*&lt;br /&gt;[block 1]&lt;br /&gt;&lt;em&gt;/*/&lt;br /&gt;[block 2]&lt;br /&gt;*/&lt;/em&gt;&lt;br /&gt;[block 3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I'm almost happy now, but it seems I need to switch back to having block 1 commented again instead of block 2... Of course I can remove the added characters, or I can just add a few more:&lt;br /&gt;&lt;pre&gt;&lt;em&gt;/*/*&lt;br /&gt;[block 1]&lt;br /&gt;/*/&lt;/em&gt;&lt;br /&gt;[block 2]&lt;br /&gt;&lt;em&gt;/*/&lt;br /&gt;//*/&lt;/em&gt;&lt;br /&gt;[block 3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now if I decide that I need to comment block 2 again, I only need to edit one character:&lt;br /&gt;&lt;pre&gt;//*&lt;br /&gt;[block 1]&lt;br /&gt;&lt;em&gt;/*/&lt;br /&gt;[block 2]&lt;br /&gt;/*/&lt;/em&gt;&lt;br /&gt;//*/&lt;br /&gt;[block 3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And it's actually possible to chain these by using a /*/ between 2 blocks. If the block in front was commented, the next block won't be commented. If the block in front however was not commented, this block will be commented. And there you go, boolean logic with comments, it's almost magic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-1124373852032324706?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/h8-ad5UfNNfIqWddyg_rTazIO1I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h8-ad5UfNNfIqWddyg_rTazIO1I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/h8-ad5UfNNfIqWddyg_rTazIO1I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h8-ad5UfNNfIqWddyg_rTazIO1I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/racRLASjPQo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/1124373852032324706/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=1124373852032324706" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1124373852032324706?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/1124373852032324706?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/racRLASjPQo/magic-comments.html" title="Magic comments" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/04/magic-comments.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMCRnk4eCp7ImA9WxVUEUg.&quot;"><id>tag:blogger.com,1999:blog-1858402208452860331.post-6156547771046162190</id><published>2009-03-15T15:12:00.001-07:00</published><updated>2009-03-15T15:51:07.730-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-15T15:51:07.730-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="usb flash drive" /><category scheme="http://www.blogger.com/atom/ns#" term="grub" /><category scheme="http://www.blogger.com/atom/ns#" term="ntfs" /><category scheme="http://www.blogger.com/atom/ns#" term="fdisk" /><category scheme="http://www.blogger.com/atom/ns#" term="flash drive" /><category scheme="http://www.blogger.com/atom/ns#" term="grub4dos" /><title>Creating a bootable USB flash drive formatted as NTFS</title><content type="html">Next in the series of bootable flash drives: NTFS support.&lt;br /&gt;&lt;br /&gt;I don't really care what filesystem my devices are, as long as I can read and write them. So FAT32 would be a decent choice, right? No. FAT32 has a file size limit of only 4G and I tend to store larger stuff on my Corsair Flash Survivor. I came up with two different solutions:&lt;br /&gt;1. Create two separate partitions, one with stuff GRUB needs access to, one with large stuff like the filesystem images and my data,&lt;br /&gt;2. Create a NTFS partition and boot from that.&lt;br /&gt;&lt;br /&gt;Of course I first came up with solution 2, but I couldn't find much information about grub and ntfs, except for total lack of support for ntfs. I was thinking about solution 1 and then decided it sucks if you're forced to use two partitions while you don't really want to, so I went on looking for booting from ntfs drives.&lt;br /&gt;&lt;br /&gt;After a while I came upon grub4dos. I can't say I really love it (without spending any time investigating it seems it's more of a hack than an enhancement to grub), but it's grub and it boots from ntfs formatted drives. Once I had that figured out, it was time to start doing some work.&lt;br /&gt;&lt;br /&gt;First, partition the flash drive so there's a large ntfs partition (in my case the whole 16G). In my case there was already a partition there, if there's not you can skip &lt;strong&gt;d&lt;/strong&gt;eletion of the partition.&lt;br /&gt;&lt;pre&gt;# &lt;strong&gt;fdisk /dev/sdx&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Command (m for help): &lt;strong&gt;d&lt;/strong&gt;&lt;br /&gt;Selected partition 1&lt;br /&gt;&lt;br /&gt;Command (m for help): &lt;strong&gt;n&lt;/strong&gt;&lt;br /&gt;Command action&lt;br /&gt;   e   extended&lt;br /&gt;   p   primary partition (1-4)&lt;br /&gt;&lt;strong&gt;p&lt;/strong&gt;&lt;br /&gt;Partition number (1-4): &lt;strong&gt;1&lt;/strong&gt;&lt;br /&gt;First cylinder (1-125, default 1): &lt;strong&gt;[return]&lt;/strong&gt;&lt;br /&gt;Using default value 1&lt;br /&gt;Last cylinder, +cylinders or +size{K,M,G} (1-125, default 125): &lt;strong&gt;[return]&lt;/strong&gt;&lt;br /&gt;Using default value 125&lt;br /&gt;&lt;br /&gt;Command (m for help): &lt;strong&gt;t&lt;/strong&gt;&lt;br /&gt;Selected partition 1&lt;br /&gt;Hex code (type L to list codes): &lt;strong&gt;7&lt;/strong&gt;&lt;br /&gt;Changed system type of partition 1 to 7 (HPFS/NTFS)&lt;br /&gt;&lt;br /&gt;Command (m for help): &lt;strong&gt;w&lt;/strong&gt;&lt;br /&gt;The partition table has been altered!&lt;br /&gt;&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;Syncing disks.&lt;/pre&gt;&lt;br /&gt;Now it's time to create a filesystem on the flash drive, since we've chosen ntfs we'll need &lt;em&gt;ntfsprogs&lt;/em&gt;, your linux distribution probably has it in it's repositories. Enter the following command to format the drive:&lt;br /&gt;&lt;pre&gt;# &lt;strong&gt;mkfs.ntfs -L label -Q /dev/sdxY&lt;/strong&gt;&lt;br /&gt;Cluster size has been automatically set to 4096 bytes.&lt;br /&gt;Creating NTFS volume structures.&lt;br /&gt;mkntfs completed successfully. Have a nice day.&lt;/pre&gt;&lt;br /&gt;This shouldn't have been hard, if I actually needed to explain those steps to you at all, so let's continue with the serious part. The next few steps need a grub4dos archive. You can find one at &lt;a href="http://download.gna.org/grub4dos/"&gt;their downloads page&lt;/a&gt;, I took &lt;a href="http://download.gna.org/grub4dos/grub4dos-0.4.4-2009-03-07.zip"&gt;grub4dos-0.4.4-2009-03-07.zip&lt;/a&gt;. Extract this and open a command line in the directory where the extracted files are. Now enter the following command:&lt;br /&gt;&lt;pre&gt;# &lt;strong&gt;./bootlace.com /dev/sdx&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Disk geometry calculated according to the partition table:&lt;br /&gt;&lt;br /&gt;        Sectors per track = 63, Number of heads = 255&lt;br /&gt;&lt;br /&gt;Success.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If it says Success or something similar, then grub4dos is on your flash drive. You can actually boot from it, however for grub4dos to be useful it needs some files. Copy &lt;em&gt;grldr&lt;/em&gt; to your flash drive (of course you need to mount it for that). It should be in the root of the drive. Now create a menu.lst in the root of the drive too (yes, this differs from grub behaviour). Edit the menu.lst file so it resembles a usable grub menu.lst and you're done.&lt;br /&gt;&lt;br /&gt;The following block is my menu.lst, if there's any interest in the files and layout I used then just leave a comment and I'll be sure to answer any questions about it.&lt;br /&gt;&lt;pre&gt;default 0&lt;br /&gt;timeout 60&lt;br /&gt;splashimage=/boot/splash.xpm.gz&lt;br /&gt;&lt;br /&gt;title Ubuntu Jaunty Alternate Install AMD64&lt;br /&gt;kernel /ubuntu/jaunty/vmlinuz&lt;br /&gt;initrd /ubuntu/jaunty/initrd.gz&lt;br /&gt;&lt;br /&gt;title Gentoo Minimal X86&lt;br /&gt;kernel /gentoo/x86/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/gentoo/x86/image.squashfs cdroot&lt;br /&gt;initrd /gentoo/x86/gentoo.igz&lt;br /&gt;&lt;br /&gt;title Gentoo Minimal AMD64&lt;br /&gt;kernel /gentoo/amd64/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/gentoo/amd64/image.squashfs cdroot&lt;br /&gt;initrd /gentoo/amd64/gentoo.igz&lt;br /&gt;&lt;br /&gt;title GParted&lt;br /&gt;kernel /gparted/vmlinuz boot=live union=aufs noswap vga=791 ip=frommedia nolocales live-media-path=gparted&lt;br /&gt;initrd /gparted/initrd1.img&lt;br /&gt;&lt;br /&gt;title Memtest 86+&lt;br /&gt;kernel /memtest86/memtest86-3.5&lt;br /&gt;&lt;br /&gt;title Boot first harddisk&lt;br /&gt;rootnoverify (hd1)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;title Reboot&lt;br /&gt;reboot&lt;br /&gt;&lt;br /&gt;title Shut down&lt;br /&gt;halt&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1858402208452860331-6156547771046162190?l=blog.mycroes.nl' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ueo4SuZMEWit-YlUCJkXPUXBwsA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ueo4SuZMEWit-YlUCJkXPUXBwsA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ueo4SuZMEWit-YlUCJkXPUXBwsA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ueo4SuZMEWit-YlUCJkXPUXBwsA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MycroesBlog/~4/M849uFTh8Oc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.mycroes.nl/feeds/6156547771046162190/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1858402208452860331&amp;postID=6156547771046162190" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6156547771046162190?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1858402208452860331/posts/default/6156547771046162190?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MycroesBlog/~3/M849uFTh8Oc/creating-bootable-usb-flash-drive.html" title="Creating a bootable USB flash drive formatted as NTFS" /><author><name>Michael Croes</name><uri>https://profiles.google.com/112599069227323928557</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-PFr6Lzcg6Kw/AAAAAAAAAAI/AAAAAAAAAB0/alEm4EhZ_eY/s512-c/photo.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://blog.mycroes.nl/2009/03/creating-bootable-usb-flash-drive.html</feedburner:origLink></entry></feed>

