This is part 5 in a series on organizational design and growth.
What it means
Each of us has a job to do, probably more than one, and our teammates should know what they are. Why it s important
Roles are a kind of standing commitment we make to each other. They re a way of dividing up work which is easy to understand and simple to apply. Utilizing this tool will make it easier for us to coordinate our day to day work, and manage the changes and growth we re going through. Old Status Quo
Roles are vague or nonexistent. Management roles in particular are probably not well understood. Many people juggle multiple roles, all of which are implicit. Moving to a new team means learning from scratch what other people do. People take responsibility for tasks and decisions largely on a case-by-case basis, or based on implicit knowledge of what someone does (or doesn t do). In many cases, there is only one person in the company who knows how to perform a certain function. When someone leaves or goes on vacation, gaps are left behind. New Status Quo
Each individual has a clear understanding of the scope of their job. We have a handful of well defined roles, which are used by multiple teams and have written definitions. People who are new or transfer between teams have a relatively easy time understanding what the people around them are doing. Many day to day responsibilities are defined by roles, and more than one person can fill that role. When someone leaves a team, another person can cover their critical roles. Behaviors that help
Define project roles: when starting something new, make it explicit who will be working on it. Often this will be more than one person, often from different teams. For example, customer-facing product changes should have at least a product owner and an engineering owner. This makes it easy to tell if too many concurrent projects are dependent on a single person, which is a recipe for blockage.
Define team roles: Most recurring tasks should fall within a defined role. An owner of a technical service is an example of a role. An on-call engineer is an example of a time-limited role. There are many others which will depend on the team and its scope.
Define job roles: Have a conversation with your teammates and manager about what the scope of your job is, which responsibilities are shared with other members of the team and which are yours alone.
Getting hung up on titles as ego gratification. Roles are tools, not masters.
Fear that a role limits your options, locks you into doing one thing forever. Roles can be as flexible as we want them to be.
Confused yet? The popular browser extension AdBlock for Chrome/Chromium and Safari has launched a new crowdsourced campaign - to buy up internet advertising space inviting people to download AdBlock, so they can block ads. Additionally, if they raise enough, they'd like to get additional space for a billboard at Times Square, a full page spread in the New York Times, and even a TV slot at the Superbowl (although the target for this is $4.2M, so I'm not entirely confident they'll make it.)
However, this does raise an interesting question, which has been under debate for some time. How do you make money on the internet without adverts? Wikipedia has a few interesting suggestions.
Firstly, affiliate programmes. These mean that any products or services that are linked or searched via the original site earn a little bit of commission for that site. Founded in the mid-90s, and most famously used by Amazon, it's a possible method for getting money. However, it should be deployed with careful thought. If a blogger or reviewer is recommending a product, is it simply because they are being paid to do so, or is it a genuine endorsement? The BBC ban this practice, and the Society of Professional Journalists also has strong guidelines on taking gifts. Interestingly, a few search engines now offer this to browsers for them sending their default search traffic to them.
Secondly, you could engage in (what I consider to be) the shady practice of data monetisation. People visit a website, and they leave data about their visit. By visiting here, you've told me that you're probably interested in technology issues, what country and city you're from, and where you came from. Other programmes and sites will also be able to wrap up what other sites you've visited, and can build up quite a profile of your browsing habits. Add together a rather unscrupulous vendor, and they can also know your contact details. This metadata can then be sold on.
Thirdly, you can essentially ask your readers for money. Donations, via a micropayment link (which I use) or larger donation requests. Another method is to have a membership system, where content is locked up behind a paywall. This does, however, risk making your content less valuable as people will just head elsewhere for news and opinion. To counter this, a couple of sites (LWN, Slashdot) simply delay the latest news for a little while. Alternatively, you can just ask like the fantastic C G P Grey has done. Interestingly, he also has a great video on why advertising can be a bad thing for content creators.
Lastly, you can sell things. This could be your authorship services on another site as a guest post, writing a book, offering consultancy services, or simple merchandise.
In summary though, which is more honest? An advert may well bend your view on what sort of content is being created, but is at least a lot more open than potentially hiding real motives behind affiliate links, and a lot more open than selling data. Asking for money is fairly straightforward, though could easily backfire if it's viewed as begging. Google's advertising income totalled $43.7 billion in 2012 - so it's quite clear that advertising is big business. Websites cost money to run, can the web survive in an ad-free environment? If so, it certainly won't be the same web as we know today.
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_REGION_NAME=DFW
export OS_USERNAME=<username>
export OS_TENANT_NAME=<clientid>
export OS_PASSWORD=<password>
export OS_PROJECT_ID=<clientid>
export OS_NO_CACHE=1
unset NOVA_RAX_AUTH
unset OS_AUTH_SYSTEM
0.5 of ctioga2, my plotting program. While there is still quite a lot of improvements I'd like to get in some day, the past few days have seen a lot of activity. Probably the most important change is the new space-separated command file format, much simpler than the old one (which is still supported, although marked clearly as deprecated now). Another important change for the users is the large improvement of error reporting: in most cases, ctioga2 pinpoints the exact location where things go wrong; it also features reporting on LaTeX errors. The last important feature is also the introduction of real contour plots, such as the one below, coming from the documentation:Now, I feel like ctioga2 is coming close to gnuplot in terms of features and ease of use. Part of my plans for the website is to create a gnuplot mockup gallery, in which I would take as many examples from the gnuplot website as possible (ie all the ones ctioga2 can reproduce) and compare the code and look of both.Among features I'd like to implement for ctioga2, here are the ones that I think are the most important ones:plot with instruction of gnuplot
TL;DR: db.collection.update( _id: 'x' , $pull: embedded_doc: _id: 'y' )
Queries are wrote for the mongo shell
Dot based access
If you have been using MongoDB for some time, then there are big chances that you will know the "dot-based access" on the find queries. This is the easier way to write those queries and will probably want to keep using that. Like:
db.collection.find( _id: 'x', 'embedded_doc._id': 'y' )
The thing is that does not work with everything, like: Arrays of embedded documents!
Little example schema
Let's suppose the following little schema (written for Mongoose):
A = new Schema(
w: String,
x: String
);
Document = new Schema(
embedded_doc: [A]
);
The collection of Document is called documents.
Updating arrays
If the arrays are not embedded documents I can actually just use a regular update like with any other field combined with a $set and change all the array like:
db.documents.update( _id: 'x', $set: array: [
a: 1 ,
a: 2 ,
a: 3
] )
And using conveniently $pull and $addToSet. But when it comes to embedded documents the history is very different. You can't make a simple $set because it will give you an error related to ModId which you can't change. So you really need to use $push, $addToSet, $pull and it's friends.
So all those you can do it as in the manual, but what if you want to make a $pull over an array of objects and w and x are not unique? Well, that's why you probably made them an embedded document! Then you have the _id and you try to use the dot notation like:
db.documents.update( _id: 'x' , $pull: "embedded_doc._id": 'y' )
And it looks good, except that it wont work. You have to use the complete syntax like:
db.documents.update( _id: 'x' , $pull: embedded_doc: _id: 'y' )
Had an afternoon of steak and science fiction. Elysium is only so-so, but
look what we found in a bookstore that was half religious materials and
half SF, local books, and carefully hidden romance novels:
![]() |
This is an idea that Keith Packard told me. It's a brilliant way to reduce
GitHub's growing lockin, but I don't know how to implement it. And I almost
forgot about it, until I had another annoying "how do I send you a patch
with this amazing git technology?" experience and woke up with my memory
refreshed.
The idea is to allow anyone to git push to any anonymous git://
repository. But the objects pushed are not stored in a public part of the
repository (which could be abused). Instead the receiving repository emails
them off to the repository owner, in a git-am-able format.
So this is like a github pull request except it can be made on any git
repository, and you don't have to go look up the obfuscated contact email
address and jump through git-format-patch hoops to make it. You just commit
changes to your local repository, and git push to wherever you cloned
from in the first place. If the push succeeds, you know your patch is on
its way for review.
Keith may have also wanted to store the objects in the repository in some
way that a simple git command run there could apply them without the git-am
bother on the receiving end. I forget. I think git-am would be good enough
-- and including the actual diffs in the email would actually make this far
superior to github pull request emails, which are maximally annoying by not
doing so.
daemon.pushscript config setting could enable this.
The script could be something like this:
#!/bin/sh set -e tmprepo="$(mktemp -d)" # this shared clone is *really* fast even for huge repositories, and uses # only a few 100 kb of disk space! git clone --shared --bare "$GIT_DIR" "$tmprepo" git-receive-pack "$tmprepo" # XXX add email sending code here. rm -rf "$tmprepo"Of course, this functionality could be built into the git-daemon too. I suspect a script hook and an example script in
contrib/ might be an
easier patch to get accepted into git though.
That may be as far as I take this idea, at least for now..
So, last year I've switched to an OpenPGP smartcard setup for my
whole personal/Debian PGP usage. When doing so, I've also switched
to subkeys, since it's pretty natural when using a smartcard. I
initially set up an expiration of one year for the subkeys, and
everything seems to be running just fine for now.
The expiration date was set to october 27th, and I though it'd
be a good idea to renew them quite in advance, considering there's
my signing key in there, which is (for example) used to sign
packages. If the Debian archive considers my signature subkey
expired, that means I can't upload packages anymore, which is a bit
of a problem (although I think I could still upload packages signed
by the main key). dak (Debian Archive Kit, the software managing
the Debian archive) uses keys from the keyring provided by Debian
admins, which is usually updated every month or so from the
keyring.debian.org public key
server, so pushing the expiration date two months before the
due date seemed like a good idea.
I've just did that, and it was pretty easy, actually. For those
who followed my
setup last year, here's how I did it:
First, I needed my main smartcard (the one storing the
main key), since it's the only one able to do operations on the
subkeys. So I plug it, and then:
corsac@scapa: gpg --edit-key 71ef0ba8
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
pub 4096R/71EF0BA8 created: 2009-05-06 expires: never usage: SC
trust: ultimate validity: ultimate
sub 4096g/36E31BD8 created: 2009-05-06 expires: never usage: E
sub 2048R/CC0E273D created: 2012-10-17 expires: 2013-10-27 usage: A
sub 2048R/A675C0A5 created: 2012-10-27 expires: 2013-10-27 usage: S
sub 2048R/D98D0D9F created: 2012-10-27 expires: 2013-10-27 usage: E
[ultimate] (1). Yves-Alexis Perez <corsac@corsac.net>
[ultimate] (2) Yves-Alexis Perez (Debian) <corsac@debian.org>
gpg&> key 2
pub 4096R/71EF0BA8 created: 2009-05-06 expires: never usage: SC
trust: ultimate validity: ultimate
sub 4096g/36E31BD8 created: 2009-05-06 expires: never usage: E
sub* 2048R/CC0E273D created: 2012-10-17 expires: 2013-10-27 usage: A
sub 2048R/A675C0A5 created: 2012-10-27 expires: 2013-10-27 usage: S
sub 2048R/D98D0D9F created: 2012-10-27 expires: 2013-10-27 usage: E
[ultimate] (1). Yves-Alexis Perez <corsac@corsac.net>
[ultimate] (2) Yves-Alexis Perez (Debian) <corsac@debian.org>
gpg> expire
Changing expiration time for a subkey.
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 429d
Key expires at mar. 28 oct. 2014 12:43:35 CET
Is this correct? (y/N) y
At that point, a pinentry dialog should ask you the PIN, and the
smartcard will sign the subkey. Repear for all the subkeys (in my
case, 3 and 4). If you ask for PIN confirmation at every signature,
the pinentry dialog should reappear each time.
When you're done, check that everything is ok, and save:
gpg> save corsac@scapa: gpg --list-keys 71ef0ba8 gpg: checking the trustdb gpg: public key of ultimately trusted key AF2195C9 not found gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 4 signed: 5 trust: 0-, 0q, 0n, 0m, 0f, 4u gpg: depth: 1 valid: 5 signed: 53 trust: 5-, 0q, 0n, 0m, 0f, 0u gpg: next trustdb check due at 2013-12-28 pub 4096R/71EF0BA8 2009-05-06 uid Yves-Alexis Perez <corsac@corsac.net> uid Yves-Alexis Perez (Debian) <corsac@debian.org> sub 4096g/36E31BD8 2009-05-06 [expires: 2014-10-28] sub 2048R/CC0E273D 2012-10-17 [expires: 2014-10-28] sub 2048R/A675C0A5 2012-10-27 [expires: 2014-10-28] sub 2048R/D98D0D9F 2012-10-27 [expires: 2014-10-28]Now that we have the new subkeys definition locally, we need to push it to the keyservers so other people get it too. In my case, I also need to push it to Debian keyring keyserver so it gets picked at the next update:
corsac@scapa: gpg --send-keys 71ef0ba8 gpg: sending key 71EF0BA8 to hkp server subkeys.pgp.net corsac@scapa: gpg --keyserver keyring.debian.org --send-keys 71ef0ba8 gpg: sending key 71EF0BA8 to hkp server keyring.debian.orgMain smartcard now back in safe place. As far as I can tell, there's no operation needed on the daily smartcard (which only holds the subkeys), but you will need to refresh your public key on any machine you use it on before it gets the updated expiration date.
When starting a new HTML project, a common base is to use
HTML5 Boilerplate which helps by setting up the essential
bits. Such a template is quite useful for both beginners and
experienced developers as it is kept up-to-date with best practices
and it avoids forgetting some of them.
Recently, I have started several little projects written in C for a
customer. Each project was bootstrapped from the previous one. I
thought it would be useful to start a template that I could reuse
easily. Hence, bootstrap.c1, a template for simple projects written
in C with the autotools, was born.
pip.
Bootstrapping a new project is super easy:
$ cookiecutter https://github.com/vincentbernat/bootstrap.c.git Cloning into 'bootstrap.c'... remote: Counting objects: 90, done. remote: Compressing objects: 100% (68/68), done. remote: Total 90 (delta 48), reused 64 (delta 22) Unpacking objects: 100% (90/90), done. Checking connectivity... done full_name (default is "Vincent Bernat")? Alfred Thirsty email (default is "bernat@luffy.cx")? alfred@thirsty.eu repo_name (default is "bootstrap")? secretproject project_name (default is "bootstrap")? secretproject project_description (default is "boilerplate for small C programs with autotools")? Super secret project for humans
supersecret
directory:
.
autogen.sh
configure.ac
get-version
m4
ax_cflags_gcc_option.m4
ax_ld_check_flag.m4
Makefile.am
README.md
src
log.c
log.h
Makefile.am
secretproject.8
secretproject.c
secretproject.h
2 directories, 13 files
$ git init Initialized empty Git repository in /home/bernat/tmp/secretproject/.git/ $ git add . $ git commit -m "Initial import" [...]
$ git ls-tree -r --name-only HEAD \ > xargs grep -nH "T[O]DO:" \ > sed 's/\([^:]*:[^:]*\):\(.*\)T[O]DO:\(.*\)/\3 (\1)/' \ > sort -ns \ > awk '(last != $1) print "" last=$1 ; print ' 2003 Add the dependencies of your project here. (configure.ac:52) 2003 The use of "Jansson" here is an example, you don't have (configure.ac:53) 2003 to keep it. (configure.ac:54) 2004 Each time you have used PKG_CHECK_MODULES macro (src/Makefile.am:12) 2004 in configure.ac , you get two variables that (src/Makefile.am:13) 2004 you can substitute like above. (src/Makefile.am:14) 3000 It's time for you program to do something. Add anything (src/secretproject.c:76) 3000 you want here. */ (src/secretproject.c:77) [...]
configure.ac and Makefile.am.log_warn(),
log_info().
autoconf to generate a configure script, andautomake to generate makefiles using a similar but higher-level language.autoconf. Many of them
are included in the GNU Autoconf Archive and ready to use. The
quality of such macros are usually quite good. If you need to
correctly detect the appropriate way to compile a program with
GNU Readline or something compatible, there is a macro for that.configure.ac and do not add useless macros: a macro should
be used only if it solves a real problem.
Happy hacking!
boilerplate.c would have been a
better name.
start ext2fs: Hurd server bootstrap: ext2fs[device:hd0s1] exec init proc auth INIT: version 2.88 booting Using makefile-style concurrent boot in runlevel S. Activating swap...done. Checking root file system...fsck from util-linux 2.20.1 hd2 : tray open or drive not ready hd2 : tray open or drive not ready hd2 : tray open or drive not ready hd2 : tray open or drive not ready end_request: I/O error, dev 02:00, sector 0 /dev/hd0s1: clean, 44693/181056 files, 291766/723200 blocks done. Activating lvm and md swap...(default pager): Already paging to partition hd0s5! done. Checking file systems...fsck from util-linux 2.20.1 hd2 : tray open or drive not ready hd2 : tray open or drive not ready end_request: I/O error, dev 02:00, sector 0 done. Cleaning up temporary files... /tmp. Mounting local filesystems...done. Activating swapfile swap...(default pager): Already paging to partition hd0s5! done. df: Warning: cannot read table of mounted file systems: No such file or directory Cleaning up temporary files.... Configuring network interfaces...Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on Socket//dev/eth0 Sending on Socket//dev/eth0 *** stack smashing detected ***: dhclient terminated Aborted Failed to bring up /dev/eth0. done. Cleaning up temporary files.... Setting up X socket directories... /tmp/.X11-unix /tmp/.ICE-unix. INIT: Entering runlevel: 2 Using makefile-style concurrent boot in runlevel 2. Starting enhanced syslogd: rsyslogd. Starting deferred execution scheduler: atd. Starting periodic command scheduler: cron. Starting system message bus: dbusFailed to set socket option"/var/run/dbus/system_bus_socket": Protocol not available. Starting OpenBSD Secure Shell server: sshd. unexpected ACK from keyboard GNU 0.3 (debian) (console) login: root [...] root@debian:~# ifup /dev/eth0 Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on Socket//dev/eth0 Sending on Socket//dev/eth0 *** stack smashing detected ***: dhclient terminated Aborted Failed to bring up /dev/eth0. root@debian:~# dhclient -v -pf /run/dhclient.-dev-eth0.pid -lf /var/lib/dhcp/dhclient.-dev-eth0.leases /dev/eth0 Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on Socket//dev/eth0 Sending on Socket//dev/eth0 *** stack smashing detected ***: dhclient terminated Aborted root@debian:~# dhclient -pf /run/dhclient.-dev-eth0.pid -lf /var/lib/dhcp/dhclient.-dev-eth0.leases /dev/eth0 root@debian:~# ifup /dev/eth0 Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on Socket//dev/eth0 Sending on Socket//dev/eth0 DHCPREQUEST on /dev/eth0 to 255.255.255.255 port 67 DHCPACK from 10.0.2.2 bound to 10.0.2.15 -- renewal in 34108 seconds. ps: comm: Unknown format spec root@debian:~# halt Broadcast message from root@debian (console) (Fri Aug 23 19:42:19 2013): The system is going down for system halt NOW! INIT: Switching to runlevel: 0root@debian:~# INIT: Sending processes the TERM signal INIT: Sending processes the KILL signal Using makefile-style concurrent boot in runlevel 0. Stopping deferred execution scheduler: atd. task c10f53f8 deallocating an invalid port 2098928, most probably a bug. Asking all remaining processes to terminate...done. All processes ended within 1 seconds...done. Stopping enhanced syslogd: rsyslogd. Deconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on Socket//dev/eth0 Sending on Socket//dev/eth0 DHCPRELEASE on /dev/eth0 to 10.0.2.2 port 67 /dev/eth0 (2): inet address 0.0.0.0 netmask 255.255.255.0 broadcast 10.0.2.255 flags BROADCAST ALLMULTI MULTICAST mtu 1500 done. Deactivating swap...swapoff: /dev/hd0s5: 177152k swap space done. Unmounting weak filesystems...umount: /etc/mtab: Warning: duplicate entry for device /dev/hd0s1 (/servers/socket/26) umount: /etc/mtab: Warning: duplicate entry for device /dev/hd0s1 (/dev/cons) umount: could not find entry for: /dev/cons umount: could not find entry for: /servers/socket/26 done. mount: cannot remount /: Device or resource busy Will now halt. store a new irq 11init: notifying pfinet of shutdown...init: notifying tmpfs swap of shutdown...init: notifying tmpfs swap of shutdown...init: notifying tmpfs swap of shutdown...init: notifying ext2fs device:hd0s1 of shutdown...init: halting Mach (flags 0x8)... In tight loop: hit ctl-alt-del to rebootWith some tiny patches for ifupdown I've been able to resolve network related issues. All of them? Of course not, funny thing about developing for the Hurd is that once you fix one thing, then some other thing or code path is executed that has never been run on Hurd before, and therefore something else breaks. In this case I fixed ifupdown to generate valid names for the pid file and leases file and all of the sudden dhclient starts dying. Funny thing about that is, if one drops the -v flag from the dhclient invocation as I did it above, the crash isn't triggered and once the lease file has been successfully written, it is safe to add the -v flag again. Not yet sure what goes on there, then again, looking at the source of isc-dhcp-client it is not so surprising that it crashes :/ When I first looked at ifupdown it was written in noweb, a literate programming tool. It is an interesting idea, even more so since (classic) c can be very verbose and cryptic. But it decouples the control flow from the structure of the program, which makes patching it quite a challenge since it is not as obvious where the changes have to go in. This is how ifupdown looked some weeks ago:
% wc --lines ifupdown.nw 6123 ifupdown.nw % pdftk ifupdown.pdf dump_data grep NumberOfPages NumberOfPages: 113The ifupdown.nw is the noweb source, from which seven .c, four .h, two .pl and one Makefile are generated. It also contains a redicioulus amount of documentation, to the point that the authors at several points did not now what to write and just drop some nonsensical lines into the file. The source also compiles to a 113 page pdf file, that contains all of the documentation and all of the code, not at all in the order that one would expect a program to be written, but in the order the authors chose to structure the documentation. Fortunately for me the maintainer decided to drop the noweb source and to add the generated files to the source control system. This made my job much easier :) So here are the patches I published this week:
Very long post ahead (sorry for the wall of text), part of a series of posts on some sysadmin topics, see
post 1 and
post 2. I want
to show you how I set up my tiny dedicated server to have encrypted partitions,
and to reinstall it from scratch. All of this without ever accessing the actual
server console.
root's authorized_keys file), I wouldn't trust an installation
done by a third party. Also, I wanted to have all my data securely encrypted.
I know this is not perfect, and there are possible attacks. But I think it is a
good barrier to have to deter entities without big budgets from getting my
data.
I have done this twice on my servers, and today I was reviewing each step as he
was doing the same thing (with some slight differences) on his brand new
server, so I think this is all mostly correct. Please, tell me if you find a
bug in this guide.
This was done on my 12 /month Kimsufi dedicated server, sold by OVH (see my
previous post
on why I chose it), and some things are specific to them. But you can do the
same thing with any dedicated server that has a rescue netboot image.
The process is to boot into the rescue image (this is of course a weak link, as
the image could have a keylogger, but we have to stop the paranoia at some
point), manually partition the disk, set-up encryption, and LVM; and then
install a Debian system with debootstrap.
To be able to unlock the encrypted disks, you will have to ssh into the
server after a reboot and enter the passphrase (this is done inside the
initrd phase). Once unlocked, the normal boot process continues.
If anything fails, you end up with an unreachable system: it might or might
have not booted, the disk might or might not be unlocked, etc. You can always
go back into the rescue netboot image, but that does not allow you to see the
boot process. Some providers will give you real remote console access, OVH
charges you silly money for that.
They used to offer a "virtual KVM", which was a bit of a kludge, but it worked:
another netboot image that started a QEMU connected to a VNC server, so by
connecting to the VNC server, you would be able to interact with the emulated
boot process, but with a fake BIOS and a virtual network. For some unspecified
reason they've stopped offering
this, but there is a
workaround
available. The bottom line is, if you have some kind of rescue netboot image,
you can just download and run QEMU on it and do the same trick.
$ ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no root@$ IP
For the rest of the text, I am assuming you have one hard drive called
/dev/sda. We start by partitioning it:
# fdisk /dev/sda
Start a new partition table with o, and then create two primary partitions: a
small one for /boot at the beginning (100 to 300 MB would do), and a second
one with the remaining space. Set both as type 83 (Linux), and don't forget
to activate the first one, as this servers refuse to boot from the hard drive
without that.
Create the file system for /boot, and the encrypted device:
# mkfs.ext4 /dev/sda1
# cryptsetup -s 512 -c aes-xts-plain64 luksFormat /dev/sda2
The encryption parameters are the same as the ones used by the Debian Installer
by default, so don't change them unless you really know what you are doing. You
will need to type a passphrase for the encrypted device, be sure not to forget
it! This passphrase can later be changed (or secondary passphrases added) with
the cryptsetup tool.
Look up the crypt device's UUID, and save it for later:
# cryptsetup luksDump /dev/sda2 grep UUID:
UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Open the encrypted device (type the passphrase again), and set up the LVM
volume group:
# cryptsetup luksOpen /dev/sda2 sda2_crypt
# pvcreate /dev/mapper/sda2_crypt
# vgcreate vg0 /dev/mapper/sda2_crypt
Create the logical volumes, this is of course a matter of personal taste and
there are many possible variations. This is my current layout, note that I put
most of the "big data" in /srv.
# lvcreate -L 500m -n root vg0
# lvcreate -L 1.5g -n usr vg0
# lvcreate -L 3g -n var vg0
# lvcreate -L 1g -n home vg0
# lvcreate -L 10g -n srv vg0
# lvcreate -L 500m -n swap vg0
# lvcreate -L 100m -n tmp vg0
Some possible variations:
/tmp, so instead of creating a logical
volume, you would add RAMTMP=yes to /etc/default/tmpfs./ and /usr in one same partition, as neither of them
change much./home in /srv, and bind mount it later./target. Note
that I like to use human-readable labels.
# for i in home root srv tmp usr var; do
mkfs.ext4 -L $i /dev/mapper/vg-$i; done
# mkswap -L swap /dev/mapper/vg0-swap
# mkdir /target
# mount /dev/mapper/vg0-root /target
# mkdir /target/ boot,home,srv,tmp,usr,var
# mount /dev/sda1 /target/boot
# for i in home srv tmp usr var; do
mount /dev/mapper/vg-$i /target/$i; done
# swapon /dev/mapper/vg-swap
Don't forget to set the right permissions for /tmp.
# chmod 1777 /target/tmp
If you want to do the /home on /srv, you'll need to do this (and then copy
to /etc/fstab):
# mkdir /target/srv/home
# mount -o bind /target/srv/home /target/home
The disk is ready now. We will use debootstrap to install the base system.
The OVH image carries it, otherwise consult the relevant section in the
Install manual
for details. It is important that at this point you check that you have a good
GPG keyring for debootstrap to verify the installation source, by comparing
it to a good one (for example, the one in your machine):
# gpg /usr/share/keyrings/debian-archive-keyring.gpg
pub 4096R/B98321F9 2010-08-07 Squeeze Stable Release Key <debian-release@lists.debian.org>
pub 4096R/473041FA 2010-08-27 Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>
pub 4096R/65FFB764 2012-05-08 Wheezy Stable Release Key <debian-release@lists.debian.org>
pub 4096R/46925553 2012-04-27 Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>
Now, for the actual installation. You can use any Debian mirror, OVH has their
own in the local network. In OVH's case it is critical to specify the
architecture, as the rescue image is i386. I didn't notice that and had to
painfully switch architectures in place (which was absolutely not possible a
couple of years ago).
# debootstrap --arch amd64 wheezy /target http://debian.mirrors.ovh.net/debian
After a few minutes downloading and installing stuff, you almost have a Debian system ready to go. Since this is not D-I, we still need to tighten a few screws manually. Let's mount some needed file systems, and enter the brand new system with chroot:
# mount -o bind /dev /target/dev
# mount -t proc proc /target/proc
# mount -t sysfs sys /target/sys
# XTERM=xterm-color LANG=C.UTF-8 chroot /target /bin/bash
The most critical parts now are to correctly save the parameters for the encrypted device, and the partitions and logical volumes. You'll need the UUID saved before:
# echo 'sda2_crypt UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none luks' \
> /etc/crypttab
Create the file systems table in /etc/fstab. Here I use labels to identify
the devices:
# file system mount point type options dump pass
LABEL=root / ext4 errors=remount-ro 0 1
LABEL=tmp /tmp ext4 rw,nosuid,nodev 0 2
LABEL=var /var ext4 rw 0 2
LABEL=usr /usr ext4 rw,nodev 0 2
LABEL=home /home ext4 rw,nosuid,nodev 0 2
# Alternative home in /srv:
#/srv/home /home auto bind 0 0
LABEL=srv /srv ext4 rw,nosuid,nodev 0 2
LABEL=boot /boot ext4 rw,nosuid,nodev 0 2
LABEL=swap none swap sw 0 0
You can also just use the device mapper's names
(/dev/mapper/<volume_group>-<logical_volume>), be sure not to use the
/dev/<volume_group>/<logical_volume> naming, as there are some initrd-tools
that choked on them.
# file system mount point type options dump pass
/dev/mapper/vg0-root / ext4 errors=remount-ro 0 1
/dev/mapper/vg0-tmp /tmp ext4 rw,nosuid,nodev 0 2
/dev/mapper/vg0-var /var ext4 rw 0 2
/dev/mapper/vg0-usr /usr ext4 rw,nodev 0 2
/dev/mapper/vg0-home /home ext4 rw,nosuid,nodev 0 2
# Alternative home in /srv:
#/srv/home /home auto bind 0 0
/dev/mapper/vg0-srv /srv ext4 rw,nosuid,nodev 0 2
/dev/sda1 /boot ext4 rw,nosuid,nodev 0 2
/dev/mapper/vg0-swap none swap sw 0 0
Some tools depend on /etc/mtab, which now is just a symbolic link:
# ln -sf /proc/mounts /etc/mtab
Now configure the network. You most surely can use DHCP, but you might prefer
static configuration, that's personal choice. For DHCP, it is very
straightforward:
# cat >> /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
For static configuration, first find the current valid addresses and routes as
obtained by DHCP:
# ip address
# ip route
And then store them:
# cat >> /etc/network/interfaces
auto eth0
iface eth0 inet static
address AAA.BBB.CCC.DDD/24
gateway AAA.BBB.CCC.254
pre-up /sbin/ip addr flush dev eth0 true
Note that pre-up command I added; that is to remove the configuration that
is to be done by the kernel during boot (more on that later), otherwise
ifupdown will complain about existing addresses.
If your provider does IPv6, add it too. For OVH, the IPv6 set-up is a bit
weird, so you need to add the routes in post-up. Your default gateway is
going to be your /64 prefix, with the last byte replaced by ff, and then
followed by :ff:ff:ff:ff. As you can see, that gateway is not in your network
segment, so you need to add an explicit route to it. They have some
information, but it is completely unreadable.
If your IPv6 address is 2001:41D0:1234:5678::1/64, you will add:
iface eth0 inet6 static
address 2001:41D0:1234:5678::1/64
post-up /sbin/ip -6 route add 2001:41D0:1234:56ff:ff:ff:ff:ff dev eth0
post-up /sbin/ip -6 route add default via 2001:41D0:1234:56ff:ff:ff:ff:ff
You probably don't want the auto-configured IPv6 addresses, so disable them via
sysctl:
# cat >> /etc/sysctl.conf
# Disable IPv6 autoconf
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.eth0.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.eth0.accept_ra = 0
To have a working DNS resolver, we can use the local server (OVH in this case):
# cat > /etc/resolv.conf
search $DOMAIN
nameserver 213.186.33.99
The most important part of a new install: choose a host name (and make the
system use it).
# echo $HOSTNAME > /etc/hostname
# hostname $HOSTNAME
# echo "127.0.1.1 $HOSTNAME.$DOMAIN $HOSTNAME" >> /etc/hosts
If we want to speficy the BIOS clock to use UTC:
# echo -e '0.0 0 0.0\n0\nUTC' > /etc/adjtime
Set up your time zone:
# dpkg-reconfigure tzdata
Configure APT with your preferred mirrors. I also prevent APT from installing
recommends by default.
# echo deb http://ftp2.fr.debian.org/debian wheezy main contrib non-free \
>> /etc/apt/sources.list
# echo deb http://ftp2.fr.debian.net/debian wheezy-updates main contrib non-free \
>> /etc/apt/sources.list
# echo deb http://security.debian.org/ wheezy/updates main contrib non-free \
>> /etc/apt/sources.list
# echo 'APT::Install-Recommends "False";' > /etc/apt/apt.conf.d/02recommends
# apt-get update
Before installing any package, let's make sure that the initial ram disk
(initrd) that is going to be created will allow us to connect. There will be
no chance of using the root password during boot. Your public key is usually
found in $HOME/.ssh/id_rsa.pub.
# mkdir -p /etc/initramfs-tools/root/.ssh/
# echo $(YOUR_PUB_RSA_KEY) > /etc/initramfs-tools/root/.ssh/authorized_keys
If you change this, or the host key stored at
/etc/dropbear/dropbear_*_host_key, the /etc/crypttab, or any other
critical piece of information for the booting process, you need to run
update-initramfs -u.
Now we can install the missing pieces:
# apt-get install makedev cryptsetup lvm2 ssh dropbear busybox ssh \
initramfs-tools locales linux-image-amd64 grub-pc kbd console-setup
During the installation you will have to choose where to install grub, I
recommend directly on /dev/sda. Also, the magic initrd will be created. We
want to double check that it has all the important pieces for a successful
boot:
# zcat /boot/initrd.img-3.2.0-4-amd64 cpio -t conf/conf.d/cryptroot \
etc/lvm/lvm.conf etc/dropbear/\* root/.ssh/authorized_keys sbin/dropbear
etc/lvm/lvm.conf
etc/dropbear/dropbear_dss_host_key
etc/dropbear/dropbear_rsa_host_key
sbin/dropbear
root/.ssh/authorized_keys
conf/conf.d/cryptroot
All these files need to be there. Most critically, we need to check that the cryptroot file has the right information to access the root file system:
# zcat /boot/initrd.img-* cpio -i --to-stdout conf/conf.d/cryptroot
target=sda2_crypt,source=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx,key=none,rootdev,lvm=vg0-root
If all that was correct, now we need to tell the kernel to configure the
network as soon as possible so we can connect to the initrd and unlock the
disks. This is done by passing a command-line option though grub. This should match what was done in /etc/network/interfaces: either DHCP or static configuration. For DHCP, this line should be changed in /etc/default/grub:
GRUB_CMDLINE_LINUX="ip=:::::eth0:dhcp"
For static configuration:
GRUB_CMDLINE_LINUX="ip=MY_IP_ADDR::MY_DEFAULT_GW:MY_NETMASK::eth0:none"
It is also a good idea to disable the quiet boot and graphical boot splash, in case we need to use QEMU to fix some booting issue:
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_TERMINAL=console
And make the changes effective:
# update-grub2
Having fsck fix problems automatically can be a life-saver too:
# echo FSCKFIX=yes >> /etc/default/rcS
Get some very useful packages:
# apt-get install vim less ntpdate sudo
Create an user for yourself, possibly make it an administrator:
# adduser tincho
# adduser tincho sudo
# adduser tincho adm
This is mostly done, exit the chroot, and unmount everything.
# exit # the chroot.
# umount /target/ dev,proc,sys,boot,home,srv,tmp,usr,var
# umount /target
# swapoff -a
# lvchange -an /dev/mapper/vg0-*
# cryptsetup luksClose sda2_crypt
Disable the netboot option from your administration panel, reboot, and hope it
all goes well.
If you followed every step carefully, a few minutes later you should be able to ping your server. Use this snippet to enter the password remotely:
$ stty -echo; ssh -o UserKnownHostsFile=$HOME/.ssh/known_hosts.initramfs \
-o BatchMode=yes root@"$HOST" 'cat > /lib/cryptsetup/passfifo'; \
stty echo
It is very important that you close the pipe (with control-D twice) without
typing enter. For my servers, I have a script that reads the passphrase from
a GPG-encrypted file and pipes it directly into the remote server. That way, I
only type the GPG passphrase locally:
$ cat unlock.sh
#!/bin/sh
BASE="$(dirname "$0")"
HOST="$1"
gpg --decrypt "$BASE"/key-"$HOST".gpg \
ssh -o UserKnownHostsFile="$BASE"/known_hosts.initramfs -o BatchMode=yes \
root@"$HOST" 'cat > /lib/cryptsetup/passfifo'
It might be a good idea to create a long, impossible to guess passphrase that
you can use in the GPG-encrypted file, and that you can also print and store in
somewhere safe. See the luksAddKey function in the cryptsetup(8) man page.
Once again, if everything went right, a few seconds later the openSSH server
will replace the tiny dropbear and you will be able to access your server
normally (and with the real SSH host key).
Hope you find this article helpful! I would love to hear your feedback.
On the last day of DebConf 13, RichiH and Ganneff and I set up a
git-annex repository that all Debian developers have automatic
commit access to, and
everyone can clone and browse.
See the announcement email.
This is an interesting repository for me for several reasons. Selfishly, I
have always wanted an easy way to download lots of DebConf photos for
offline viewing, and never seem to get around to downloading everything
from gallery.debconf.org when I have bandwidth. I've also wanted an example
repository that shows how git-annex can be used by a large group for
collaboration. Finally, the way this repository is set up with an incoming
queue is fairly unique.
With 430 files in the repository, totaling over 3.5 gigabytes (which doesn't
include all the talk videos that are #included into it),
and at least 18 people having cloned the repository so far,
the debconf-share repository is well on its way to being a sort of large
git-annex repository.
Just running git annex whereis is interesting; many of the files already
have 8 copies. Some talk videos are more popular than others and you can
see when they're downloaded too. But enough snooping.. ;)
So far people have uploaded mostly photos and talk slides. Other places
exist to store those things in the DebConf infrastructure, but it's nice
to have them all available in one tree. I particularly like today's
addition of chrysn's files
which include the raw photos and hugin files used to produce panoramas,
and then pull those together into a postcard which has all its sources
available.
In my corner of the debconf-share repository, I'm collecting together files
regarding the possibly-historic dpkg-source-git-re-re-redesign process
that would have otherwise been scattered around various places and probably
not all published. This includes an hour long recording of the main
design session (recorded with permissions) made by my laptop's mic, which,
surprisingly, turned out to be pretty listenable. I will probably have more
to say about this process later, once Ian announces dgit.
So, we're still seeing how usage develops. I hope that having this
available during the next DebConf, and other Debian meetings, rather
than only at the end, will further facilitate file sharing and storage.
Especially if a fast clone is available right on the DebConf LAN. ;)
annex-content hook is run whenever someone uploads
a file to there. It moves all annexed content over to annex.debconf.org
for publication.
This involves some ugly but safe stuff to do with publically readable
restricted use ssh private keys. It was the hardest piece to get working,
and is only necessary because we don't want to bloat git.debian.org with this
stuff and it's not practical to give everyone logins to
annex.debconf.org.
As I slowly read my good friends wishing each other a good trip, telling they got home safely, and the IRC channels form thick drops of a bitter-sweet etheral substance, I cannot help feeling DebConf13 is over For me as well, from the distance. Many friends gave me warm greetings, and without being there, gave me that beautiful feeling of real community that Debian has given me for ten years already, since I met in real-life many of its developers at DebConf3 in Oslo. And yes, I have stated this far too many times I have attended every DebConf since (and worked organizing most of them). This year, over 300 people were gathered in Switzerland to enjoy the always most intense weeks of the year.
This year, I was unable to attend due to calendar clashes. Even so, without the stress that organizers have, and thanks to the great work of the always-loved Video Team, I think I was able to be present at more sessions than at in any of the last few years. Oh, and for the readers of this blog who were not there Do you want to follow what was presented? You can download already the videos for all of the recorded presentations (that were, due to the planned coverage and the manageable size of the Video Team, about of the total scheduled sessions). And, as always, I was able to follow many very interesting talks and take part of a couple interesting meetings/BoF sessions. I still have a bit of catchup, partly due to the timezone difference (I was only at one of the sessions during the Swiss morning, at 02:30 local time, the pkg-ruby-extras team BoF).
Anyway... Not being there, I surely was an avid consumer of the photos posted in the DebConf13 gallery, and will surely follow it for some more time as some of you upload your pending material. It was clear from the beginning that, no matter what your definition of consensus is, the chosen venue was beautiful. A beautiful place between the lake and the mountains where our sportiest guys had a very good share of morning runs, cycling sessions, competition sports of different types, outright plain fun for attendees of all sizes and all species...
But, hey, wait! During a chat in the course of DebConf, a friend told me a bit worried that all this beauty and fun might make our dear and very important sponsors they are paying for a geek vacation, is it so? No, not at all. Not by a long stretch. And just looking at those same galleries makes it clear and obvious. After all, it's widely known that Debian is the operating system for the gurus. Simple: It's impossible to have all those geeks without getting amazing work done, in ways that even seem clich s (this last photo had Joey Hess explaining dpkg format version 3.0 (git) ideas, sketched after waking up at 3AM on the first sketching surface available to him). After all, Debian people are famous for their inclination to use any excuse to open their computers and hack away. We can find Debianers hacking in small spaces and also hacking out in the fields. But this time, people were able to hack indoors while enjoying the nature and hack outdoors under a tree. And, yes, one of the things that makes organizing DebConf worth it is, after eleven months having low-bandwidth meetings over IRC, having the opportunity to plan for the next days face to face, in a relaxed but work-full environment.
Anyway, here at home I didn't sit idly just longing over them. How could I? We are just celebrating the Debian Project's 20th anniversary!
http://gwolf.org/content/jonathan-host-and-organizer-rancho-electr-nico">Jonathan, a Debian enthusiast, student at my university, and collaborator for several free software-related collectives in Mexico City, invited me to the celebration at Rancho Electr nico (which I recently mentioned in this same blog). While I was unable to stay for the whole celebration, we had a very good time; I talked about some ways on how to contribute to Debian. Although I didn't have much of a presentation prepared for it, I feel it was successful and interesting for the attendees I just hope to start seeing some of them get into any of the ways for helping Debian soon. I also stayed as a listener and ocassional commenter for a talk on the Debian Project's history and goals, and to a presentation on a nifty electronic music programming tool called Supercollider (of course, available in Debian).
Now, "regular" life should continue. For some value of "regular".
Next.