commit 02f704abe13b44ecb440dc40c6380788d4760235 Author: Gibheer Date: Sun Oct 25 01:41:33 2015 +0200 initial commit and import This is the initial import of all blog posts and a pretty workable theme. More work will follow. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..0f57afe --- /dev/null +++ b/config.toml @@ -0,0 +1,9 @@ +baseurl = "http://zero-knowledge.org/" +languageCode = "en-us" +title = "zero-knowledge" +theme = "zero" +SectionPagesMenu = "main" + +[taxonomies] + author = "author" + tag = "tags" diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..0cfdd1e --- /dev/null +++ b/content/about.md @@ -0,0 +1,11 @@ ++++ +date = "2015-10-11T20:00:29+02:00" +draft = true +title = "about" + ++++ + +## about zero-knowledge + +This blog is the personal blog of Gibheer and Stormwind, where we write about +any topic from IT which keeps us working at the moment. diff --git a/content/post/1.md b/content/post/1.md new file mode 100644 index 0000000..3c06ab0 --- /dev/null +++ b/content/post/1.md @@ -0,0 +1,34 @@ ++++ +title = "zero-knowledge ohne Forum" +date = "2009-05-04T18:54:00+00:00" +author = "Gibheer" +draft = false ++++ + +Hallo lieber Besucher, + +ja, zero-knowledge hat kein Forum mehr. + +Nach gut 3 Jahren, in denen das Forum mal mehr, mal weniger aktiv +benutzt wurde, haben wir uns dazu entschlossen, das Forum endgültig +abzuschalten. Zum einen war das Forum in den letzten 2 oder 3 Monaten +gar nicht mehr besucht worden und zum anderen war die Forensoftware für +uns nicht mehr updatebar. + +Das myBB an sich war eine wirklich gute Software. Allerdings haben sie +den PostgreSQL-Support eher missachtet und Fehler darauf geschoben, +anstatt zu versuchen den Fehler selber zu beheben. Da hat sich dann auch +der Aufwand nicht mehr gelohnt, für ein Inaktives Forum noch ein Update +aufzuspielen. + +Damit die Domain allerdings nicht komplett versauert und Blub sein zu +Hause behalten kann, haben Stormwind und ich uns dazu entschlossen hier +einen Blog einzurichten, um euch wenigstens so ab und zu noch etwas über +Scripte und Neuerungen erzählen zu können. + +Ich hoffe einfach mal, dass sich die Zeit ändert und das zero-knowledge +Forum vielleicht mal wieder auferstehen kann. + +Doch bis dahin, + +Willkommen im Blog diff --git a/content/post/10.md b/content/post/10.md new file mode 100644 index 0000000..37eca64 --- /dev/null +++ b/content/post/10.md @@ -0,0 +1,72 @@ ++++ +title = "Woche der Updates" +date = "2009-07-01T08:58:00+00:00" +author = "Gibheer" +draft = false ++++ + +Irgendwie ist diese Woche die Woche der Updates. Es gab Updates für +[NetBeans 6.7](http://netbeans.org) (eine IDE für verschiedene +Programmiersprachen), [VirtualBox](http://www.virtualbox.org/) +(Virtuelle Maschinen), [PHP 5.3.0](http://php.net) und [Firefox +3.5](http://www.mozilla-europe.org/de/firefox/). + +Jedes dieser Updates stellt dabei einen grossen Schritt nach vorne dar +und bei jedem Programm sind eine Menge neuer Funktionen hinzugekommen +und viele Bugs beseitigt worden. + +Update 01.07.2009 - 15:00Uhr: [PostgreSQL 8.4 ist gerade +rausgekommen](http://www.postgresql.org/about/news.1108) + +Eine grosse Neuerung bei **NetBeans** ist die direkte Anbindung der IDE +an Kenai. [Kenai](http://www.kenai.com) ist im Grunde eine Platform wie +Sourceforge, die von Sun für freie Projekte entwickelt wurde. + +Mit der direkten Anbindung kann man somit all seine Projekte &uum;ber +NetBeans steuern. + +Was allerdings für mich interessanter ist, ist die direkte +Unterstützung von PHPUnit, Serendipity und die SQL-Code +vervollständigung in PHP-Code. + +Für Ruby gibt es jetzt shoulda-unterstützung (ein +Testframework - noch nicht genau angeschaut) und endlich Debugging :D. + +Ebenfalls neu ist Groovy and Grails, was als Plugin verfügbar ist. +Eine Liste weiterer vieler Änderungen findet ihr +[hier](http://www.netbeans.org/community/releases/67/]). + +Bei **VirtualBox** ist vor allem die Mehrprozessorunterstützung und +der 3D-Support für DirectX eine super Neuerung. Was an Fehlern +behoben wurde, könnt ihr im +[Changelog](http://www.virtualbox.org/wiki/Changelog) nachlesen. + +Bei **PHP** weiss ich nicht genau, was ich von dem neuen Release halten +soll. Nachdem die Version 6 mehr oder weniger auf Eis gelegt wurde, weil +die Entwickler Unicode nicht richtig implementiert bekommen, beinhaltet +die Version 5.3 eben alle anderen Änderungen, wie zum Beispiel jump +labels, Namespaces, “A garbage collector has been added, and is enabled +by default” (gab es da vorher keinen? Oo) und einige andere Sachen. +Namespaces kann ich zu einem gewissen Teil noch nachvollziehen, dass man +die gebrauchen kann, aber wozu zur Hölle wurden die Jump-Labels +implementiert? Dieses Uralte Relikt aus alten Tagen braucht doch kein +Mensch mehr und sollte um Himmels willen nie benutzt werden! + +Über **Firefox** wurde eigentlich schon sehr viel berichtet, so +dass ich mir hier einen grossen Bericht spare. Ich find es aber auf +jeden Fall klasse, dass sie die Mediatags aus HTML5 schon drin haben und +das in Verbindung mit OGG als Videoquelle wunderbar funktioniert. Ich +bin schon gespannt, was sich da die Leute alles ausdenken werden, um +diese Funktion zu benutzen :D. + +Also wie ihr seht, es gibt eine Menge Neuerungen. Aber das ist noch +lange nicht das Ende. Inkscape 0.47 und PostgreSQL 8.4 stehen ebenfalls +vor der Vollendung, so dass wir uns diesen Sommer wohl noch auf ein paar +tolle neue Sachen freuen können. + +Nachtrag 01.07.2009 - 12:15Uhr: Ich hab gerade noch einen Bugreport zu +[PHP und Jump labels](http://bugs.php.net/bug.php?id=48669) gefunden. + +Nachtrag2 01.07.2009 - 15:00Uhr: [PostgreSQL 8.4 ist gerade +rausgekommen](http://www.postgresql.org/about/news.1108) (dafuer mach +ich dann noch mal einen extra Eintrag ;)) diff --git a/content/post/100.md b/content/post/100.md new file mode 100644 index 0000000..53efe08 --- /dev/null +++ b/content/post/100.md @@ -0,0 +1,67 @@ ++++ +title = "use dovecot to store mails with lmtp" +date = "2013-11-06T06:37:32+00:00" +author = "Gibheer" +draft = false ++++ + +After more than a year working on my mail setup, I think I have it running in +a pretty good way. As some of the stuff is not documented at all in the wide of +the internet, I will post parts here to make it accessible to others. + +Many setups use the MTA (postfix, exim) to store mails on the filesystem. My +setup lets [dovecot take care of that][dovecot-lmtp]. That way it is the only +process able to change data on the filesystem. + +to make this work, we first need a [lmtp socket][lmtp socket] opened by dovecot. +The configuration part looks like this + + service lmtp { + unix_listener /var/spool/postfix/private/delivery.sock { + mode = 0600 + user = postfix + group = postfix + } + } + +LMTP is a lightweight smtp protocol and most mail server components can speak +it. + +Next we need to tell postfix to send mails to this socket instead storing it +on the filesystem. This can be done with with the following setting + + mailbox_transport = lmtp:unix:/var/spool/postfix/private/delivery.sock + +or for virtal accounts with + + virtual_transport = lmtp:unix:/var/spool/postfix/private/delivery.sock + +Now postfix will use the socket to deliver the mails. + +It is also possible to use other services between these two like dspam. In my +case postfix delivers the mails to dspam and that will deliver them to dovecot. + +For dovecot change the path of the socket to something dspam can reach. I'm +using `/var/run/delivery.sock`. + +Then change the dspam.conf to use that socket as a delivery host + + DeliveryProto LMTP + DeliveryHost "/var/run/delivery.sock" + +As postfix needs to speak to dspam, we set dspam to create a socket too + + ServerMode auto + ServerDomainSocketPath "/var/run/dspam.sock" + +`ServerMode` should be set to either `auto` or `standard`. + +Now the only thing left to do is to tell postfix to use that socket to deliver +its mails. For that, set the options from before to the new socket + + virtual_transport = lmtp:unix:/var/run/dspam.sock + +And with that, we have a nice setup where only dovecot stores mails. + +[lmtp socket]: http://wiki2.dovecot.org/LMTP +[dovecot-lmtp]: http://wiki2.dovecot.org/HowTo/PostfixDovecotLMTP diff --git a/content/post/102.md b/content/post/102.md new file mode 100644 index 0000000..b169c9c --- /dev/null +++ b/content/post/102.md @@ -0,0 +1,18 @@ ++++ +title = "choosing a firewall on freebsd" +date = "2014-01-06T16:15:58+00:00" +author = "Gibheer" +draft = false ++++ + +As I was setting up a firewall on my freebsd server I had to choose between one of the three firewalls available. + +There is the freebsd developed firewall ipfw, the older filter ipf and the openbsd developed pf. As for features they have all their advantages and disadvantages. Best is to read [firewall documentation](https://www.freebsd.org/doc/handbook/firewalls-apps.html) of freebsd. + +In the end my decision was to use pf for one reason - it can check the syntax before it is running any command. This was very important for me, as I'm not able to get direct access to the server easily. + +ipf and ipfw both get initialized by a series of shell commands. That means the firewall controll program gets called by a series of commands. Is one command failing, the script may fail and the firewall ends up in a state undefined by the script. You may not even get into the server by ssh anymore and needs a reboot. + +This is less of a problem with pf, as it does a syntax check on the configuration beforehand. It is not possible to throw pf into an undefined state because of a typo. So the only option left would be to forget ssh access or anything else. + +I found the syntax of pf a bit weird, but I got a working firewall up and running which seems to work pretty well. ipfw looks similar, so maybe I try it the next time. diff --git a/content/post/103.md b/content/post/103.md new file mode 100644 index 0000000..057efc0 --- /dev/null +++ b/content/post/103.md @@ -0,0 +1,34 @@ ++++ +title = "block mails for unknown users" +date = "2014-01-16T09:01:01+00:00" +author = "Gibheer" +draft = false ++++ + +Postfix' policy system is a bit confusing. There are so many knobs to avoid +receiving mails which do not belong to any account on the system and most of +them check multiple things at once, which makes building restrictions a bit of +a gamble. + +After I finally enabled the security reports in freebsd the amount of mails in +the mailqueue hit me. After some further investigation I found even error +messages of dspam, having trouble to rate spam for receivers which were not +even in the system. + +To fix it, I read into the postfix documentation again, build new and hopefully +better restrictions. The result was even more spam getting through. +After a day went by and my head was relaxed I read the documentation again and +found the following in the +[postfix manual](http://www.postfix.org/VIRTUAL_README.html#in_virtual_other) + +> The `virtual_mailbox_maps` parameter specifies the lookup table with all valid +> recipient addresses. The lookup result value is ignored by Postfix. + +So instead of one of the many restrictions a completely unrelated parameter is +responsible for blocking mails for unknown users. Another parameter related is +[`smtpd_reject_unlisted_recipient`](http://www.postfix.org/postconf.5.html#smtpd_reject_unlisted_recipient). +This is the only other place I could find, which listed `virtual_mailbox_maps` +and I only found it when looking for links for this blog entry. + +So if you ever have problems with receiving mails for unknown users, check +`smtpd_reject_unlistef_recipient` and `virtual_mailbox_maps`. diff --git a/content/post/104.md b/content/post/104.md new file mode 100644 index 0000000..632f798 --- /dev/null +++ b/content/post/104.md @@ -0,0 +1,29 @@ ++++ +title = "overhaul of the blog" +date = "2014-02-19T09:42:11+00:00" +author = "Gibheer" +draft = false ++++ + +The new blog is finally online. It took us nearly more than a year to finally get the new design done. + +First we replaced thin with puma. Thin was getting more and more a bother and didn't really work +reliable anymore. Because of the software needed, it was pinned to a specific version of rack, +thin, rubinius and some other stuff. Changing one dependency meant a lot of working getting it +going again. +Puma together with rubinius make a pretty nice stack and in all the time it worked pretty well. +We will see, how good it can handle running longer than some hours. + +The next part we did was throw out sinatra and replace it with [zero](https://github.com/libzero/zero), +our own toolkit for building small web applications. +But instead of building yet another object spawning machine, we tried something different. +The new blog uses a chain of functions to process a request into a response. This has the +advantage that the number of objects kept around for the livetime of a request is minimized, +the stack level is smaller and in all it should now need much less memory to process a request. +From the numbers, things are looking good, but we will see how it will behave in the future. + +On the frontend part we minimized the layout further, but found some nice functionality. It is +now possible to view one post after another through the same pagination mechanism. This should +make a nice experience when reading more a number of posts one after another. + +We hope you like the new design and will enjoy reading our stuff in the future too. diff --git a/content/post/105.md b/content/post/105.md new file mode 100644 index 0000000..f6a2209 --- /dev/null +++ b/content/post/105.md @@ -0,0 +1,21 @@ ++++ +title = "[cfengine] log to syslog" +date = "2014-02-24T21:51:39+00:00" +author = "Gibheer" +draft = false ++++ + +When you want to start with cfengine, it is not exactly obvious how some stuff works. To make +it easier for others, I will write about some stuff I find out in the process. + +For the start, here is the first thing I found out. By default cfengine logs to files +in the work directory. This can get a bit ugly, when the agent is running every 5min. + As I use cf-execd, I added the option +[executorfacility](https://cfengine.com/docs/3.5/reference-components-cfexecd.html#executorfacility) +to the exed section. + + body executor control { + executorfacility => "LOG_LOCAL7"; + } + +After that a restart of execd will result in logs appearing through syslog. diff --git a/content/post/106.md b/content/post/106.md new file mode 100644 index 0000000..dd734f9 --- /dev/null +++ b/content/post/106.md @@ -0,0 +1,68 @@ ++++ +title = "scan to samba share with HP Officejet pro 8600" +date = "2014-03-16T10:28:12+00:00" +author = "Gibheer" +draft = false ++++ + +Yesterday I bought a printer/scanner combination, a HP Officejet pro 8600. It +has some nice functions included, but the most important for us was the ability +to print to a network storage. +As I did not find any documentation on how it is possible to get the printer to +speak with a samba share, I will describe it here. + +To get started I assume, that you already have a configured and running samba +server. + +The first step is to create a new system user and group. This user will used to +create a login on the samba server for the scanner. The group will hold all users +which should have access to the scanned documents. The following commands are for +freebsd, but there should be an equivalent for any other system (like useradd). + + pw groupadd -n scans + pw useradd -n scans -u 10000 -c "login for scanner" -d /nonexistent -g scans -s /usr/sbin/nologin + +We can already add the user to the samba user managament. Don't forget to set +a strong password. + + smbpasswd -a scans + +As we have the group for all scan users, we can add every account which should +have access + + pw groupmod scans -m gibheer,stormwind + +Now we need a directory to store the scans into. We make sure, that none other +than group members can modify data in that directory. + + zfs create rpool/export/scans + chown scans:scans /export/scans + chmod 770 /export/scans + +Now that we have the system stuff done, we need to configure the share in the +samba config. Add and modify the following part + + [scans] + comment = scan directory + path = /export/scans + writeable = yes + create mode = 0660 + guest ok = no + valid users = @scans + +Now restart/reload the samba server and the share should be good to go. +The only thing left is to configure the scanner to use that share. I did it over +the webinterface. For that, go to `https:///#hId-NetworkFolderAccounts`. +The we add a new network folder with the following data: + +* display name: scans +* network path: +* user name: scans +* password: + +In the next step, you can secure the network drive with a pin. In the third step +you can set the default scan settings and now you are done. +Safe and test the settings and everything should work fine. The first scan will +be named scan.pdf and all following have an id appended. Too bad there isn't a +setting to append a timestamp instead. But it is still very nice t o be able to +scan to a network device. diff --git a/content/post/107.md b/content/post/107.md new file mode 100644 index 0000000..e8f1020 --- /dev/null +++ b/content/post/107.md @@ -0,0 +1,36 @@ ++++ +title = "no cfengine anymore" +date = "2014-03-16T10:51:52+00:00" +author = "Gibheer" +draft = false ++++ + +I thought I could write more good stuff about cfengine, but it had some pretty +serious issues for me. + +The first issue is the documentation. There are two documents available. One for +an older version but very well written and a newer one which is a nightmare to +navigate. I would use the older version, if it would work all the time. + +The second issue is that cfengine can destroy itself. cfengine is one of the +oldest configuration management systems and I didn't expect that. + +Given a configuration error, the server will give out the files to the agents. As +the agent pulls are configured in the same promise files as the rest of the +system an error in any file will result in the agent not being able to pull any +new version. + +Further is the syntax not easy at all and has some bogus limitations. For example +it is not allowed to name a promise file with a dash. But instead of a warning +or error, cfengine just can't find the file. + +This is not at all what I expect to get. + +What I need is a system, which can't deactivate itself or even better, just runs +on a central server. I also didn't want to run weird scripts just to get ruby +compiled on the system to setup the configuration management. In my eyes, that +is part of the job of the tool. + +The only one I found which can handle that seems to be ansible. It is written +in python and runs all commands remote with the help of python or in a raw mode. +The first tests also looked very promising. I will keep posting, how it is going. diff --git a/content/post/108.md b/content/post/108.md new file mode 100644 index 0000000..e997a76 --- /dev/null +++ b/content/post/108.md @@ -0,0 +1,98 @@ ++++ +title = "playing with go" +date = "2014-04-04T22:39:45+00:00" +author = "Gibheer" +draft = false ++++ + +For some weeks now I have been playing with Go, a programming language developed +with support from google. I'm not really sure yet, if I like it or not. + +The ugly things first - so that the nice things can be enjoyed longer. + +Gos package management is probably one of the worst points of the language. It +has an included system to load code from any repository system, but everything +has to be versioned. The weird thing is that they forgot to make it possible to +pin the dependencies to a specific version. Some projects are on the way to +implement this feature, but it will probably take some time. + +What I also miss a shell to test code and just try stuff. Go is a language which +is compiled. I really like it for small code spikes, calculations and the like. +I really hope they will include it sometime in the future, but I doubt it. + +With that comes also a very strict project directory structure, which makes it +nearly impossible to just open a project and code away. One has to move into +the project structure. + +The naming of functions and variables is strict too. Everything is bound to the +package namespace by default. If the variable, type or function begins with a +capital letter, it means that the object is exported and can be used from other +packages. + + // a public function + func FooBar() { + } + + // not a public function + func fooBar() { + } + +Coming from other programming languages, it might be a bit irritating and I still +don't really like the strictness, but my hands learned the lesson and mostly +capitalize it for me. + +Now the most interesting part for me is, that I can use Go very easily. I have +to look for much of the functions, but the syntax is very easy to learn. Just +for fun I built a small cassandra benchmark in a couple of hours and it works +very nice. + +After some adjustments it even ran in parallel and is now stressing a cassandra +cluster for more than 3 weeks. That was a very nice experience. + +Starting a thread in Go is surprisingly easy. There is nothing much needed to +get it started. + + go function(arg2, arg2) + +It is really nice to just include a small two letter command to get the function +to run in parallel. + +Go also includes a feature I wished for some time in Ruby. Here is an example +of what I mean + + def foo(arg1) + return unless arg1.respond_to?(:bar) + do_stuff + end + +What this function does is test the argument for a specific method. Essentially +it is an interface without a name. For some time I found that pretty nice to +ask for methods instead of some weird name someone put behind the class name. + +The Go designers found another way for the same problem. They called them +also interfaces, but they work a bit differently. The same example, but this +time in Go + + type Barer interface { + func Bar() + } + + func foo(b Bar) { + do_stuff + } + +In Go, we give our method constraint a name and use that in the function +definition. But instead of adding the name to the struct or class like in Java, +only the method has to be implemented and the compiler takes care of the rest. + +But the biggest improvement for me is the tooling around Go. They deliver it +with a formatting tool, a documentation and a test tool. And everything works +blazingly fast. Even the compiler can run in mere seconds instead of minutes. +It actually makes fun to have such a fast feedback cycle with a compiled +language. + +So for me, Go is definitely an interesting but not perfect project. The language +definition is great and the tooling is good. But the strict and weird project +directory structure and project management is currently a big problem for me. + +I hope they get that figured out and then I will gladly use Go for some stuff. diff --git a/content/post/109.md b/content/post/109.md new file mode 100644 index 0000000..e405004 --- /dev/null +++ b/content/post/109.md @@ -0,0 +1,34 @@ ++++ +title = "learning the ansible way" +date = "2014-08-08T19:13:07+00:00" +author = "Gibheer" +draft = false ++++ + +Some weeks ago I read a [blog post](http://palcu.blogspot.se/2014/06/dotfiles-and-dev-tools-provisioned-by.html) about rolling out your configs with ansible as a way to learn how to use it. The posts wasn't full of information how to do it, but his repository was a great inspiration. + +As I stopped [using cfengine](/post/107) and instead wanted to use ansible, that was a great opportunity to further learn how to use it and I have to say, it is a really nice experience. Apart from a bunch configs I find every now and then, I have everything in my [config repository](https://github.com/Gibheer/configs/tree/501c2887b74b7447803e1903bd7c0781d911d363/playbooks). + +The config is split at the moment between servers and workstations, but using an inventory file with localhost. As I mostly use freebsd and archlinux, I had to set the python interpreter path to different locations. There are two ways to do that in ansible. The first is to add it to the inventory + + [hosts] + localhost + + [hosts:vars] + ansible_connection=local + ansible_python_interpreter=/usr/local/bin/python2 + +and the other is to set it in the playbook + + - hosts: hosts + vars: + ansible_python_interpreter: /usr/local/bin/python2 + roles: + - vim + +The latter has the small disadvantage, that running plain ansible is not possible. Ansible in the command and check mode also needs an inventory and uses the variables too. But if they are not stated there, ansible has no idea what to do. But at the moment, it isn't so much a problem. +Maybe that problem can be solved by using a [dynamic inventory](http://docs.ansible.com/intro_dynamic_inventory.html#other-inventory-scripts). + +What I can definitely recommend is using roles. These are descriptions on what to do and can be filled with variables from the outside. I have used them bundle all tasks for one topic. Then I can unclude these for the hosts I want them to have, which makes rather nice playbooks. One good example is my [vim config](https://github.com/Gibheer/configs/tree/501c2887b74b7447803e1903bd7c0781d911d363/playbooks/roles/vim), as it shows [how to use lists](https://github.com/Gibheer/configs/blob/501c2887b74b7447803e1903bd7c0781d911d363/playbooks/roles/vim/tasks/main.yml). + +All in all I'm pretty impressed how well it works. At the moment I'm working on a way to provision jails automatically, so that I can run the new server completely through ansible. Should make moving to a new server in the fututre much easier. diff --git a/content/post/11.md b/content/post/11.md new file mode 100644 index 0000000..771aa22 --- /dev/null +++ b/content/post/11.md @@ -0,0 +1,15 @@ ++++ +title = "Dokumentation fuer (Open)Solaris" +date = "2009-08-11T13:14:00+00:00" +author = "Gibheer" +draft = false ++++ + +Durch ein Banner auf [pg-forum](http://pg-forum.de) bin ich eben auf die +Seite bei Sun gelangt, wo sich einige Dokumente in pdf-Form befinden +über dtrace, Container, ZFS usw. + +Da ist wahrscheinlich für jeden etwas dabei. + +Der Link zur Seite ist: [Sun +Dokumentation](http://uk.sun.com/practice/software/solaris/how_to_guide.jsp?cid=20090729DE_TACO_SHTG_D_0001) diff --git a/content/post/110.md b/content/post/110.md new file mode 100644 index 0000000..b351289 --- /dev/null +++ b/content/post/110.md @@ -0,0 +1,63 @@ ++++ +title = "range types in postgres" +date = "2014-08-08T20:23:36+00:00" +author = "Gibheer" +draft = false ++++ + +Nearly two years ago, Postgres got a very nice feature - [range types][range-types]. These are available for timestamps, numerics and integers. +The problem is, that till now, I didn't have a good example what one could do with it. But today someone gave me a quest to use it! + +His problem was, that they had id ranges used by customers and they weren't sure if they overlapped. The table looked something like this: + + create table ranges( + range_id serial primary key, + lower_bound bigint not null, + upper_bound bigint not null + ); + +With data like this + + insert into ranges(lower_bound, upper_bound) values + (120000, 120500), (123000, 123750), (123750, 124000); + +They had something like 40,000 rows of that kind. So this was perfect for using range type queries. + +To find out, if there was an overlap, I used the following query + + select * + from ranges r1 + join ranges r2 + on int8range(r1.lower_bound, r1.upper_bound, '[]') && + int8range(r2.lower_bound, r2.upper_bound, '[]') + where r1.range_id != r2.range_id; + +In this case, int8range takes two bigint values and converts it to a range. The string `[]` defines if the two values are included or excluded in the range. In this example, they are included. +The output for this query looked like the following + + range_id │ lower_bound │ upper_bound │ range_id │ lower_bound │ upper_bound + ──────────┼─────────────┼─────────────┼──────────┼─────────────┼───────────── + 2 │ 123000 │ 123750 │ 3 │ 123750 │ 124000 + 3 │ 123750 │ 124000 │ 2 │ 123000 │ 123750 + (2 rows) + + Time: 0.317 ms + +But as I said, the table had 40,000 values. That means the set to filter has a size of 1.6 billion entries. The computation of the query took a very long time, so I used another nice feature of postgres - transactions. + +The idea was to add a temporary index to get the computation done in a much faster time (the index is also described in the [documentation][index]). + + begin; + create index on ranges using gist(int8range(lower_bound, upper_bound, '[]')); + select * + from ranges r1 + join ranges r2 + on int8range(r1.lower_bound, r1.upper_bound, '[]') && + int8range(r2.lower_bound, r2.upper_bound, '[]') + where r1.range_id != r2.range_id; + rollback; + +The overall runtime in my case was 300ms, so the writelock wasn't that much of a concern anymore. + +[range-types]: http://www.postgresql.org/docs/current/static/rangetypes.html +[index]: http://www.postgresql.org/docs/current/static/rangetypes.html#RANGETYPES-INDEXING diff --git a/content/post/111.md b/content/post/111.md new file mode 100644 index 0000000..8ceec1f --- /dev/null +++ b/content/post/111.md @@ -0,0 +1,71 @@ ++++ +title = "common table expressions in postgres" +date = "2014-10-13T21:45:31+00:00" +author = "Gibheer" +draft = false ++++ + +Four weeks ago I was askes to show some features of PostgreSQL. In that +presentation I came up with an interesting statement, with which I could show +nice feature. + +What I'm talking about is the usage of [common table expressions (or short CTE)][CTE] +and explain. + +Common table expressions create a temporary table just for this query. The +result can be used anywhere in the rest of the query. It is pretty useful to +group sub selects into smaller chunks, but also to create DML statements which +return data. + +A statement using CTEs can look like this: + + with numbers as ( + select generate_series(1,10) + ) + select * from numbers; + +But it gets even nicer, when we can use this to move data between tables, for +example to archive old data. + +Lets create a table and an archive table and try it out. + + $ create table foo( + id serial primary key, + t text + ); + $ create table foo_archive( + like foo + ); + $ insert into foo(t) + select generate_series(1,500); + +The [like option][like option] can be used to copy the table structure to a new table. + +The table `foo` is now filled with data. Next we will delete all rows where the +modulus 25 of the ID resolves to 0 and insert the row to the archive table. + + $ with deleted_rows as ( + delete from foo where id % 25 = 0 returning * + ) + insert into foo_archive select * from deleted_rows; + +Another nice feature of postgres is the possibility to get an explain from a +delete or insert. So when we prepend explain to the above query, we get this +explain: + + QUERY PLAN + ─────────────────────────────────────────────────────────────────── + Insert on foo_archive (cost=28.45..28.57 rows=6 width=36) + CTE deleted_rows + -> Delete on foo (cost=0.00..28.45 rows=6 width=6) + -> Seq Scan on foo (cost=0.00..28.45 rows=6 width=6) + Filter: ((id % 25) = 0) + -> CTE Scan on deleted_rows (cost=0.00..0.12 rows=6 width=36) + (6 rows) + +This explain shows, that a sequence scan is done for the delete and grouped into +the CTE deleted_rows, our temporary view. This is then scanned again and used to +insert the data into foo_archive. + +[CTE]: http://www.postgresql.org/docs/current/static/queries-with.html +[like option]: http://www.postgresql.org/docs/current/static/sql-createtable.html diff --git a/content/post/112.md b/content/post/112.md new file mode 100644 index 0000000..a282bc0 --- /dev/null +++ b/content/post/112.md @@ -0,0 +1,156 @@ ++++ +title = "using unbound and dnsmasq" +date = "2014-12-09T22:13:58+00:00" +author = "Gibheer" +draft = false ++++ + +After some time of using an [Almond](http://www.securifi.com/almond) as our router +and always having trouble with disconnects, I bought a small [apu1d4](http://www.pcengines.ch/apu1d4.htm), +an AMD low power board, as our new router. +It is now running FreeBSD and is very stable. Not a single connection was +dropped yet. + +As we have some services in our network, like a fileserver and a printer, we +always wanted to use names instead of IPs, but not a single router yet could +provide that. So this was the first problem I solved. + +FreeBSD comes with unbound preinstalled. Unbound is a caching DNS resolver, which +helps answer DNS queries faster, when they were already queried before. I +wanted to use unbound as the primary source for DNS queries, as the caching +functionality is pretty nice. +Further I wanted an easy DHCP server, which would also function as a DNS server. +For that purpose dnsmasq fits best. There are also ways to use dhcpd, bind and +some glue to get the same result, but I wanted as few services as possible. + +So my setup constellation looks like this: + + client -> unbound -> dnsmasq + +-----> ISP dns server + +For my internal tld, I will use zero. The dns server is called cerberus.zero and +has the IP 192.168.42.2. The network for this setup is 192.168.42.0/24. + +## configuring unbound + +For this to work, first we configure unbound to make name resolution work at +all. Most files already have pretty good defaults, so we will overwrite these +with a file in `/etc/unbound/conf.d/`, in my case `/etc/unbound/conf.d/zero.conf`. + + server: + interface: 127.0.0.1 + interface: 192.168.42.2 + do-not-query-localhost: no + access-control: 192.168.42.0/24 allow + local-data: "cerberus. 86400 IN A 192.168.42.2" + local-data: "cerberus.zero. 86400 IN A 192.168.42.2" + local-data: "2.42.168.192.in-addr.arpa 86400 IN PTR cerberus.zero." + local-zone: "42.168.192.in-addr.arpa" nodefault + domain-insecure: "zero" + + forward-zone: + name: "zero" + forward-addr: 127.0.0.1@5353 + + forward-zone: + name: "42.168.192.in-addr.arpa." + forward-addr: 127.0.0.1@5353 + +So what happens here is the following. First we tell unbound, on which addresses +it should listen for incoming queries. +Next we staate, that querying dns servers in localhost is totally okay. This is +needed to later be able to resolve addresses on the local dnsmasq. If your dnsmasq +is running on a different machine, you can leave this out. +With `access-control` we allow the network `192.168.42.0/24` to query the dns +server. +The next three lines tell unbound, that the name cerberus and cerberus.zero are one +and the same machine, the DNS server. Without these two lines unbound would not +resolve the name of the local server, even if its name would be stated in `/etc/hosts`. +With the last line we enable name resolution for the local network. +The key domain-insecure tells unbound, that this domain has no support for DNSSEC. +DNSSEC is enabled by default on unbound. + +The two `forward-zone` entries tell unbound, where it should ask for queries regarding +the `zero` tld and the reverse entries of the network. The address in this case points +to the dnsmasq instance. In my case, that is running on localhost and port 5353. + +Now we can add unbound to `/etc/rc.conf` and start unbound for the first time +with the following command + + $ sysrc local_unbound_enable=YES && service local_unbound start + +Now you should be able to resolve the local hostname already + + $ host cerberus.zero + cerberus.zero has address 192.168.42.2 + +## configuring dnsmasq + +The next step is to configure dnsmasq, so that it provides DHCP and name resolution +for the network. When adjusting the config, please read the comments for each +option in your config file carefully. +You can find an example config in `/usr/local/etc/dnsmasq.conf.example`. Copy +it to `/usr/local/etc/dnsmasq.conf` and open it in your editor: + + port=5353 + domain-needed + bogus-priv + no-resolv + no-hosts + local=/zero/ + except-interface=re0 + bind-interfaces + local-service + expand-hosts + domain=zero + dhcp-range=192.168.42.11,192.168.42.200,255.255.255.0,48h + dhcp-option=option:router,192.168.42.2 + dhcp-option=option:dns-server,192.168.42.2 + dhcp-host=00:90:f5:f0:fc:13,0c:8b:fd:6b:04:9a,sodium,192.168.42.23,96h + +First we set the port to 5353, as defined in the unbound config. On this port +dnsmasq will listen for incoming dns requests. +The next two options are to avoid forwarding dns requests needlessly. +The option `no-resolv` avoids dnsmasq knowning of any other dns server. `no-hosts` +does the same for `/etc/hosts`. Its sole purpose is to provide DNS for the +local domain, so it needn't to know. + +The next option tells dnsmasq for which domain it is responsible. It will also +avoid answering requests for any other domain. + +`except-interfaces` tells dnsmasq on which interfaces _not_ to listen on. You +should enter here all external interfaces to avoid queries from the wide web +detecting hosts on your internal network. +The option `bind-interfaces` will try to listen only on the interfaces allowed +instead of listening on all interfaces and filtering the traffic. This makes +dnsmasq a bit more secure, as not listening at all is better than listening. + +The two options `expand-hosts` and `domain=zero` will expand all dns requests +with the given domain part, if it is missing. This way, it is easier to resolv +hosts in the local domain. + +The next three options configure the DHCP part of dnsmasq. First is the range. +In this example, the range starts from `192.168.42.11` and ends in `192.168.42.200` +and all IPs get a 48h lease time. +So if a new hosts enters the network, it will be given an IP from this range. +The next two lines set options sent with the DHCP offer to the client, so it +learns the default route and dns server. As both is running on the same machine +in my case, it points to the same IP. + +Now all machines which should have a static name and/or IP can be set through +dhcp-host lines. You have to give the mac address, the name, the IP and the +lease time. +There are many examples in the example dnsmasq config, so the best is to read +these. + +When your configuration is done, you can enable the dnsmasq service and start it + + $ sysrc dnsmasq_enable=YES && service dnsmasq start + +When you get your first IP, do the following request and it should give you +your IP + + $ host $(hostname) + sodium.zero has address 192.168.42.23 + +With this, we have a running DNS server setup with DHCP. diff --git a/content/post/113.md b/content/post/113.md new file mode 100644 index 0000000..e825e5b --- /dev/null +++ b/content/post/113.md @@ -0,0 +1,44 @@ ++++ +title = "setting zpool features" +date = "2014-12-10T13:40:27+00:00" +author = "Gibheer" +draft = false ++++ + +Before SUN was bought by Oracle, OpenSolaris had ever newer versions and +upgrading was just an + + $ zpool upgrade rpool + +away. But since then, the open source version of ZFS gained feature flags. + + POOL FEATURE + --------------- + tank1 + multi_vdev_crash_dump + enabled_txg + hole_birth + extensible_dataset + embedded_data + bookmarks + filesystem_limits + +If you want to enable only one of these features, you may have already hit the +problem, that `zpool upgrade` can only upgrade one pool or all. + +The way to go is to use `zpool set`. Feature flags are options on the pool and +can also be listed with `zpool get`. + + $ zpool get all tank1 | grep feature + tank1 feature@async_destroy enabled local + tank1 feature@empty_bpobj active local + tank1 feature@lz4_compress active local + tank1 feature@multi_vdev_crash_dump disabled local + ... + +Enabling a feature, for example _multi_vdev_crash_dump_, would then be + + $ zpool set feature@multi_vdev_crash_dump=enabled tank1 + +It will then disappear from the `zpool upgrade` output and be set to enabled +active in `zpool get`. diff --git a/content/post/114.md b/content/post/114.md new file mode 100644 index 0000000..ea9f6ae --- /dev/null +++ b/content/post/114.md @@ -0,0 +1,14 @@ ++++ +title = "pgstats - vmstat like stats for postgres" +date = "2015-03-02T20:51:09+00:00" +author = "Gibheer" +draft = false ++++ + +Some weeks ago a tool got my attention - pgstats. It was mentioned in a [blog post](http://blog.guillaume.lelarge.info/index.php/post/2015/01/25/A-new-vmstat-like-tool-for-PostgreSQL), so I tried it out and it made a very good first impression. + +Now version 1.0 was released. It can be found in [github](https://github.com/gleu/pgstats). + +It is a small tool to get statistics from postgres in intervals, just like with iostat, vmstat and other *stat tools. It has a number of modules to get these, for example for databases, tables, index usage and the like. + +If you are running postgres, you definitely should take a look at it. diff --git a/content/post/115.md b/content/post/115.md new file mode 100644 index 0000000..0a7695c --- /dev/null +++ b/content/post/115.md @@ -0,0 +1,128 @@ ++++ +title = "minimal nginx configuration" +date = "2015-03-25T22:11:20+00:00" +author = "Gibheer" +draft = false ++++ + +As I was asked today, how I manage the nginx setup, I thought I write it down. + +The configuration was inpsired by the [blog entry of Zach Orr](http://blog.zachorr.com/nginx-setup/) +(looks like the blog post is gone since 2014). +The setup consists of one main configuration and multiple domain specific + configuration files which get sourced in the main config. +If a domain is using certificates, these are pulled in in their respective files. + +I will leave out the performance stuff to make the config more readable. As the +location of the config files differs per platform, I will use $CONF_DIR as a +placeholder. + +## main configuration + +The main configuration `$CONF_DIR/nginx.conf` first sets some global stuff. + + # global settings + user www www; + pid /var/run/nginx.pid; + +This will take care of dropping the privileges after the start to the *www* user +group. + +Next is the http section, which sets the defaults for all server parts. + + http { + include mime.types; + default_type application/octet-stream; + charset UTF-8; + + # activate some modules + gzip on; + # set some defaults for modules + ssl_protocols TLSv1.2 TLSv1.1 TLSv1; + + include sites/*.conf; + } + +This part sets some default options for all server sections and helps to make the +separate configuration easier. +In this example the mime types are included (a large file with mime type definitions), +the default charset and mime type is set. + +In this section we can also active modules like gzip ([see gzip on nginx](http://nginx.org/en/docs/http/ngx_http_gzip_module.html)) or set some options for modules like ssl ([see ssl on nginx](http://nginx.org/en/docs/http/ngx_http_ssl_module.html)). + +The last option is to include more config files from the sites directory. This is +the directive which makes it possible to split up the configs. + +## server section config + +The server section config may look different for each purpose. Here are some +smaller config files just to show, what is possible. + +### static website + +For example the file *$CONF_DIR/sites/static.zero-knowledge.org.conf* looks like this: + + server { + listen 80; + server_name static.zero-knowledge.org; + + location / { + root /var/srv/static.zero-knowledge.org/htdocs; + index index.html; + } + } + +In this case a domain is configured delivering static content from the directory +`/var/src/static.zero-knowledge.org/htdocs` on port 80 for the domain *static.zero-knowledge.org`. +If the root path is called in the browser, nginx will look for the *index.html* to show. + +### reverse proxy site + +For a reverse proxy setup, the config *$CONF_DIR/sites/zero-knowledge.org.conf* might look like this. + + server { + listen 80; + server_name zero-knowledge.org; + + location / { + proxy_pass http://unix:/tmp/reverse.sock; + include proxy_params; + } + } + +In this case, nginx will also listen on port 80, but for the host zero-knowledge.org. +All incoming requests will be forwarded to the local unix socket */tmp/reverse.sock*. +You can also define IPs and ports here, but for an easy setup, unix sockets might be +easier. +The parameter `include proxy_params;` includes the config file proxy_params to +set some headers when forwarding the request, for example *Host* or *X-Forwarded-For*. +There should be a number of config files already included with the nginx package, +so best is to tkae a look in $CONF_DIR. + +### uwsgi setup + +As I got my graphite setup running some days ago, I can also provide a very bare +uwsgi config, which actually looks like the reverse proxy config. + + server { + listen 80; + server_name uwsgi.zero-knowledge.org; + + location / { + uwsgi_pass uwsgi://unix:/tmp/uwsgi_graphite.sock; + include uwsgi_params; + } + } + + +So instead of `proxy_pass` `uwsgi_pass` is used to tell nginx, that it has to use +the uwsgi format. Nginx will also include the uwsgi parameters, which is like the +proxy_params file a collection of headers to set. + +## conclusion + +So this is my pretty minimal configuration for nginx. It helped me automate the +configuration, as I just have to drop new config files in the directory and +reload the server. + +I hope you liked it and have fun. diff --git a/content/post/116.md b/content/post/116.md new file mode 100644 index 0000000..a9b7aaa --- /dev/null +++ b/content/post/116.md @@ -0,0 +1,8 @@ ++++ +title = "S.M.A.R.T. values" +date = "2015-07-19T10:05:56+00:00" +author = "Gibheer" +draft = true ++++ + +I wondered for some time, what all S.M.A.R.T. values mean and which of them could tell me, that my disk is failing. Finally I found a [wikipedia article](https://en.wikipedia.org/wiki/S.M.A.R.T.) which has a nice list of what each value means. diff --git a/content/post/117.md b/content/post/117.md new file mode 100644 index 0000000..15c9b87 --- /dev/null +++ b/content/post/117.md @@ -0,0 +1,8 @@ ++++ +title = "S.M.A.R.T. values" +date = "2015-07-19T10:06:19+00:00" +author = "Gibheer" +draft = false ++++ + +I wondered for some time, what all S.M.A.R.T. values mean and which of them could tell me, that my disk is failing. Finally I found a [wikipedia article](https://en.wikipedia.org/wiki/S.M.A.R.T.) which has a nice list of what each value means. diff --git a/content/post/118.md b/content/post/118.md new file mode 100644 index 0000000..e1743dd --- /dev/null +++ b/content/post/118.md @@ -0,0 +1,107 @@ ++++ +title = "ssh certificates part 1" +date = "2015-07-19T10:33:11+00:00" +author = "Gibheer" +draft = false ++++ + +All of my infrastructure SSH access is handled with SSH certificates for more than a year now. As I am asked +every now and then how it works, I will describe how it works in multiple blog posts. + +This part will revolve around Client certificates. + +What is it good for? +-------------------- + +With general public key usage one can identify a user by his public key. These get +put into an `~/authorized_keys` file and if a user presents the correct key, they +are let onto the system. +This approach works well, but it is a bit tricky to find out, which key was actually +used. Restricting the user based on his key on any machine also requires to manage +the authorized_keys with options. + +Now SSH certificates on the client side grant the possibility to sign a public key +and remove the requirement for an authorized keys file. +The options can be set directly in the certificate and are active on every server +this certificate is used with. As the certificate can also hold an identification +string it is easier to see from the logs, which key for what purpose connected. +The only thing to make this work is to set every server to trust the signee and +no authorized keys file has to be managed anymore. + +generating the CA +----------------- + +First we need a SSH key for the purpose of a CA. This should not be the same key +as your normal key in a production environment. +The key is generated any other key with ssh-keygen + + ssh-keygen -t ed25519 -C CA -f ca.key + +You can choose any key type you want, it works with all types and any type can + sign any type. +The `-C` flag adds a comment to the key. + +Now we can sign a public key. + +signing a user key +------------------ + +First we sign a user public key `foouser.pub`. + + ssh-keygen \ + -s ca.key \ + -I 'foouser' \ + -n foouser \ + foouser.pub + +Now what do all these options mean? + +* `-s` defines the signing key +* `-I` is an identification for the certificate. This also shows up in the + auth.log on the server. +* `-n` the principal, which in this case means the username this key will be + allowed to login with. + +To restrict the IP address for the public key, one can use the following line + + -O source-address="127.0.0.1,192.168.42.1" + +Any option from `ssh-keygen(1)` requires its own -O options, for example: + + -O clear -O no-pty -O force-command="/opt/foo/bin/do_stufff" + +A good source for further options is the ssh-keygen man page. + +After the command was executed, a file foouser-cert.pub shows up. The content +can be inspected using ssh-keygen again: + + ssh-keygen -L -f foouser-cert.pub + +To get the authentication working with this key, two steps have to be taken. +First is to put the generated certificated in the same directory like the private +key, so that the ssh agent will sent the certificate. +Second is to put the CA onto the server, so that it will trust all created +certificates. + +This is done with the following option in the sshd_config + + TrustedUserCAKeys /etc/ssh/ssh_user_certs + +where the content of the file _/etc/ssh/ssh_user_certs_ is the ca public key. +It is possible to put multiple CAs into that file. + +Now one can connect to the server using the newly created key + + ssh -vvv -I foouser + +Which should print a line like + + debug1: Server accepts key: pkalg ssh-ed25519-cert-v01@openssh.com blen 364 + debug1: Offering ED25519-CERT public key: /home/foouser/.ssh/id_ed25519 + debug3: sign_and_send_pubkey: ED25519-CERT SHA256:YYv18lDTPtT2g5vLylVQZiXQvknQNskCv1aCNaSZbmg + +These three lines state for my session, that the server accepts certificates and +that my certificate was sent. + +With this, the first step to using SSH certificates is done. In the next post +I will show how to use SSH certificates for the server side. diff --git a/content/post/119.md b/content/post/119.md new file mode 100644 index 0000000..078a0e4 --- /dev/null +++ b/content/post/119.md @@ -0,0 +1,111 @@ ++++ +title = "ssh certificates part 2" +date = "2015-07-28T21:20:49+00:00" +author = "Gibheer" +draft = false ++++ + +This is the second part of the SSH certificate series, server side SSH +certificates. You can find the first one [here](/118). + +This post shows, what use server side certificates can be and how they can be +created. + +What use have server side certificates? +--------------------------------------- + +SSH certificates on the host side are used to extend the ssh host keys. These +can be used to better identify a running system, as multiple names can be +provided in the certificate. This avoids the message of a wrong host key in a +shared IP system, as all IPs and names can be provided. + +SSH certificates can also help to identify freshly deployed systems in that the +system gets certified directly after the deployment by a _build ca_. + +signing a host key +------------------ + +For this step, we need a CA key. How that can be generated was mentioned +in the [first part](/118). +We also need the host public key to sign. This can be either copied from /etc/ssh/ from +the server or it can be fetch using _ssh-keyscan_. + + ssh-keyscan foo.example.org + +It can also take a parameter for a specific type + + ssh-keyscan -t ed25519 foo.example.org + +This is needed for some older versions of openssh, where ed25519 public keys +were not fetched by default with _ssh-keyscan_. + +The output returned looks like the following: + + zero-knowledge.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIP0JSsdP2pjtcYNcmqyPg6nLbMOjDbRf0YR/M2pu2N + +The second and third field need to be put into a file, so that it can be used +to generate the certificate. + +A complete command would then look like this: + + ssh-keyscan foo.example.org | awk '/ssh|ecdsa/ { print $2,$3 }' > host.pub + +With the resulting file, we can now proceed to create the certificate. + + ssh-keygen \ + -s ca.key \ + -V '+52w1d' \ + -I 'foohost' \ + -h \ + -n foo.example.org,bar.example.org \ + host.pub + +The meaning of the options is: + +* `-s` the key to use for signing (the ca) +* `-V` interval the certificate is valid +* `-I` the identity of the certificate (a name for the certificate) +* `-h` flag to create a host certificate +* `-n` all names the host is allowed to use (This list can also contain IPs) + +The last option is the public key file to certify. + +This results in a file host-cert.pub, which contains the certificate. It can be +viewed like the SSH client certificate, with _ssh-keygen_. + + ssh-keygen -L -f host-cert.pub + +This file now has to be placed in the same directory like the public key on that +host, with the same `-cert.pub` ending. + +The last step on the server is to adjust the _sshd_config_, so that it includes +the certificate. For that, add the following line for the fitting host key, for +example: + + HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub + +With a reload, it should load the certificate and make it available for +authentication. + +Now the only thing left to do is to tell the client, that it should trust the +CA to identify systems. For that, the public key of the CA has to be added +to the file `~/.ssh/known_hosts` in the following format + + @cert-authority * + +The _*_ marks a filter, so different CAs can be trusted depending on the domain. + +With this, you are able to connect to your server only using the certificate +provided by the server. When connecting with debugging on, you should get output +like the following: + + $ ssh -v foo.example.com + ... + debug1: Server host key: ssh-ed25519-cert-v01@openssh.com SHA256:+JfUty0G4i3zkWdPiFzbHZS/64S7C+NbOpPAKJwjyUs + debug1: Host 'foo.example.com' is known and matches the ED25519-CERT host certificate. + debug1: Found CA key in /home/foo/.ssh/known_hosts:1 + ... + +With the first part and now the second part done, you can already lock up your +infrastructure pretty fine. In the next part, I will show some stuff I use +to keep my infrastructure easily managable. diff --git a/content/post/12.md b/content/post/12.md new file mode 100644 index 0000000..d3bec26 --- /dev/null +++ b/content/post/12.md @@ -0,0 +1,37 @@ ++++ +title = "das eklige Gesicht XMLs" +date = "2009-08-28T12:23:00+00:00" +author = "Gibheer" +draft = false ++++ + +Eigentlich ist es nicht schwer eine Dokumentation zu schreiben. Es wird +nur dann schwer, wenn verschiedene Ausgabeformate dabei herauskommen +sollen. + +Ich habe keine Ahnung wie das die verschiedenen “Open Source”-Projekte +schaffen, aber für mich war es die riesen Chance mal Docbook +ausprobieren zu können. Netbeans hat mit dem Milestone 1 der +Version 6.8 auch wieder Support dafür, aber ich bin sehr +enttäscht. + +Docbook ist dazu gedacht Bücher, Texte und Artikel zu schreiben, +ohne sich Gedanken um die Formatierung machen zu machen. Allerdings gibt +es so einen riesen Berg an Tags, dass ich schon froh war, dass Netbeans +mir ein Template zur verfügung gestellt hat. + +Es artete aber immer mehr aus, als ich eine +[Liste](http://docbook.org/tdg/en/html/itemizedlist.html) und +später auch noch eine +[Tabelle](http://docbook.org/tdg/en/html/table.html) bauen wollte. + +Es sind dazu so viele Tags von nöten, über die man sich bei +verschiedenen Quellen informieren muss, wie es denn gedacht ist, dass +sie benutzt werden, dass man eigentlich mehr Zeit damit verbringt sich +zu merken, wie die Liste funktioniert, als dass man Doku/Buch/… +schreibt. + +Aus Frust über diesen herben Rückschlag habe ich jetzt einfach +angefangen mir meine eigene XML-Syntax zu bauen und gleich nebenher die +XSLT zu schreiben. Das ist wahrscheinlich einfacher als sich in diesen +Berg von Tags einzuarbeiten. diff --git a/content/post/13.md b/content/post/13.md new file mode 100644 index 0000000..225cd01 --- /dev/null +++ b/content/post/13.md @@ -0,0 +1,29 @@ ++++ +title = "Wie wenig braucht OpenSolaris?" +date = "2009-08-28T12:38:00+00:00" +author = "Gibheer" +draft = false ++++ + +Aus lauter Spass wollten Stormwind und ich mal schauen, ob wir nicht +opensolaris auf einem Sempron 2800+ mit 1GB Ram zu laufen bekommen +können. + +Wir haben die LiveCD gebootet und es hat erstmal eine kleine Ewigkeit +gedauert, bis das System gestartet war. Aber wenn sich ZFS 1GB krallen +will und nur ein GB da ist, ist das auch nicht verwunderlich. Als das +System lief reagierte es eigentlich schnell und ohne Probleme. + +Die Installation sollte auf eine alte 40GB IDE-Platte gehen. Allein das +Kopieren hat um die 50min gebraucht. Als das System dann endlich auf +eigenen Beinen stand war die Performance eigentlich okay, so wie wir es +auch von unserem Quadcore mit 4GB Ram gewohnt waren. + +Der richtige Test fängt aber erst an, wenn wir noch die zweite +SATA-Platte zum laufen gebracht haben. Angeschlossen ist sie schon, aber +sie wird nicht gefunden. + +Wenn das Problem gelöst ist, dann bauen wir mal ein kleines RaidZ und +schauen mal, wie gut sich dann opensolaris schlagen kann. + +Wenn es so weit ist, gibt es hier natürlich wieder einen Nachschlag diff --git a/content/post/14.md b/content/post/14.md new file mode 100644 index 0000000..36652f0 --- /dev/null +++ b/content/post/14.md @@ -0,0 +1,20 @@ ++++ +title = "Rails mit Problemen unter OpenSolaris" +date = "2009-08-31T06:09:00+00:00" +author = "Gibheer" +draft = false ++++ + +Und wieder zeigt sich, dass opensolaris etwas anders tickt als Linux. + +Ich hab gestern mal Ruby on Rails installiert und brauchte für eine +bestimmte Software die Version 2.2.2 In dieser Version hat Activesupport +einen +[Bug](https://rails.lighthouseapp.com/projects/8994/tickets/1396-framework-crashes-on-launch-on-solaris-with-invalid-encoding-asciiignoretranslit-utf-8), +der nur unter opensolaris zu tage tritt. In dem fehlerhaften Teil soll +das Encoding konvertiert werden, allerdings von einem Encoding, welches +unter opensolaris nicht existiert. + +Mit Rails 2.3 soll das Problem allerdings behoben sein. Die Version +2.2.3, die in der Bugmeldung angesprochen wird, gibt es uebrigens (noch) +nicht. diff --git a/content/post/15.md b/content/post/15.md new file mode 100644 index 0000000..e8c16fb --- /dev/null +++ b/content/post/15.md @@ -0,0 +1,32 @@ ++++ +title = "einzelne Pakete unter OpenSolaris updaten" +date = "2009-09-01T21:12:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da will man mal sein System aktualisieren, aber ohne einen reboot +vornehmen zu muessen und dann sowas + +`No updates necessary for this image.` + +Was hatte ich vor? Eigentlich wollte ich aus totaler Bequemlichkeit und +weil ich es nicht anders gewohnt war, ein Update aller Pakete vornehmen, +aber ohne einen reboot vornehmen zu muessen. Da mit `pkg list -u` jede +Menge Pakete ausspuckte dachte ich mir, dass ich mittels eines kleinen +Scriptes vielleicht auch einfach so ein Update hinbekommen koennte. + +Wie sich aber nach einiger Suche herausstellte, hat opensolaris dafuer +eine Sperre im Paket entire eingebaut + +[gibheer-pandora] \~ pfexec pkg install zsh@0.5.11-0.122\ + pkg: The following package(s) violated constraints:\ + Package pkg:/SUNWzsh@0.5.11,5.11-0.122 conflicts with constraint in +installed pkg:/entire: \ + Pkg SUNWzsh: Optional min\_version: 4.3.9,5.11-0.118 max version: +4.3.9,5.11-0.118 defined by: pkg:/entire\ + + +Es ist also nicht moeglich ausserhalb der Version 118 auf eine andere +Version umzusteigen, ausser es wird das gesamte System mittels +image-update mitgezogen. diff --git a/content/post/16.md b/content/post/16.md new file mode 100644 index 0000000..4578f14 --- /dev/null +++ b/content/post/16.md @@ -0,0 +1,21 @@ ++++ +title = "OpenSolaris ohne Reboot updaten" +date = "2009-09-04T23:40:00+00:00" +author = "Gibheer" +draft = false ++++ + +Nach shls Kommentar, dass entire deinstallierbar sei, habe ich mal +geschaut, ob man es dann mit einem Updatescript verbinden kann. + +Dabei herausgekommen ist + +pfexec pkg install \$(pkg list ~~u | awk ‘{ print \$1 }’ | +grep~~v “\^NAME”) + +Das macht eigentlich nichts anderes als haufenweise Newlines zu bauen +und an pkg install zu uebergeben. Erfreulicherweise baut pkg daraus eine +Liste (ohne weiteres zutun) und arbeitet sie einfach nacheinander ab. + +Die Frage ist jetzt nur, ob das System in der Form auch lauffaehig ist. +Aber schauen wir einfach mal. diff --git a/content/post/17.md b/content/post/17.md new file mode 100644 index 0000000..0801491 --- /dev/null +++ b/content/post/17.md @@ -0,0 +1,14 @@ ++++ +title = "OpenSolaris Wiki" +date = "2009-09-07T21:10:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da ich seit einiger Zeit den Link zu einem Solariswiki gesucht habe und +nun endlich wieder gefunden habe, will ich ihn euch nicht vorenthalten +und vor allem will ich ihn nicht wieder vergessen. + +[Hier (www.solarisinternals.com)](http://www.solarisinternals.com/wiki) +findet ihr ein super Wiki mit Anleitungen zu dtrace, Crossbow, +Containern und vielen weiteren Sachen. diff --git a/content/post/18.md b/content/post/18.md new file mode 100644 index 0000000..dee0f0c --- /dev/null +++ b/content/post/18.md @@ -0,0 +1,36 @@ ++++ +title = "OpenVPN unter OpenSolaris" +date = "2009-09-09T19:32:00+00:00" +author = "Gibheer" +draft = false ++++ + +Momentan habe ich den Plan unter opensolaris mir einen ganzen Park an +virtuellen Instanzen mittels +[zones](http:/opensolaris.org/os/community/zones/) und +[Crossbow](http://opensolaris.org/os/project/crossbow/) anzulegen. +Allerdings habe ich nur eine IP fuer die Hauptmaschine, so dass ich die +ganzen anderen Instanzen nicht nach aussen publizieren kann. Da aber nur +ich Interesse an den Instanzen habe, ist es eigentlich auch nicht so +wichtig, ob man die von aussen sehen kann oder nicht. Wichtiger ist mir, +dass ich da ran komme. Also warum nicht einfach ein VPN-Netz aufbauen? + +Das ganze sollte dann so aufgebaut sein, dass fuer jeden Dienst eine +eigene Instanz laeuft und so die einzelnen Dienste an sich abgesichert +sind. Zusaetzlich soll eine Instanz als Router fungieren und ankommende +Anfragen, wenn noetig, an die jeweilige Instanz weiterleiten. Das sollte +zwar nicht noetig sein, aber wenn es mal gebraucht wird, will ich das +vorher bedacht haben :D Um an alle Server heran zu kommen, will ich mich +ueber eine VPN-Verbindung in das virtuelle Netzwerk einklicken. + +Als VPN-Software will ich OpenVPN einsetzen, da ich damit spaeter auch +anderen Personen Zugang zum Netz geben koennte. Fuer Opensolaris gibt es +allerdings keine Pakete, so dass man da selber Hand anlegen muss. Eine +gute +[Anleitung](http://blogs.reucon.com/srt/2008/12/17/installing_openvpn_on_opensolaris_2008_11.html) +hat shl gefunden. Diese bezieht sich zwar noch auf den RC 16, allerdings +funktioniert sie komplett mit dem RC19. Auch der Patch laesst sich +problemlos einspielen und bereitet keine Probleme beim kompilieren. + +Jetzt muss das VPN nur noch konfiguriert werden - eigentlich der +schlimmste Teil daran. Ich melde mich wieder, sobald das geht. diff --git a/content/post/19.md b/content/post/19.md new file mode 100644 index 0000000..7eb1289 --- /dev/null +++ b/content/post/19.md @@ -0,0 +1,121 @@ ++++ +title = "Heidelbeertigerarmstulpen" +date = "2009-09-11T10:18:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr lieben +================ + +meine erste Armstulpe ist jetzt fertig und ich wurde auch gleich gebeten +aufzuschreiben, wie ich die gemacht habe. + +![](/images/heidelbeertigerarmstulpe3.jpg) + +Das mache ich natürlich gerne. :) + +Anleitung +========= + +Ich habe meine Armstulpen aus +[Heidelbeertigerdrachenwolle](http://drachenwolle.de/sockenwolle-handgefaerbt/sockentiger/sockentiger-8.php) +gemacht, aber Ihr seid natürlich frei jede Wolle zu nehmen, die Euch +gefällt. + +Dazu hab ich Nadeln mit einer Stärke von 2,5 mm genommen und eine +Maschenprobe von x Maschen a x Reihen haben in etwa 12x12 cm ergeben, +damit Ihr eine Ahnung davon habt, wie groß das ganze wird. + +Das Bündchen +============ + +Der gerdrehte Teil +------------------ + +Ich habe mir für jede meiner 4 Nadeln im Nadelspiel 16 Maschen +ausgerechnet. Macht 64 insgesamt. + +Die sollen aber nicht gleich auf das Nadelspiel. Damit das Ende bzw. +jetzt ja der Anfang (ich hab beim Oberarm angefangen und mich dann in +Richtung hand vorgestrickt) so lustig gedreht wird brauchen wir erst +einmal als Grundlage 5 Reihen Kraus gestrickt auf normalen Nadeln. + +Dann kommt noch eine, die recht gestrickt wird, aber diesmal drehen wir +nach jeder 4. Masche die rechte Nadel um 360° nach oben hinweg einmal um +sich selbst. + +Der Teil mit den Rippen +----------------------- + +Danach Stricken wir nochmal zwei Reihen im Rippchenmuster - also immer +zwei rechte und zwei linke Maschen abwechselnd. + +Jetzt können wir das ganze auf das Nadelspiel übernehmen. Also weiter +das Muster stricken und auf jede Nadel 16 Maschen übernehmen. + +Beim Maschenschluss kann der Faden am Anfang etwas lose aussehen, aber +nach ein paar Reihen gibt sich das. + +Macht hier insgesamt: 2 Reihen noch auf der langen Nadel, 1 um das ganze +auf das Nadelspiel zu übertragen und 22 weitere, damit wir ein schönes +Bündchen haben(, aber ihr könnt natürlich auch mehr oder weniger machen, +je nachdem, wie es euch so gefällt. + +Das Mittelteil +============== + +Ich kucke durch die Röhre +------------------------- + +Danach habe ca. 90 Reihen glatt rechts gestrickt. Aber das kann bei euch +natürlich leicht variieren, je nachdem, wie lang eure unterarme sind. +Deswegen rate ich euch das Teil ab und zu anzuprobieren. + +25% der Maschen müssen gehen +---------------------------- + +Weil der Arm in der Nähe meiner Handgelenke natürlich schmaler ist, als +meine Oberarme und ich trotzdem wollte, dass die Stulpen schön eng +anliegen, habe ich mich entschieden, für das Bündchen am Ende ein paar +Maschen loszuwerden. + +4xxx3xxx2xxx1xxx \<== jedes Zeichen stellt eine Masche dar, so, wie man +sie auch auf der Stricknadel sieht. + +Ich habe dann in der ersten Reihe, die Masche Nr. 4 mit der davor +“vereinigt” und das auf jeder Nadel. + +Danach habe ich 2 Reihen normal gestrickt und darauf die Masche Nr. 3 +mit der davor verkürzt. Und so weiter, bis ich nur noch 12 statt der 16 +Maschen hatte. + +Das Ende +======== + +Teil 1 +------ + +Ganz einfach 2 rechts, 2 links, und das x Reihen, oder solange, bis ihr +meint, dass es genug ist. + +Sieht schön aus, ist aber total anstrengend +------------------------------------------- + +… deswegen habe ich mir eine dünnere Stricknadel und eine kleine +Häckelnadel zu hilfe genommen. Hinter einer normal gestrickten Masche +werden nun 2 neue aufgenommen. Da der Platz dabei ziemlich eng werden +kann, habe ich den Faden mit der dünnen Stricknadel aufgenommen und mit +der Häkelnadel verstrickt. + +So haben wir am Ende 3mal so viele Maschen auf den Nadeln, wie vorher. +Und dadurch wird später mal der schöne Rüschenbund enstehen. + +Hui, im Kreis +------------- + +Nachdem das so schwierig war, wird es jetzt wieder leichter. noch ca. 13 +Reihen stricken und dann abketten. :)\ +Die Fäden noch schön vernähen und fertig sollte die Armstulpe sein. + +… fehlt nur noch die zweite ;) diff --git a/content/post/2.md b/content/post/2.md new file mode 100644 index 0000000..d9f89fb --- /dev/null +++ b/content/post/2.md @@ -0,0 +1,33 @@ ++++ +title = "Indizes statt Tabellen" +date = "2009-05-05T21:04:00+00:00" +author = "Gibheer" +draft = false ++++ + +Datenbanken sind dazu bestimmt Datenmengen zu verwalten, ändern, +löschen und einfügen. Um zumindest das einfügen und +aktualisieren zu vereinfachen gibt es Indizies. + +Oracle hat mich heute jedoch sehr verblüfft. In einer Tabelle, auf +der sehr viel mit like gearbeitet wird, wurden die Abfragen immer +langsamer und die vorhanden Indizies konnten aufgrund des Likes nicht +verwendet werden. Als jedoch aber jemand einen Index über alle 4 +Spalten gelegt hatte, wurde dieser Index allen anderen Indizes +vorgezogen. Aber nicht nur, dass es den Index zum suchen verwendete, +sondern es benutzte den Index als Tabelle. Alle Daten, die angezeigt +werden sollten, wurden, laut Explain, direkt aus dem Index gezogen. + +Nach einer Suche in den Oracledokumenten konnte dieses Verhalten erstmal +nicht erklärt werden. Auf vielen Seiten wurde auch geschrieben, +dass like nicht index-fähig sei. + +Jetzt stellt sich natürlich die Frage, warum so etwas nicht auch +auf einer normalen Tabelle funktioniert, denn eigentlich sollten +schnelle Interaktionen, also Select, Update, Insert und Delete das Ziel +einer Datenbank sein. Warum muss man dazu bei Oracle hier eine kopie der +Tabelle anlegen lassen, um genau dieses Ziel zu erreichen? + +Was ich noch nicht ausprobieren konnte, ob dieser Index den Planner so +weit beeinflusst, dass auch Funktionsaufrufe direkt darauf gelenkt +werden. Ich werd mal schauen, ob ich das eingehender testen kann. diff --git a/content/post/20.md b/content/post/20.md new file mode 100644 index 0000000..25c7834 --- /dev/null +++ b/content/post/20.md @@ -0,0 +1,83 @@ ++++ +title = "Lustige Gehversuche mit Gentoo/FreeBSD" +date = "2009-09-11T11:11:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr, +========== + +Ich habe mir etwas ganz verrücktes in den Kopf gesetzt, aufgrund der +Tatsache, dass mein Notebook eine neue Festplatte braucht (die alte ist +mir irgendwie zu klein geworden…). + +Da ich mein Betriebssystem auf jeden Fall nochmal neu aufstetzen will, +um ungeliebte Experimentieraltlasten loszuwerden, kann ich mit dem +Experimentieren auch gleich wieder anfangen. + +Also habe ich mir überlegt, was mein neues Betriebssystem alles können +soll und habe mir überlegt, dass es ja lustig wäre als Dateisystem ZFS +zu benutzen. + +Da wäre die einfachste Lösung ja OpenSolaris zu benutzen. Jedoch bin ich +leider total vernarrt in langdauerende Kompiliervorgänge, was mich auf +die Spur von BSD gelenkt hat. + +Und irgendeine FreeBSD-Version soll mittlerweile sogar von ZFS richtig +booten können, so dass ich auch mit meinem Notebook, in dem ich ja nur +eine Festplatte habe, die Vorteile von ZFS richtig nutzen könnte. + +Auf der anderen Seite hab ich auch mein Gentoo richtig lieb gewonnen, +und wollte es eigentlich nicht loswerden. + +Deswegen habe ich mich dafür entschieden eine wirre Kombination aus +allen Dreien zu versuchen. + +Dabei soll mir vor allen Dingen das hier helfen: [Gentoo/FreeBSD +Anleitung (englisch)](http://www.gentoo.org/doc/en/gentoo-freebsd.xml) + +Wie in der Anleitung beschrieben, habe ich dann auch Versucht die +FreeSBIE CD (2.0.1) mit meinem Notebook zu starten, über das externe +CD-ROM Laufwerk, da mein Laptop kein eingebautes hat. + +Leider stellte sich herraus, dass diese CD auf mit unerfindlichen +Gründen inkompatibel mit meinem Laufwerk ist. (Wir haben beides getrennt +voneinander getestet und sie funktionieren wunderbar.) + +Nach mehreren Versuchen mit anderen FreeBSD LiveCDs bin ich bei +[HeX](http://www.rawpacket.org/projects/hex/hex-livecd) stehen geblieben +und der Erkenntnis, dass ich wohl meine tolle Idee mit dem ZFS noch ein +wenig aufschieben muss, da ich unterwegs gelesen habe, dass FreeBSD ZFS +zwar ab der Version 7.0 unterstützt, doch erst ab der Version 7.2 davon +booten kann. + +Das Problem daran ist nun, dass Gentoo/FreeBSD noch bei der Version 7.1 +ist… + +Also habe ich meine Versuche mit ZFS erst einmal zur Seite gelegt, und +mich daran gemacht das eigentliche Gentoo zu installieren. + +Das Installieren der stage 3 Version funktionierte bei mir ohne +Probleme. Allerdings, konnte ich meine Pakete nicht auf den neusten +Stand bringen, weil ein paar der Updates nicht gelingen wollten. + +Weiterhin kann ich leider von meinem Gentoo aus keine Netzwerkverbindung +aufbauen, weil es kein Init-Script für die Netzwerkverbindung gibt. Ich +nehme einfach mal an, dass er das Modul für die Netzwerkkarte in der +Standartkonfiguration des Kernels nicht mitbaut, oder nicht geladen hat. + +Vorläufiges Ergebnis: +===================== + +Alles in Allem ist mein Versuch aber bisher geglückt, und mit ein +bisschen Schubsen kann das Gentoo/FreeBSD auch booten und ich habe eine +Konsole mit der ich theoretisch arbeiten könnte. + +Ich dürft also gespannt sein, ob ich das System soweit hinbekomme, dass +ich Produktiv damit arbeiten kann. Ich habe auf jeden Fall bisher +gelernt, dass ich noch viel über FreeBSD lernen muss, mit dem ich bisher +noch fast gar nichts zu tun hatte, da es sich eben in den Punkten, die +für mich interessant sind, doch sehr von Linux unterscheidet. + +**Diese Serie wird Fortgesetzt…** diff --git a/content/post/21.md b/content/post/21.md new file mode 100644 index 0000000..98155ea --- /dev/null +++ b/content/post/21.md @@ -0,0 +1,36 @@ ++++ +title = "Crossbow mit Solaris Containern" +date = "2009-09-15T06:30:00+00:00" +author = "Gibheer" +draft = false ++++ + +Vor ein paar Tagen hatte ich OpenVPN installiert um mir ein virtuelles +LAN auf zu bauen. Dabei bin ich auf Probleme gestoßen, die nicht ganz +einfach zu lösen waren. + +In etlichen Anleitungen zu zones wird einfach das Hauptinterface des +Rechners benutzt, in anderen Beispiel wird eine virtuelle LAN-Karte +(vnic) erstellt. Ich hatte beides wahrscheinlich in unterschiedlichen +Konfigurationen ausprobiert und es hat nie geklappt. Allerdings weiß ich +jetzt auch warum. Auf den richtigen Pfad bin ich über +[cuddletech](http://www.cuddletech.com/blog/pivot/entry.php?id=1001) und +[BigAdmin](http://www.sun.com/bigadmin/features/articles/crossbow_net_virt.jsp) +gekommen. + +Es gibt für zones zwei Arten von Netzwerkzugriffen, “shared” und +“exclusive”. “shared” Bedeutet in diesem Fall, dass ein Interface +genommen wird, meistens ein echtes Netzwerkinterface, und sich die zone +mit anderen zones oder dem Host dieses Interface teilt. So könnte man +zum Beispiel eine zone bauen, die auch das Hauptinterface direkt +benutzen darf, wie das Host-System. + +Das bedeutet aber, dass nun nicht mehr klar erkennbar ist, wem dieses +Interface eigentlich gehört. Die IPs müssen deswegen schon vor dem Boot +vergeben werden, damit von Anfang an klar ist, wer welchen Traffic +verursacht und bekommen muss. + +Bei “exclusive” ist es dagegen so, dass ein Interface nur von einer zone +oder vom Host benutzt werden darf und kann. Dadurch ist es möglich den +Trafficflow besser zu kontrollieren, gerade wenn man ein größeres +virtuelles Netzwerk nachstellt. diff --git a/content/post/22.md b/content/post/22.md new file mode 100644 index 0000000..e7f00ef --- /dev/null +++ b/content/post/22.md @@ -0,0 +1,51 @@ ++++ +title = "Gibheers zsh-config" +date = "2009-09-19T20:47:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da jemand nach teilen meiner zsh-config gefragt hatte, stelle ich sie +hier einfach mal komplett vor bzw. zum [download](//downloads/zshrc.txt) +bereit. + +Mit “bild hoch” und runter kann man einen Befehl anhand der Eingabe +wieder raussuchen, mit pos1 und ende in der Zeile an den Anfang oder das +Ende springen. Auch backspace funktioniert, wie man es erwartet :D + +Wenn ihr Teile daraus gebrauchen koennt, dann viel Spass damit. (config +ist im weiteren Anhang des Eintrages) + +\ +source \~/.profile + +autoload ~~Uz compinit\ +autoload colors ; colors\ +autoload zmv +\ +compinit +\ +HISTFILE=\~/.histfile\ +HISTSIZE=2000\ +SAVEHIST=2000\ +setopt appendhistory nomatch\ +unsetopt autocd beep extendedglob notify +\ +alias su=‘su ~~’\ +alias ls=’ls~~G’\ +alias nano=‘nano ~~w’\ +alias log=’hg log~~l 3’\ +alias status=‘hg status’\ +alias dir\_to\_lower="zmv~~Qv ‘(\*\*/)(\*)(.D)’ ‘\$1\${(L)2}’" + +PS1=“\$(print ‘{\\e[1;31m%} \~ {\\e[0m%}’)”\ +RPS1=“\$(print ‘{\\e[0m%}’)” + +bindkey -v ‘^[[3~’\\\\ delete-char\ +bindkey\\\\ -v\\\\ ’\^[[4~’\\ end-of-line\ +bindkey\\ ~~v\\ ’^[OF’\\\\ end-of-line\ +bindkey\\\\ -v\\\\ ’^[[1~’\\\\ beginning-of-line\ +bindkey\\\\ -v\\\\ ’^[OH’\\\\\\ beginning-of-line\ +bindkey\\\\\\ -v\\\\\\ ’^[[5~’\\ history-beginning-search-backward\ +bindkey~~v\\ ’^[[6\~’ history-beginning-search-forward\ + diff --git a/content/post/23.md b/content/post/23.md new file mode 100644 index 0000000..0a2be54 --- /dev/null +++ b/content/post/23.md @@ -0,0 +1,52 @@ ++++ +title = "von Linux zu OpenSolaris" +date = "2009-11-09T07:51:00+00:00" +author = "Gibheer" +draft = false ++++ + +Gestern hat es mich gepackt und ich habe mein Hauptbetriebsysstem +gewechselt - von Archlinux zu opensolaris. + +Es ist erstmal installiert, meine Daten sind drauf und Browser +funktioniert, allerdings gibt es noch ein paar Stolpersteine, die +erstmal aus dem Weg geräumt werden müssen. + +Da ich ein Betriebssystem haben wollte, welches zfs kann und FreeBSD +leider noch etwas auf sich warten lässt, habe ich gestern gedacht, dass +ich einfach auf opensolaris umsteigen könnte. + +Also habe ich zum letzten mal unter Archlinux mein Backup laufen lassen, +die Platte ausgetauscht und die neue große eingebaut. + +Dann habe ich Opensolaris installiert, ein Update auf svn\_126 gemacht +und schon startete es nicht mehr (segfault oder so). Ich vermute mal, +dass es daran liegt, dass einzelne Komponenten aus svn\_126 installiert +wurden, als der Core an sich noch auf dem Stand von 2009.6 war. Also hab +ich das System noch mal neu installiert, dann komplett auf svn\_126 +gebracht und dann ging es. + +Als ich dann mein Backup auf das neue System geholt habe, durfte ich +dann erstmal feststellen, dass ich mit den inkrementellen Backups jedes +mal mein Hauptbackup überschrieben hatte. + +Ich hatte also ein nutzloses Backup, eine Festplatte mit ext3 (nicht +lesbar von OSOL) und einen Laptop mit opensolaris und zfs drauf (nicht +lesbar von Linux). Wie soll man in so einer Situation wieder an seine +Daten kommen?\ +Ganz einfach: man stecke seine Platte in einen anderen Rechner und boote +davon (danke Archlinux fuer so einen tollen Kernel :D). Nach ein paar +weiteren Schwierigkeiten mit Links und recursiven Backups **seufz** war +dann heute morgen endlich alles übertragen. + +Allerdings fehlen mir ein paar Sachen, zum Beispiel ein Musikplayer. +Rythmbox ist zwar installiert, schaltet sich aber nach wenigen Sekunden +einfach wieder ab. Meinen xmms2 konnte ich noch nicht installieren, da +mir die glib2 noch fehlt. Aber das werde ich heute noch alles nachholen. +Firefox ist drauf und hat alles so weit gut übernommen, Claws Mail fehlt +mir auch noch. Den werde ich wahrscheinlich selber kompilieren. + +Da ansonsten alles weitere ueber den Paketmanager verfuegbar ist +(PostgreSQL, lighttpd, php, ruby, …) sollte der weitere Umstieg +eigentlich keine Probleme bereiten. Aber ich bin gespannt, ob ich mit +OSOL auf die Dauer zurecht komme :D diff --git a/content/post/24.md b/content/post/24.md new file mode 100644 index 0000000..6c22e10 --- /dev/null +++ b/content/post/24.md @@ -0,0 +1,61 @@ ++++ +title = "Performance, Programme und viel Musik" +date = "2009-11-12T12:41:00+00:00" +author = "Gibheer" +draft = false ++++ + +Nach dem ich am Wochenende von Archlinux zu opensolaris umgestiegen bin, +ist einiges passiert. + +Beim Umstieg war ich mir dessen bewusst, dass vielleicht ein paar +Programme nicht laufen werden bzw. nicht im Paketmanager verfügbar sind. +So zum Beispiel XMMS2 und claws-mail. + +XMMS2 habe ich mittlerweile zum laufen gebracht. Davor jedoch, war es +ein großes hin und her. + +Nach dem ich in meinem neuen opensolaris angekommen war, hatte ich mein +Backup zurück gespielt mit einer Geschwindigkeit um die 10MB/s. + +Als erstes wollte ich den XMMS2 zum laufen bekommen. Beim lesen der +Dokumentation auf der [XMMS2-Seite](http://xmms2.xmms.se), sollte es nur +mittels libao möglich sein, Soundoutput hin zu bekommen. Die aktuelle +libao Version ist aber schon mehr als 2 Jahre alt und in dieser Zeit +wurde der Soundoutput vom Sun-Sound-System auf OSS4 umgestellt, so dass +diese Variante nicht mehr funktionierte. + +Da der XMMS2 kein OSS als Plugin mit gebaut hatte, ging ich davon aus, +dass da noch irgendwas anders sein muss. + +Nach ein bisschen Recherche sollte die Soundschnittstelle OSS sehr +ähnlich sein. Net- und OpenBSD haben wohl das Sun-System übernommen und +eine ähnliche, aber um einige Funktionen erweiterte Schnittstelle +entwickelt. + +Nach dem ich keinen weiteren Hinweis finden konnte und auch nicht libao +dazu bewegen konnte, doch endlich mal was zu tun, hatte ich wieder +Archlinux installiert. + +Da wollte ich wieder mein Backup rüberziehen, doch statt der 10MB/s wie +bei opensolaris, hatte ich nur noch 200kb/s und haufenweise +Übertragungsfehler. + +Also kurzerhand wieder Opensolaris installiert und noch mal die +Geschwindigkeit geprüft: wieder 10MB/s. + +Heute wollte ich mich dann mal bei machen und die \*BSD-spezifischen +Stellen aus dem Code löschen, als mir auffiel, dass das OSS-Plugin eine +soundcard.h benötigt. + +Nach einer Suche mit pkg search -r soundcard.h fand +ich das Paket “SUNWaudh”, welches die gesamten soundheader beinhaltet. + +Diese also schnell installiert und siehe da: XMMS2 funktioniert über OSS +auf opensolaris! + +Jetzt kann ich zumindest damit arbeiten, denn ohne Musik geht einfach +nichts. Zum Glück weiss ich, dass sich PostgreSQL, Ruby, PHP und lighty +leichter installieren lassen. + +Aber mal sehen was mich als nächstes erwartet. diff --git a/content/post/25.md b/content/post/25.md new file mode 100644 index 0000000..f9d08ad --- /dev/null +++ b/content/post/25.md @@ -0,0 +1,70 @@ ++++ +title = "Lustige Gehversuche mit ..." +date = "2009-11-15T13:39:00+00:00" +author = "Stormwind" +draft = false ++++ + +tja,\ +irgendwie hat das mit dem Gentoo/FreeBSD doch nicht sooo ganz geklappt, wie ich mir das vorgestellt hatte. + +Denn ich bin lediglich auf einer lustigen Debug-Konsole gelandet, anstatt im richtigen System. Da war mein Test wohl zu kurz gewesen, um diesen Unterschied zu bemerken und ich war zu froh gewesen überhaupt etwas zu gesicht bekommen, was nach Konsole aussah. + +Auf jeden Fall wollte keiner meiner Versuche so richtig klappen und ich bekam das System nicht gestartet. (Leider kann ich mich nicht mehr genau daran erinnern, was ich alles ausprobiert hatte.) +================================================================================================================================================================================================================================================================== + +Nun also erst mal wieder zurück zu einem Linux? +=============================================== + +Nun ja, ich hab mich dafür entschieden. Aber mit einem ext3 oder ganz +neu ext4 war mir nach meinem Ausflug dann wohl doch zu langweilig. So +habe ich mich für die neuste und wohl auch gefählichste Alternative +entschieden: [btrfs](http://btrfs.wiki.kernel.org/index.php/Main_Page) + +Wobei man deutlich sagen muss, dass es da noch ein paar kleine +Problemchen hat. Ich hab mein System schön über Subvolumes verteilt, und +es gibt im Moment leider keine möglichkeit nachträglich noch einmal die +Größe der erstellten Subvolumes zu überprüfen, geschweige denn ihren +“Füllgrad”. + +Man bekommt immer eine Ausgabe aller Volumes zusammen und die +Gesamtmenge der abgelegten Daten. + +Auch habe ich mehrfach gelesen, dass man wohl im Moment die Subvolumes +noch nicht löschen kann, was natürlich auch noch unschön ist. + +Davon einmal abgesehen muss ich sagen, dass mir bisher keine Daten +verloren gegangen sind. ;) + +Auch kann man im im Moment noch nicht von den Subvolumes booten. Ich +habe zwar [eine Anleitung (Hier eine Übersetzung der Seite aus dem Cache +von Google, leider ist das Original wohl nicht +verfügbar.)](http://translate.googleusercontent.com/translate_c?hl=de&sl=ru&tl=de&u=http://209.85.129.132/search%3Fq%3Dcache:Pk6NSIKm9RMJ:razum.b-master.su/2009/09/22/btrfs-puskaet-korni-na-korne&rurl=translate.google.de&usg=ALkJrhiKK1rzzHRPjvjrxA89yjVhw3nw7g) +(in russisch!<>! die ich dank Google, wenigstens zum Teil entziffern +konnte) gefunden, in der das gehen soll. Jedoch habe ich nach etwa 30 +Versuchen doch aufgeben müssen, weil alle Variationen, die mir +eingefallen sind, um das Teil zu booten, fehlgeschlagen sind. (Dabei +habe ich /boot immer noch auf einer eigenen ext2 Partition liegen und +nur das Hauptverzeichnis des Betriebssystems in einem Subvolume gehabt.) +Angeblich soll da etwas möglich sein, wenn man grub mit dem USE-Flag +netboot kompiliert, aber auch da hat bei mir nichts funktioniert. + +Ich denke, das wird sich in Zukunft auch irgendwann machen lassen. + +Interessant ist noch anzumerken, dass man die Subvolumes wie Ordner +behandeln kann, (mehr oder minder). Wenn man die Hauptpartition +einhängt, kann man mit einem ls die Subvolumes wie Verzeichnisse +betrachten. Dasselbe soll wohl auch mit den Snapshots geschehen, aber +ich bin bisher nicht dazu gekommen, welche zu machen. + +Nun sollte ich nur noch dran denken öfter Backups zu machen und vorher +nachzuschauen, wenn ein neuer Kernel kommt, ob die neue btrfs-Version +auch mit der alten kompatibel ist ;) + +**Im Übrigen werden auch noch weitere lustige Gehversuche folgen,**\ +denn ich hab ein Auge auf das Projekt +[ZFS-Fuse](http://rudd-o.com/new-projects/zfs) +([Repo](http://gitorious.org/zfs-fuse)) geworfen, mit dem ich ein wenig +herumspielen möchte, sobald ich alle meine Daten auf der alten +Festplatte gesichtet habe, und sicher bin, dass ich sie nicht mehr +benötige. diff --git a/content/post/26.md b/content/post/26.md new file mode 100644 index 0000000..1c25ab8 --- /dev/null +++ b/content/post/26.md @@ -0,0 +1,31 @@ ++++ +title = "mit PHP Mailadressen validieren" +date = "2009-11-18T09:35:00+00:00" +author = "Stormwind" +draft = false ++++ + +… gibt es seit der Version 5.2.0 auch in einfach. +================================================= + +Okay, das hätte ich vielleicht früher merken können. Aber besser spät +als nie, und ich muss mich vorläuftig nicht mehr mit (zu mindestens mir) +unverständlichen regexp-Ausdrücken rumplagen. + +filter\_var(“lustige@e-mail.adresse”, +FILTER\_VALIDATE\_EMAIL); + +Gibt dabei im Erfolgsfall die Adresse als String zurück und im +Fehlerfall schlicht *false*. + +Nachtzulesen natürlich auch auf +[php.net](http://de3.php.net/manual/en/function.filter-var.php). + +Interessant sind auch die ganzen anderen schönen Sachen, wie z.B URLs +testen oder auch ganze Arrays mit +[filter\_var\_array](http://de3.php.net/manual/en/function.filter-var-array.php) + +Aber das tollste an der ganzen Geschichte ist, dass endlich auch unsere +geliebten Adressen mit dem + drin valide sind. :D + +**Bis denne** diff --git a/content/post/27.md b/content/post/27.md new file mode 100644 index 0000000..a2f6463 --- /dev/null +++ b/content/post/27.md @@ -0,0 +1,13 @@ ++++ +title = "PostgreSQL 8.4 in OpenSolaris" +date = "2009-11-18T22:08:00+00:00" +author = "Gibheer" +draft = false ++++ + +Mit der neuen Versioon von opensolaris (snv\_127) hat sich auch die neue +Version von PostgreSQL 8.4.1 in das Repository geschlichen. Endlich ist +es drin :D Es gilt nur zu beachten, dass psql nicht mehr in +/usr/postgresql//bin drin ist, sondern direkt in /usr/bin/. Ist +aber nicht schlimm, da psql zu alten Versionen der Datenbank kompatibel +ist. diff --git a/content/post/28.md b/content/post/28.md new file mode 100644 index 0000000..6675fa3 --- /dev/null +++ b/content/post/28.md @@ -0,0 +1,52 @@ ++++ +title = "publisher contains only packages from other publisher" +date = "2009-11-18T07:14:00+00:00" +author = "Gibheer" +draft = false ++++ + +Nach dem Update von opensolaris auf snv\_127, bekam ich immer wieder +Meldungen, dass mein publisher dev nur Pakete des publishers +opensolaris.org enthaelt. + +Die gesamte Meldung sieht wie folgt aus + +\ +Refreshing catalog 1/1 devpkg publisher + +The catalog retrieved for publisher ‘dev’ only contains package data for +these publisher(s): opensolaris.org. To resolve this issue, update this +publisher to use the correct repository origin, or add one of the listed +publishers using this publisher’s repository origin. + +To correct the repository origin, execute the following command as a +privileged user: + +pkg set-publisher ~~O dev +\ +To add a new publisher using this publisher’s repository origin, execute +the following command as a privileged user: +\ +pkg set-publisher~~O http://pkg.opensolaris.org/dev/ + +After the new publisher has been added, this one should be removed by +executing the following command as a privileged user: + +pkg unset-publisher dev\ + + +Der Meldung nach zu Urteilen, sollte es also reichen, wenn ich meinen +dev-publisher neu anlege, doch weit gefehlt. Es handelt sich dabei um +eine Aenderung am Paketsystem ([Erklaerung +hier](http://blogs.sun.com/srw/entry/do_you_want_to_go)) welche die +Struktur des Paketespeichers zusammenlegt und damit den alten +opensolaris-Stand ueberfluessig macht. + +Das haette man vielleicht mal in die Meldung dazu schreiben koennen. +Denn Aufgrund dieser Aenderung konnte ich nicht einmal mehr Pakete +installieren, weil mein default-publisher dev war und keine Updates mehr +bekam. + +Die Loesung des Problems bestand dann darin, einen der beiden publisher +zu loeschen. Ich hab dev geloescht und opensolaris.org auf dev +umgeleitet. diff --git a/content/post/29.md b/content/post/29.md new file mode 100644 index 0000000..9d5fdb0 --- /dev/null +++ b/content/post/29.md @@ -0,0 +1,73 @@ ++++ +title = "Claws Mail laeuft auf OpenSolaris" +date = "2009-11-19T21:02:00+00:00" +author = "Gibheer" +draft = false ++++ + +Es ist vollbracht, Claws Mail läuft endlich auf opensolaris! + +Jemand aus unserem Channel (\#zero-knowledge auf irc.quakenet.org) +konnte mir dabei helfen die fehlenden Puzzlestücke zusammen zu suchen +und Claws Mail davon zu überzeugen , endlich durch zu kompilieren. + +Aber hier nun die gesamte Anleitung, um Claws Mail mit Bogofilter (gegen +den ganzen Spam) zu installieren. + +Zu aller erst brauchen wir den Source folgender Programme: + +- für den bogofilter: db von + [Oracle](http://www.oracle.com/technology/software/products/berkeley-db/index.html) + und [bogofilter](http://bogofilter.sourceforge.net/) selber +- für gpg-support: + [gnupg](http://www.gnupg.org/download/index.en.html) und + [gpgme](http://www.gnupg.org/download/index.en.html#gpgme) +- und [claws mail](http://www.claws-mail.org) + +Die Sources werden in jeweils ein eigenes Verzeichniss entpackt. Das +kompilieren ist bei bogofilter und den gnupg-Paketen gleich, einzig db +und claws-mail brauchen da eine Sonderbehandlung. + +Ich werde hier alles mit dem Prefix /usr kompilieren, damit die +executables nach /usr/bin kommen. Eigentlich macht man das nicht, ich +bin allerdings faul ;) + +Zuerst kompilieren wir db, weil dieses von bogofilter benötigt wird. +Dazu gehen wir in das db-Verzeichniss und dort nach `build_unix`. + +Dort rufen wir dann folgenden Befehl auf: sh +../dist/configure —prefix=/usr && make && make install auf. + +Das war es schon mal fuer db. Danach wechseln wir in das +bogofilter-verzeichniss und fuehren + +
+./configure —prefix=/usr && make && make install
+
+
+aus. Das selbe wiederholen wir auch für gnupg und gpgme. + +Jetzt, da die Grundlagen geschaffen sind, geht es an claws. + +Zuerst wechseln wir in das claws-mail-verzeichniss und führen folgenden +Befehl aus + +\ +CC=“gcc ~~std=gnu99~~DSTDC ~~lsocket~~lnsl” ./configure —prefix=/usr +—disable-libetpan —disable-ldap —disable-dbus\ + + +Das Statement ~~std=gnu99 wird dazu gebraucht, damit claws mail +überhaupt über die erste Datei hinaus kompiliert, da in einem header +eine Abfrage enthalten ist, die einen Abbruch erzwingt, wenn der +compiler nicht den c99-Standard einhält. Das DSTDC wird benötigt, damit +die socket.h die Methoden recv, send, … richtig definiert und damit +keine Linkingfehler auftreten und zuletzt brauchen wir noch~~lsocket, +damit überhaupt versucht wird, die socket.h richtig einzubinden, da das +configure-script das nicht von alleine erkennt. + +Danach noch ein make && make install und schon haben wir ein fertiges +claws-mail. + +Die Anleitung von db stammt von der +[bogofilter-FAQ](http://bogofilter.sourceforge.net/faq.shtml#port-notes) diff --git a/content/post/3.md b/content/post/3.md new file mode 100644 index 0000000..a6f7e6d --- /dev/null +++ b/content/post/3.md @@ -0,0 +1,27 @@ ++++ +title = "Serendipity als Blog?" +date = "2009-05-14T12:25:00+00:00" +author = "Gibheer" +draft = false ++++ + +ZeroTolerance hat [gefragt (Kommentar von +ZeroTolerance)](http://zero-knowledge.org/index.php?/archives/1-zero-knowledge-ohne-Forum.html#c4), +warum wir denn Serendipity als Blogsoftware einsetzen. + +Eigentlich wollten wir Wordpress einsetzen, aber die haben keinen +PostgreSQL-Support. Es gibt zwar noch einen Fork, aber der ist auf einem +uralten Stand, der weit hinter der aktuellen Entwicklung +hinterherhinkt. + +Serendipity wird bei Entwicklern relativ oft eingesetzt und unterstützt +auch PostgreSQL. + +Bei Serendipity kann man das Design sehr frei anpassen, dank Smarty als +Templatesystem. Es gibt eine Vielzahl an Optionen um den Blog so +einzurichten, dass er funktioniert. Als Grafiklibrary kann gd oder +imagemagic verwendet werden. + +Es erfüllt auf jeden Fall seinen Zweck und ist sehr leicht +bedienbar. Wir können es sehr empfehlen, auch wenn man mit MySQL +arbeitet. diff --git a/content/post/30.md b/content/post/30.md new file mode 100644 index 0000000..55feb2d --- /dev/null +++ b/content/post/30.md @@ -0,0 +1,23 @@ ++++ +title = "neuer CLI-Client fuer XMMS2" +date = "2010-01-12T09:02:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich konnte den neuen CLI-Client schon unter Archlinux testen und fand +diesen eigentlich richtig gut. Unter opensolaris wurde dieser allerdings +nicht mit kompiliert, weil eine Abhängigkeit zu readline und ncurses +nicht aufgelöst werden konnte. + +Gestern haben mye und ich das Problem lösen können. Um den Client +kompilieren zu können, wird readline und ncurses gebraucht. Beide Pakete +kann man über pkg (SUNWgnu-readline und SUNWncurses) ohne weiteres +installieren und readline wird dann auch gefunden. Die libncurses.so +liegt allerdings nicht unter `/usr/lib` sondern in `/usr/gnu/lib`. +Dieses Verzeichnis befindet sich allerdings nicht im Suchpfad, so dass +das Kompilat nicht arbeiten kann. + +Ich habe nun `/usr/gnu/lib` als Umgebungsvariable `LD_LIBRARY_PATH` in +meine \~/.profile gepackt und konnte ohne Probleme den neuen Client +kompilieren und auch nutzen. diff --git a/content/post/31.md b/content/post/31.md new file mode 100644 index 0000000..812f7d5 --- /dev/null +++ b/content/post/31.md @@ -0,0 +1,17 @@ ++++ +title = "gefaehrliches Spiel fuer das n900" +date = "2010-02-24T06:55:00+00:00" +author = "Gibheer" +draft = false ++++ + +Es gibt für das n900 das Spiel n900fly, zu finden in der Spielesektion +von extras-testing. Dieses misst mit Hilfe der Sensoren, wie hoch man +das n900 geworfen hat. Zuerst hab ich an einen Trick gedacht und hab es +einfach mal in der hand behalten, weil der Beschleunigungssensor +trotzdem ansprechen sollte. + +Allerdings ist das wirklich so programmiert, dass man loslassen muss. +Bei 1,30m hab ich dann aufgehöhrt und das Spiel wieder entfernt, weil +ich genau weiss, dass wenn ich viel viel langeweile habe, ich das +wirklich weiter ausprobieren würde. diff --git a/content/post/32.md b/content/post/32.md new file mode 100644 index 0000000..9893c61 --- /dev/null +++ b/content/post/32.md @@ -0,0 +1,18 @@ ++++ +title = "Blog nicht da" +date = "2010-03-24T16:54:00+00:00" +author = "Gibheer" +draft = false ++++ + +So, nun ist der Blog erstmal wieder verfuegbar. Was ist passiert? Der +Host unseres vServers wollte nicht mehr und hat langsam aber stetig +aufgegeben. Daraufhin wurde der Server auf einen anderen Host umgezogen +und da wir immer brav updates gemacht haben, war udev nicht mehr mit dem +Kernel kompatibel. + +Also sind wir auf die Suche nach was neuem gegangen und nach viel hin +und her, haben wir ein Backup gemacht, den Server neu aufgesetzt und +arbeiten momentan daran, alles auf einen Root umzuziehen. Wenn es so +weit ist, gibt es hier natuerlich noch mal kurz eine Nachricht (wenn es +nicht ganz kurzfristig und ganz heimlich passiert) diff --git a/content/post/33.md b/content/post/33.md new file mode 100644 index 0000000..0ad03f2 --- /dev/null +++ b/content/post/33.md @@ -0,0 +1,71 @@ ++++ +title = "OpenSolaris Zones mit statischer IP" +date = "2010-03-24T18:11:00+00:00" +author = "Gibheer" +draft = false ++++ + +Nachdem ich lange danach suchen musste, wie man einer OpenSolaris Zone +zwei statische IPs geben kann, schreibe ich das jetzt mal hier mal +nieder, damit es auch andere finden. + +Die Ausgangslage bei mir war, dass ich ein Interface in ein virtuelles +LAN und ein Interface auf das externe Interface hatte. + +\> dladm show-link\ +LINK CLASS MTU STATE OVER\ +intern1 etherstub 9000 unknown —\ +vm\_intern1 vnic 9000 up intern1\ +vm\_extern1 vnic 1500 up rge0\ + + +Das Interface `vm_intern1` sollte die IP 192.168.1.100 bekommen und das +externe Interface `vm_extern1` die IP 192.168.2.100. + +In der VM ist der Service `physical:default` per default gestartet, so +dass die Konfiguration recht schnell über die Bühne gehen kann. Als +erstes müssen Dateien für die Interfaces angelegt werden, die beim Start +beachtet werden sollen. In unserem Fall sind dies +`/etc/hostname.vm_intern1` und `touch /etc/hostname.vm_extern1`. + +Als erste Zeile muss die IP des Interfaces eingefuegt werden und in der +zweiten dann die Angaben für die Netzmaske und Broadcast. + +\> echo “192.168.1.100” \>\> +/etc/hostname.vm\_intern1
\> echo “netmask 255.255.255.0 broadcast ++ up” \>\> /etc/hostname.vm\_intern1 + +das selbe Spiel machen wir auch mit dem zweiten Interface + +\> echo “192.168.2.100” \>\> +/etc/hostname.vm\_intern2
\> echo “netmask 255.255.255.0 broadcast ++ up” \>\> /etc/hostname.vm\_intern2 + +Die Angabe `broadcast +` bedeutet in dem Fall, dass die Broadcastadresse +nur den 0-Anteil der Subnetmask mit 1 auffüllen soll. So stand es +zumindest auf einer Seite. Als ich das + weggelassen habe, habe ich als +Broadcast die 192.168.255.255 erhalten, also scheint das nicht ganz hin +zu kommen, aber zumindest funktioniert es mit + richtig. + +Wenn wir jetzt neustarten würden, würden auch die beiden Interfaces +richtig geladen werden und mit der eingestellten IP versehen. Was noch +fehlt ist die Angabe der Nameserver und der Defaultroute. + +Die Defaultroute setzt man ganz einfach mit + +\> echo “192.168.2.1” \>\> /etc/defaultrouter + +Was nun noch bleibt ist der DNS-Server. Dafür muss die Datei +/etc/nsswitch.dns nach /etc/nsswitch.conf kopiert werden. + +\> cp /etc/nsswitch.dns /etc/nsswitch.conf + +Danach muessen noch die DNS-Server in die `/etc/resolv.conf` eingetragen +werden und dann der DNS-Client gestartet werden. Das geht mit + +\> svcadm enable -r dns/client + +Nach einem Neustart sollten die Interfaces mit den richtigen IPs +ausgestattet sein, bei `netstat -r` die Routen stimmen und ein +`ping google.de` eine Antwort bringen (wenn euer Container denn das +Internet erreichen kann) diff --git a/content/post/34.md b/content/post/34.md new file mode 100644 index 0000000..6257256 --- /dev/null +++ b/content/post/34.md @@ -0,0 +1,24 @@ ++++ +title = "Blub gibt es ab sofort auch fuer unterwegs" +date = "2010-04-05T12:05:00+00:00" +author = "Stormwind" +draft = false ++++ + +… weil gestern ja gerade Ostern war, habe ich mir etwas ganz besonderes +als Geschenk für meinen Freund ausgedacht. Ein Zero-Knowledge T-Shirt +mit einem riesengroßen Kuschelblub auf dem Rücken. + +Damit ich mir die ganze Arbeit aber nicht nur für ein T-Shirt gemacht +habe, haben wir alles bei Spreadshirt schön eingerichtet. So dass jeder, +der ein wenig Kleingeld übrig hat, sich ein schönes T-Shirt mit Blub +zulegen kann. + +…und weil ich mich irgendwie nicht bremsen konnte, gibt es nicht nur +Blub-T-Shirts und Sweatshirts, sondern auch Regenschirme, Kochschürzen … +und gar eine Kuscheldecke. + +Das alles gibt es nun unter +[http://zero-knowledge.spreadshirt.de](http://zero-knowledge.spreadshirt.de/). + +Also macht euch schon auf und lasst Blub die Welt erobern!<>! diff --git a/content/post/35.md b/content/post/35.md new file mode 100644 index 0000000..361644b --- /dev/null +++ b/content/post/35.md @@ -0,0 +1,46 @@ ++++ +title = "Umzug mit OpenSolaris 20x0.xx" +date = "2010-04-13T18:38:00+00:00" +author = "Gibheer" +draft = false ++++ + +Eigentlich wollten wir so schnell wie möglich alles umgezogen haben, +aber irgendwie zieht es sich alles in die Länge und es kommt ein Fehler +nach dem anderen. + +Ich warte schon seit einer ganzen Weile auf das neue OpenSolaris Release +2010.03 (mittlerweile auch 04). Zum einen wollte ich dann den Server +upgraden auf die nächsten stabile Version und zum anderen war ich +gespannt, was als nächstes nach snv\_134 eingebaut werden wird. Nun +wurde Sun endgültig aufgekauft und seit mehr als einem Monat warte ich +auf ein neues Release. Zwar kann ich verstehen, dass da viel intern +passiert, aber warum gibt es keine Meldung darüber, dass das Release um +1, 2 oder 3 Monate verschoben wird, bis man sich etwas sortiert hat und +die ganzen Grafiken in OpenSolaris angepasst hat?\ +Denn inzwischen ist aus meiner Neugierde Not geworden und ich brauche +das Update. Durch den Ausfall des vServers und den dadurch angestoßenen +Umzug sitze ich nun da mit meinem OpenSolaris, auf dem ich kein Exim +kompilieren kann, da mir gdbm fehlt, welches in snv\_116, also 5 +Versionen nach 2009.06 rein kam. Ich wette, dass wenn ich es selber +kompilieren würde, genau dann das neue Release erscheinen würde. + +Meine Überlegung ging nun erstmal dahin, den ganzen komplex Mailserver +in eine VM zu packen, aber das funktioniert auch nicht. Aus +unerfindlichen und noch zu ergründen Gründen, kann ich mit 2009.06 im +Moment nicht auf das SUN-Extra Repository zugreifen (ja, die Keys hab +ich schon, will aber trotzdem nicht) um VirtualBox zu installieren. + +Jetzt habe ich Frust, weil ich den Umzug nicht weiter machen kann,mich +jede Verzögerung Geld kostet und ich nicht weiß, wann sich an diesem +Zustand etwas ändern wird. Wenn es gar nicht anders geht, muss ich eben +auf Container, Crossbow und ZFS verzichten, aber eigentlich war das +nicht Sinn der Uebung, da OpenSolaris rauf zu packen. Eine Installation +von snv\_134 aus dem dev-Zweig kommt auch nicht in Frage, weil mein +Laptop damit nicht ohne Anpassung der menu.lst startet. Und ich will +keinen Server, der dann in einer Reboot-Schleife festhängt. + +Ich hoffe für OpenSolaris, dass bald das Release rauskommt und ich den +Wechsel endlich fertig machen kann. Denn sonst bleibt mir nichts anderes +übrig, als auf ein OS zu wechseln, bei dem ich wenigstens ab und zu mal +eine Meldung bekomme, wie der Stand ist. diff --git a/content/post/36.md b/content/post/36.md new file mode 100644 index 0000000..278be39 --- /dev/null +++ b/content/post/36.md @@ -0,0 +1,65 @@ ++++ +title = "MySQL kann Datensaetze \"zerreissen\"" +date = "2010-04-16T15:12:00+00:00" +author = "Stormwind" +draft = false ++++ + +Dass MySQL eine - nun sagen wir - seltsame Datenbank ist, dürfte ja +hinreichend bekannt sein. + +Aber mir ist etwas untergekommen, was selbst ich nicht für möglich +gehalten hätte. + +Man stelle sich also eine Tabelle vor in der eine Spalte mehrere gleiche +Werte behinhalten kann und eine weitere das Datum dazu. Ich wollte also +auf diese gleichen Werte gruppieren und dabei aber den Datensatz mit dem +höchsten Datum erhalten. + +Das alles könnte ich nun mit +[OVER](http://en.wikipedia.org/wiki/Select_%28SQL%29#Window_function) +machen… was MySQL aber nicht beherrscht. + +Also musste ich mir etwas anderes einfallen lassen. + +MySQL lässt es unvernünfitger Weise zu, dass wenn man ein GROUP BY +benutzt, man trotzdem alle möglichen Spalten auswählen kann. Und ich +dachte ich mache mir das zu Nutze indem ich einfach bei den Ausgaben ein +`MAX(datum)` einfüge. Nach den Gesetzen der Logik müsste es ja dann den +Datensatz ausspucken, der das höchste Datum hat. + +Also nehmen bei Beispielsweise eine Tabelle mit 3 Spalten: + +\ +create table testmax(projekt varchar(10), important\_value integer, +datum integer);\ +insert into testmax values (‘projekt1’, 1, 1000), (‘projekt1’, 2, 1001), +(‘projekt1’, 3, 1010), (‘projekt2’, 1, 1000), (‘projekt2’, 2, 1111);\ + + +Und Probieren folgenden select aus: + +select projekt, important\_value, max(datum) from testmax +group by projekt; + +Und nun passiert was, was meiner Meinung nacht gar nicht gehen dürfte. +Die Datenbank zerreißt die Datensätze und fügt sie für diesen Select neu +zusammen. + +So bekomme ich gar nicht den erwünschten Wert von “important\_value” +sondern den erstbesten, den die MySQL-Datenbank zu greifen bekommt, +obwohl ich gleichzeitig das aktuellste Datum angezeigt bekomme. + +**Ergebnis:** + + projekt important\_value max(datum) + ---------- ------------------ ------------ + projekt1 1 1010 + projekt2 1 1111 + +Von daher bleibt es wohl dann doch eher Bug als Feature, dass man bei +MySQL nach SELECT alle Spalten trotz GROUP BY angeben kann…\ +Das bedeutete für mich, dass ich leider den Riesenumweg über ein +Subselect machen musste, was das ganze erheblich verlangsamt hat. + +**Bis denne** diff --git a/content/post/37.md b/content/post/37.md new file mode 100644 index 0000000..3585837 --- /dev/null +++ b/content/post/37.md @@ -0,0 +1,16 @@ ++++ +title = "Serverumzug vollendet" +date = "2010-05-10T19:35:00+00:00" +author = "Gibheer" +draft = false ++++ + +Hallo vom neuen Server! + +Wir haben es endlich geschafft und haben alles auf den neuen Server +umgezogen. Allerdings nicht wie geplant auf OpenSolaris, sondern nun mit +FreeBSD. Die Installation mit ZFS hat recht gut funktioniert, auch wenn +es einige Anläufe gebraucht hat, bis es lief. Als nächstes kommen dann +die Jails. Dort wollen wir ein versuchen ein ähnliches Setup wie mit den +Solaris Container hin zu bekommen. Mal sehen in wie weit das klappen +wird. diff --git a/content/post/38.md b/content/post/38.md new file mode 100644 index 0000000..795daea --- /dev/null +++ b/content/post/38.md @@ -0,0 +1,45 @@ ++++ +title = "Schwarze Seelen brauchen bunte Socken - Teil 2" +date = "2010-06-02T13:52:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr Lieben, +================= + +!(float\_left)/images/wolle2.jpg! letztes Wochenende war es mal wieder +soweit. In [Leipzig war Wollefest](http://www.leipziger-wolle-fest.de). +Diesmal schon das dritte. Und es gab wie immer richtig viel zu sehen. +Vor allen Dingen Wolle, aber auch anderes, wie z.B. quietschgrüne +Gießkannenohringe, die mich so sehr angeschrieen haben, bis ich sie +einstecken musste. Ich konnte gar nicht anders. + +Auch viele bunde Wollstränge wollten eingepackt werden. + +Und da das sooo sehr anstrengend war, musste ich mich dann an einen der +zahlreichen (und trotzdem viel zu wenigen) Tischen hocken und ganz viel +an meinen Socken stricken. + +Sogar das Wetter hat super mitgespielt und wir hatten den ganzen Samstag +lang Supersonne. Wobei ich fest davon überzeugt bin, dass das ganz +alleine meine Schuld ist. !(float\_right)/images/wolle1.jpg!\ +Schließlich habe ich am Vortag noch meinen Regenschirm fit gemacht, der +leider kaputt war. Nun ja, als Strafe hatte ich dann Abends einen +Sonnenbrand :). + +**Bis denne** + +PS: Nächstes Wochenende geht es weiter. Da ist bei uns in der “Nähe” in +[Nierstein auch ein +Wollefest](http://www.handspinngruppe-schwabsburg.de/). Ich habe mich +dort sogar zu einem Workshop angemeldet und versuche Spinnen zu lernen. +Da ich unbedingt Färbungen ausprobieren möchte bei denen man die Wolle +zuerst Färbt und dann verspinnt. + +Mal schauen wie es wird. + +Ich hoffe es macht mir Spaß und ich kann mir einer dieser absolut +[superschönen +Handspindeln](http://www.anettes-wollwerkstatt.de/html/spinnrader_und_zubehor.html) +zulegen. \*dahinschmacht\* diff --git a/content/post/39.md b/content/post/39.md new file mode 100644 index 0000000..9c100f0 --- /dev/null +++ b/content/post/39.md @@ -0,0 +1,55 @@ ++++ +title = "PostgreSQL - mehrere Werte aus einer Funktion" +date = "2010-06-04T07:59:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich wurde gestern gefragt, wie man PL/PGSQL aus einer Funktion mehrere +Werte zurueckgeben kann. Da der Funktionsaufruf danach in PHP weiter +verarbeitet werden sollte, fielen Arrays schon mal raus. + +Meine zweite Idee war, einfach eine dynamische Tabelle zurueck zu geben. + +\ +create or replace function blork(mult int) returns setof integer as +\$\$\ +begin\ + return next mult \* 3;\ + return next mult \* 2;\ + return next mult \* 1;\ + return;\ +end;\ +\$\$ LANGUAGE ‘plpgsql’;\ + + +Das wichtige ist, dass man SETOF benutzt und dort den Datentyp +definiert, welcher zurueckgegeben werden soll. Das kann integer sein, +String, aber auch ein row-set aus einer bestehenden Tabelle. + +Man kann diese Tabelle dann mit Select blork(3); +selektieren und bekommt dann auch die drei Werte zurueck. + +test=\# select blork(1);\ + blork\ +——-\ + 3\ + 2\ + 1\ +(3 rows)\ + + +Die Funktion laesst sich dann auch ganz normal in JOINs und sonstiges +einbauen, zum Beispiel + +\ +select \* from (\ + select fun from blork(3) as fun\ +) as sub\_fun right join (\ + select gen from generate\_series(1, 15) as gen\ +) as subgen on fun = gen;\ + + +Zu dem Return Next gibt es auch eine Abteilung im offiziellen [Handbuch +(PostgreSQL: Documentation: Manuals: Post greSQL 8.4: Control +Structures)](http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING). diff --git a/content/post/4.md b/content/post/4.md new file mode 100644 index 0000000..ac3620c --- /dev/null +++ b/content/post/4.md @@ -0,0 +1,29 @@ ++++ +title = "Zero-knowledge spielt wieder Icewars" +date = "2009-05-21T12:42:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr lieben, +================= + +mein erste Blogeintrag hier und schon habe ich ein freudiges Ereignis zu +verkünden. + +Nicht ganz nach zwei Wochen in der neuen Runde habe ich gemerkt, dass +ich einfach nicht dazu geeignet bin, nach System zu spielen. + +Also hab ich mich mit ein paar anderen zusammengetan und wir haben +wieder zero-knowledge gegründet, mit dem wahrscheinlich lustigsten +Allitag diese runde [o.0]. + +![IceWars Banner](http://stormwinds-page.de/banner/icewars-logo.jpg "IceWars Banner") + +Wenn ihr lustig seid, könnt Ihr ja mal reinschauen. Wir spielen Solo mit +allen Freiheiten, die man sich so denken kann. Zu finden sind wir im +[GameSurge](http://gamesurge.net) und im +[QuakeNet](http://www.quakenet.org) jeweils im Channel \#zero-knowledge. + +PS: Wenn Ihr nicht wisst, um was es hier geht. Schaut einfach mal rein: +[Icewars anschauen](http://icewars.de) diff --git a/content/post/40.md b/content/post/40.md new file mode 100644 index 0000000..6e23f8b --- /dev/null +++ b/content/post/40.md @@ -0,0 +1,52 @@ ++++ +title = "Das Wollefest in Nierstein" +date = "2010-06-06T19:55:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr +========= + +ja, wie ich euch ja schon geschrieben hatte, war ich gestern auf dem +[Wollefest in Nierstein](http://www.handspinngruppe-schwabsburg.de/) und +habe dem Spinnkurs für Anfänger beigewohnt. + +Wir haben dort als erstes das Spinnen mit einer Handspindel geübt. Aber +ich muss wohl sagen, dass man zwar aus einem Stück Holz und CD Rohlingen +eine Spindel bauen kann, doch sie ist nichts im Vergleich zu der +[wundervollen +Kreuzspindel](http://www.anettes-wollwerkstatt.de/html/spinnrader_und_zubehor.html#Spindeln), +die ich mir nach dem Workshop gekauft habe. Bei der CD-Spindel musste +ich mich um jede Drehung bemühen, wohingegen meine Kreuzspindel einfach +läuft, wenn ich sie einmal anstoße. + +!(float\_left)/images/wolle3.jpg(meine Kreuzspindel mit ein bischen +selbstgesponnener Wolle)! Danach haben wir das Spinnen mit dem Spinnrad +gezeigt bekommen und ausprobiert. Ich muss gestehen, dass ich mich am +Anfang ganz schön doof angestellt habe und dass ich erst nach 10 oder 15 +Versuchen einen Faden hinbekommen habe, der länger als einen Meter war. +Und dann ging es auf einmal Rund, ein perfekter Traumfaden ist zwar bei +keinem der Versuche rausgekommen, aber mit Übung sollte das auch gehen. + +Eine Dame auf dem Fest, mit der wir später gesprochen haben, meinte, +dass es nach dem ersten Kilo versponnene Wolle besser werden würde… +naja, jetzt brauche ich unbedingt ganz viel Wolle. + +Hier nochmal ein Dank an Nathalie und ihre Mutter, die beide den +Workshop betreut haben. Das hat echt Spaß gemacht und ich denke ich +werde auch in Zukunft noch ganz viel zumspinnen. :)\ +!(float\_right)/images/wolle4.jpg(4 Knaeule bunte Wolle vom +Wolldrachen)!\ +Desweiteren muss ich erzählen, dass der +[Wolldrache](http://drachenwolle.de/) auch hier mit ihrem Stand zu +finden war. Und das gemeinerweise direkt am Anfang des Festplatzes. +Natürlich bin ich nicht dran vorbeigekommen, sondern musste unbedingt +wieder etwas einpacken. + +Die blaugrüne Wolle im Vordergrund ist im Übrigen superzartes Merino. +Daraus werden dann Armstuplen für kühle Sommernächte, in denen man +trotzdem nicht ins Haus gehen möchte. + +**In dem Sinne einen schönen aber nicht ganz zu knalleheißen Sommer\ +Stormwind** diff --git a/content/post/41.md b/content/post/41.md new file mode 100644 index 0000000..7010c35 --- /dev/null +++ b/content/post/41.md @@ -0,0 +1,40 @@ ++++ +title = "NetBeans 6.9 released" +date = "2010-06-17T07:47:00+00:00" +author = "Gibheer" +draft = false ++++ + +Gestern ist plötzlich [NetBeans 6.9(NetBeans IDE 6.9 Release +Information)](http://netbeans.org/community/releases/69/) +([download(Download NetBeans +6.9)](http://netbeans.org/downloads/index.html)) herausgegeben worden, +wo doch nur eine Woche davor der rc2 erschienen ist. Es gab wieder +einige Verbesserungen, wobei mir am meisten aufgefallen ist, dass +Netbeans im Vergleich zu 6.8 deutlich schneller geworden ist. + +Gerade was die Code-Completition angeht hat die 6.8 immer lange +gebraucht um die Vorschläge zu sammeln. + +Die für mich interessantesten neuen Features ist die Verbesserung +bei der Zusammenarbeit von HTML und CSS und der Smarty-Support. In CSS +gibt es nun die Möglichkeit auf die IDs, welche in Smarty-Templates +oder HTML verwendet wurden zurückzugreifen und es funktioniert auch +recht gut. + +Der Smartysupport beschränkt sich zwar nur auf das +Syntaxhighlighting, aber zumindest werden nicht mehr grosse Teile meines +HTML-Codes als Fehler dargestellt. + +Was ich noch nicht testen konnte ist, in wie weit sich die Performance +in Ruby verbessert hat. Auch dort soll viel an der Performance gedreht +worden sein. Auch Rails3-Support soll schon enthalten sein. Da Rails3 +die Möglichkeit bietet fast alle Module durch andere zu ersetzen +(statt ActiveRecord DataMapper) wollte ich dieses Feature ausprobieren, +allerdings liess sich die Gem-Verwaltung von Netbeans nicht dazu +überreden Rails3-Beta4 zu installieren. Mal sehen wie das in ein +paar Monaten aussieht, wenn Rails3 dann endlich fertig ist. + +Eine nette Neuerung die ich sehr gut finde ist, dass die Ordnerstruktur +nun nach dem Schliessen Netbeans’ erhalten bleibt. Sowas hab ich schon +lange gebraucht. diff --git a/content/post/42.md b/content/post/42.md new file mode 100644 index 0000000..c79ef36 --- /dev/null +++ b/content/post/42.md @@ -0,0 +1,12 @@ ++++ +title = "Kalender auf der Konsole" +date = "2010-06-19T20:47:00+00:00" +author = "Gibheer" +draft = false ++++ + +FreeBSD hat mir heute als kleinen Tip etwas nettes mitgeteilt, was ich +so noch nicht kannte, aber immer wieder mal gebraucht hätte. Und +zwar kann man mit dem Befehl `cal` sich den Kalender des Monats auf der +Konsole ausgeben lassen. Mit `cal -y` bekommt man sogar die +Übersicht über das gesamte Jahr. diff --git a/content/post/43.md b/content/post/43.md new file mode 100644 index 0000000..7b3e981 --- /dev/null +++ b/content/post/43.md @@ -0,0 +1,22 @@ ++++ +title = "Der Drackenzackenschal" +date = "2010-06-24T12:36:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr Lieben +================ + +!(float\_left)/images/foto1-klein.png! + +da ist sie endlich. Die Anleitung für meinen Drachenzackenschal. Da so +viele diesen Schal bewundert haben. Habe ich mich nun aufgerafft und +eine hoffentlich verständliche Anleitung dazu geschrieben. + +=\> [Anleitung +herunterladen](http://stormwinds-page.de/anleitungen/drachenzackenschal.pdf) +\<= + +**Noch viel Spaß beim Stricken\ +Stormwind** diff --git a/content/post/44.md b/content/post/44.md new file mode 100644 index 0000000..12eb3bc --- /dev/null +++ b/content/post/44.md @@ -0,0 +1,45 @@ ++++ +title = "zero-knowledge jetzt auch per IPv6" +date = "2010-07-05T19:43:00+00:00" +author = "Gibheer" +draft = false ++++ + +Nach dem Hetzner klammheimlich am 16.06. IPv6 eingeführt hat, habe ich +den [UN\*X SUMMER](https://wiki.uugrn.org/UN*X_SUMMER_2010) dazu genutzt +das einfach mal auf dem Server einzurichten. Allerdings ging das nicht +so einfach, wie ich gedacht habe. + +In einer Mail habe ich die Daten erhalten, mit denen ich eine Verbindung +zum Rest der IPv6-Welt herstellen können sollte. Darin war mein +Netz (2a01:4f8:101:5362::/64) und eine IP des Gateways mit dem Prefix +59, welche nicht Bestandteil meines Netzes war. Zudem stand darin, dass +ich die **::1 nicht benutzen soll, sondern meine erste IP die**::2 +wäre. Also habe ich einfach mal alles eingetragen, wollte meine +Route setzen, doch bekam ein “No Route to Host”. Ist ja auch logisch, +was nicht im Netz ist, kann nicht angesprochen werden. + +Also haben wir (shl, rabe und ich) uns mal im [Wiki von +Hetzner](http://wiki.hetzner.de/index.php/Zusaetzliche_IP-Adressen#Zusatz-IPv6) +umgeschaut und da steht, man solle den gesamten Taffic auf das Interface +routen. Da uns das erstmal komisch vorkam, haben wir erstmal eine IP aus +dem Gateway-Netz genommen (sind ja genug da), funktionierte zumindest +schon mal das routing. Danach haben wir die IP wieder und entfernt und +zu unserem erstaunen funktionierte das routing immer noch. Mit dem +Programm ndp haben wir dann mal geschaut, welche IPs denn schon bekannt +sind (ndp -a) und haben unter anderem die IP des Gateways inklusive MAC +gefunden. Meine Vermutung war, dass FreeBSD nicht einfach blind auf ein +Interface routen will, wen es gar nicht weiss, an welche MAC-Adresse es +die Pakete adressieren soll. + +Heute Mittag habe ich dann mal ausprobiert, was passier, wenn ich statt +einem prefix 64 einen prefix 59 für meine erste IP verwende und +siehe da, es ging auf Anhieb ohne seltsame Konstrukte. Ich habe auch +eine Mail an Hetzner mit der Problematik geschrieben, allerdings bis +jetzt noch keine Antwort erhalten. Mal sehen ob morgen noch was kommt. + +Und nun noch das wichtigste: wer kann, bekommt +[http://zero-knowledge.org](http://zero-knowledge.org) auch schon +über IPv6 ausgeliefert (sollte 2a01:4f8:101:5362::2 sein). Alle +weiteren Domains stell ich noch um, damit auch alles andere per IPv6 +erreichbar ist. diff --git a/content/post/45.md b/content/post/45.md new file mode 100644 index 0000000..014f883 --- /dev/null +++ b/content/post/45.md @@ -0,0 +1,43 @@ ++++ +title = "Linux und Windows im Auto" +date = "2010-07-29T13:25:00+00:00" +author = "Gibheer" +draft = false ++++ + +Das folgende bitte nicht all zu ernst nehmen. + +Im Moment geht die Entwicklung bei Autos immer mehr in die Richtung, +dass es eine vollausstattung in Sachen Internet und Entertainment gibt. +Dazu kommen noch “Heads up Displays” zur Anzeige direkt in der +Frontscheibe. + +Vor kurzem tickerte dann auch mal die Nachricht durch, dass einige +Autohersteller schon Windows([Windows Mobile fuer +Autos](http://www.microsoft.com/windowsembedded/en-us/products/windows-embedded-automotive/default.mspx)) +gekauft haben oder mit Microsoft darüber in Verhandlungen stehen +würden. + +Auf einer Fahrt kam Stormwind und mir dann der Gedanke, was könnte denn +passieren, wenn sich diese Entwicklungen so fortsetzen. Was ist, wenn +ich gerade mit 160km/h auf der Autobahn unterwegs bin und auf meiner +Frontscheibe öffnet sich gerade ein Popup, weil ich gerade von einem +Virus befallen wurde. Zuerst würde man wahrscheinlich nicht mehr viel +sehen, da dieses Popup im weg wäre. Im besten Fall wäre es noch flash, +damit auch noch das ganze System des Wagens ausgelastet ist und nur noch +sehr verzögert auf Eingaben (Bremse? Lenken?) reagiert. + +Danach sind uns diese tollen Mails und Anzeigen von Amazon eingefallen, +die immer diese tollen Hinweise bietet, was man noch so kaufen könnte. +So eine Meldung müsste sich dann am unteren Bildschirmrand zeigen: “99% +der Leute, die durch ein Flashwerbebanner beim Autofahren nichts gesehen +haben, brauchten danach eine Urne. Wollen sie jetzt auch eine Urne +auswählen?” + +Auch wenn das nicht zutreffen wird, ist diese Entwicklung doch sehr +interessant. Microsoft verliert immer mehr Anteile am PC-Markt und +steigt nun bei Autos ein. Für Linux gibt es wohl auch schon erste +Interessenten ([Meego](http://meego.com/devices/in-vehicle)). Das +betrifft zwar nur das Multimediasystem, aber ich freue mich schon auf +den Tag, wenn ich den Autoverkäufer fragen kann, ob ich das Auto auch +mit Linux bekommen kann. diff --git a/content/post/46.md b/content/post/46.md new file mode 100644 index 0000000..bebe5a4 --- /dev/null +++ b/content/post/46.md @@ -0,0 +1,11 @@ ++++ +title = "Nachfolger von Tex" +date = "2010-08-16T22:29:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da wir es heute beim Stammtisch kurz davon hatten, hier noch der [Link +(http://river-valley.tv)](http://river-valley.tv/an-earthshaking-announcement/) +zum Vortrag über die Nachfolge von Tex, namentlich iTex, von Don +Knuth, einem der ursprünglichen Entwickler. diff --git a/content/post/47.md b/content/post/47.md new file mode 100644 index 0000000..97a1895 --- /dev/null +++ b/content/post/47.md @@ -0,0 +1,17 @@ ++++ +title = "[Rubyconf 2009] Worst Ideas Ever" +date = "2010-09-15T19:50:00+00:00" +author = "Gibheer" +draft = false ++++ + +Heute morgen habe ich einen +[Link](http://confreaks.net/videos/198-rubyconf2009-worst-ideas-ever) +(englisch) “worst ideas ever” gesehen, welcher auf einen Beitrag der +letzten Rubyconf verweisst. In diesem Vortrag geht es um Projekte, die +zwar hervorragend implementiert sind, aber die Idee auf einem hohen +Level irgendwie doof ist. Das diese Projekte trotzdem hilfreich sind, um +seine Fähigkeiten zu verbessern oder um Fehler zu finden stellen +die beiden Redner, Aaron Patterson und Ryan Davis, dabei nicht in Frage, +im Gegenteil - sie machen es auf eine humoristische Art und Weise selber +vor. diff --git a/content/post/48.md b/content/post/48.md new file mode 100644 index 0000000..918ee5a --- /dev/null +++ b/content/post/48.md @@ -0,0 +1,24 @@ ++++ +title = "zero-knowledge mit IPv6 Teil 2" +date = "2010-09-15T20:09:00+00:00" +author = "Gibheer" +draft = false ++++ + +Vor einiger Zeit hatte ich schon darüber berichtet, dass wir bei +Hetzner ein IPv6 Subnet bekommen haben. Das funktioniert auch schon +recht gut, ABER es gibt kein DNS für IPv6. Ich +hatte unsere Domain darin eingetragen und ein Freund hat uns darauf +hingewiesen, dass bei einem DNS-Request keine Informationen für +IPv6 kommen. + +Auf Nachfrage bekam ich nur die Antwort, dass das noch geplant sei. + +Da jetzt auch jemand hier im Blog nachgefragt hat, was Hetzner +geantwortet hat, auf die Frage, wie man das mit dem Gateway am besten +Regeln sollte, kam auch nur eine solche Antwort. Es ist wohl geplant, +dass auf eine \*::1 zu setzen, aber wann das kommt, konnte man mir nicht +sagen. + +Hetzner hat also IPv6, weiss damit aber anscheind noch nicht so richtig +was anzufangen. diff --git a/content/post/49.md b/content/post/49.md new file mode 100644 index 0000000..1444ac8 --- /dev/null +++ b/content/post/49.md @@ -0,0 +1,19 @@ ++++ +title = "Shellbefehle im Vim ausfuehren" +date = "2010-09-23T13:55:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich muss immer wieder Shellbefehle ausführen, wofür ich eigentlich den +Vim beenden müsste oder ein zweites Terminal bräuchte, obwohl das +Ergebniss nur kurz gebraucht wird. Eben habe ich mal nachgeschaut, ob +das nicht auch irgendwie anders geht und es geht tatsächlich. + +Auf der Seite [Vim tips: Working with external +commands](http://www.linux.com/archive/feed/57727) von linux.com wird +beschrieben, dass man mit `:sh` oder `:shell` eine Shell öffnen kann und +mit exit wieder im Vim landet. Alternativ dazu gibt es noch +`:! %`. Das % steht für die aktuelle Datei. Die Ausgabe wird in +Vim geschrieben und mit Enter kommt man danach wieder zu seinem Code +zurück. diff --git a/content/post/5.md b/content/post/5.md new file mode 100644 index 0000000..ed682e0 --- /dev/null +++ b/content/post/5.md @@ -0,0 +1,36 @@ ++++ +title = "Schwarze Seelen brauchen bunte Socken" +date = "2009-06-01T21:21:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo Ihr lieben, +================= + +ihr wisst ja bestimmt alle, dass in diesen Tagen das WGT in Leipzig +statt findet. Aber was wohl die wenigsten wissen ist, dass am 30. und am +31. auch noch das 2. [Leipziger +Wollefest](http://www.leipziger-wolle-fest.de/) war. + +Da ich also kein Ticket für das WGT hatte, weils die ja leider noch +nicht für umsonst geht, hat es mich auch ganz ominösen Wegen auf das +Wollefest verschlagen. (Und das, obwohl ich ja kaum Stricken kann!<>!)\ +Und was hat mir das ganze eingebracht? Wollknäule natürlich und jetzt +muss ich wohl auch noch lernen Socken zu Sticken, aber ich bin ganz +Tapfer und es wird garantiert werden. + +Meine tolle bunte Wolle hab ich zB von da: [Mit einem Klicks zur +Drachenwolle](http://www.drachenwolle.de/) + +Ausserdem habe ich mir eine wunderschöne schwarz-lila Glasperle mit +kleinen Swarovskikristallen geleistet. Und die nette Frau, die diese +herstellt hat \>\> [Hier](http://www.lieselottchen-puppen.de/) \<\< ihre +Website, wo man sie auch im Internet bestellen kann. (Ja, ich hatte +versprochen ein bisschen Werbung zu machen ;D ) + +**Noch viel Spass beim Wolle stöbern wünscht,**\ +**Stormwind** + +PS: Ja, wenn irgendwann die Socken einmal fertig sind, mache ich auch +Bilder und ihr könnt sie hier bewundern \*grins\* diff --git a/content/post/50.md b/content/post/50.md new file mode 100644 index 0000000..573f7db --- /dev/null +++ b/content/post/50.md @@ -0,0 +1,27 @@ ++++ +title = "Alle Tabellen einer DB loeschen mit PostgreSQL 9.0" +date = "2010-09-30T21:21:00+00:00" +author = "Gibheer" +draft = false ++++ + +Mit Version 9.0 der open source Datenbank [PostgreSQL (PostgreSQL: The +world’s most advanced open source database)](http://postgresql.org) +wurde die Möglichkeit geschaffen [anonyme Codeblöcke +(PostgreSQL 9.0 - Do +Statements)](http://www.postgresql.org/docs/current/interactive/sql-do.html) +auszuführen. + +Das habe ich mir eben mal zu nutze gemacht und ein kleines Script +geschrieben, welche mir alle Tabellen aus einer Datenbank löscht. + +DO \$\$declare i record;\ +begin\ +for i in (select tablename from pg\_tables where schemaname = ‘public’) +loop\ +execute ‘drop table’||i.tablename||‘cascade’;\ +end loop;\ +end\$\$; + +Dieses Script lässt sich in psql ausführen. Viel Spass mit dem +neuen Feature und beim ausprobieren. diff --git a/content/post/51.md b/content/post/51.md new file mode 100644 index 0000000..40fe8b1 --- /dev/null +++ b/content/post/51.md @@ -0,0 +1,16 @@ ++++ +title = "dtrace userland in FreeBSD head" +date = "2010-10-04T21:21:00+00:00" +author = "Gibheer" +draft = false ++++ + +Das dtrace Framework für Userland Anwendungen hat es in in den +Head-Zweig von FreeBSD geschafft und wird laut [Dru +Lavigne](http://freebsdfoundation.blogspot.com/2010/09/summary-of-dtrace-project.html) +mit Sicherheit in 9.0 erscheinen. Es gibt wohl auch Überlegungen es +auf 8-stable und 7-stable zu portieren. + +Damit ist es nun möglich dtrace in PostgreSQL oder MySQL zu +benutzen. FreeBSD hatte zwar schon dtrace support, allerdings +beschränkte sich dieser bisher nur auf den Kernel. diff --git a/content/post/52.md b/content/post/52.md new file mode 100644 index 0000000..bc488b5 --- /dev/null +++ b/content/post/52.md @@ -0,0 +1,23 @@ ++++ +title = "Spass mit test-driven development" +date = "2010-10-04T20:22:00+00:00" +author = "Gibheer" +draft = false ++++ + +Immer wieder scheitern Entwickler daran, wie man bei test-driven +development vorgehen muss. Manchmal werden Tests geschrieben, die im +Prinzip die gesuchte Antwort enthalten muessen und manchmal schreibt man +die falschen Tests, mit denen man nie zum Ziel kommt. Der folgende Link, +der mir heute begegnet ist, versucht den Nebel um die Frage, welche +Tests die richtigen sind, ein bischen zu lichten und ich wie ich finde, +auch einen sehr guten Beitrag dazu leistet, bessere Tests zu schreiben. + +Der Autor klaert die Frage anhand eines Code-Katas. Darunter versteht +man, laut dem Autor, eine Codeuebung, die man immer und immer wieder +macht um neue Wege zu entdecken ein Problem zu loesen und den Umgang mit +seinen Werkzeugen besser zu lernen. Im Grunde ist es sowas wie +Training. + +Aber lest einfach selbst auf +[thecleancoder.blogspot.com](http://thecleancoder.blogspot.com/2010/10/craftsman-62-dark-path.html) diff --git a/content/post/53.md b/content/post/53.md new file mode 100644 index 0000000..4666462 --- /dev/null +++ b/content/post/53.md @@ -0,0 +1,121 @@ ++++ +title = "FreeBSD Status Report Juli - September 2010" +date = "2010-10-29T18:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +Der Statusreport für den Zeitraum Juni bis September 2010 des +FreeBSD Projektes wurde veröffentlicht und ich habe darin einige +interessante Sachen gefunden. So gibt es Entwicklung in der Richtung den +Default-Compiler (GCC) durch Clang zu ersetzen, Umbau der +Eventverwaltung im Kernel, ZFS v28 zu integrieren und einige Sachen +mehr. + +[Clang ersetzt GCC im Basissystem](http://www.freebsd.org/news/status/report-2010-07-2010-09.html#Clang-Replacing-GCC-in-the-Base-System) +----------------------------------------------------------------------------------------------------------------------------------------- + +Clang ist ein Compilerfrontend, welches auf dem Projekt +LLVM aufbaut. Mit Clang ist es +möglich Quellcode schneller zu kompilieren, bei einem geringeren +Speicherverbrauch. Die Performance wird dadurch nicht +beeinträchtigt, allein die entstehenden Kompilate sind etwas +grösser. + +In Version 9 von FreeBSD soll der default compiler für den Kernel +und das Basissystem von GCC zu Clang umgezogen werden. Am 25.02.2009 +konnte der [FreeBSD Kernel kompiliert ([ANNOUNCE]: clang/llvm can +compile booting FreeBSD kernel on +i386/amd64)](http://lists.freebsd.org/pipermail/freebsd-current/2009-February/003743.html) +werden, war damals in etwa in dem Zustand, wie der [Linux Kernel 1,5 +Jahre ([cfe-dev] Clang builds a working Linux Kernel (Boots to RL5 with +SMP, networking and X, self +hosts))](http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011711.html) +später. + +Mittlerweile läft der FreeBSD Kernel und das Userland stabil und +braucht nur noch Tests. Es ist geplant auch Ports auf Clang umzustellen. +Es gibt allerdings Ports, die auch in Zukunft nur mit dem GCC gebaut +werden können, da sie meist Erweiterungen des GCC nutzen, welche in +keinem Standard vorkommen. + +[Eventverwaltung im Kernel](http://www.freebsd.org/news/status/report-2010-07-2010-09.html#Kernel-Event-Timers-Infrastructure) +------------------------------------------------------------------------------------------------------------------------------ + +Jeder Architektur hat im Kernel ihre eigene Timerarchitektur, was zu +einer grossen Fragmentierung des Codes beigetragen hat. Zudem wurde der +Timer immer mit 1Hz oder 4\*1Hz aktiv, so dass es 10.000 und mehr +Interrupts gab, welche die CPU nicht zur Ruhe kommen liess. + +Bei diesem Projekt wird nun ein einheitliches Interface geschaffen, +welches die zur Verfügung stehenden Timer benutzt. Zusätzlich +gibt es Bemühungen Ticks zu sparen und den Scheduler auf Tickless +oder auf viel weniger Ticks zu bringen. Bei ersten Tests konnte damit +die Zahl der Interrupts von \~16.000 auf 90 gesenkt werden. Zudem gibt +es bebühungen den Scheduler dazu zu bringen, schlafende Cores nur +zu wecken, wenn es absolut nötig ist, da bei neueren Prozessoren +einzelne Cores auch übertaktet werden können. + +[neues sysinstall](http://www.freebsd.org/news/status/report-2010-07-2010-09.html#pc-sysinstall) +------------------------------------------------------------------------------------------------ + +Seit mehr als einer Dekade begleitet sysinstall nun das FreeBSD Projekt +und ist damit zu einem der stabilsten und verlässlichsten Installer +geworden. Allerdings unterstützt er viele neuere Features des +FreeBSD Projektes nicht mehr, wie zum Beispiel GPT, ZFS, +Raidinstallationen und so weiter, so dass nun an einem neuen Installer +gearbeitet wird. Dieser kommt nun von PC-BSD, einem FreeBSD-Derivat und +heisst pc-sysinstall. Er soll mit FreeBSD 9 der neue Standardinstaller +werden. + +pc-sysinstall arbeitet etwas anders als die meisten Installer, die +bisher entwickelt wurden. So Ist pc-sysinstall im ersten Moment nichts +weiter als eine Bibliothek, an der verschiedene Frontends angeschlossen +werden können. So sind zum Beispiel installer in QT, GTK, ncurses +usw. machbar. Was allerdings dabei herauskommt ist keine fertige +Installation, sondern ein Script, welches dann erst die Installation +ermöglicht. Das hat den Vorteil, dass man sich seine Installation +zusammenbauen kann und diese dann immer wiederholen kann. Ob auf der +selben Maschine oder auf vielen weiteren ist dabei egal. + +Der neue Installer ist bereits in HEAD implementiert, Testmedien, mit +denen der Installer ausprobiert werden kann, befinden sich in +Entwicklung. + +Eine kleine Liste der Features kann auch im [vorherigen +Report](http://www.freebsd.org/news/status/report-2010-04-2010-06.html#New-System-Installer-%E2%80%94-pc-sysinstall) +nachgelesen werden. + +[Featureliste des Kernels](http://www.freebsd.org/news/status/report-2010-07-2010-09.html#Registration-of-Optional-Kernel-Subsystems-via%0A------sysctl) +-------------------------------------------------------------------------------------------------------------------------------------------------------- + +In FreeBSD 8.0 kam ein neues Set an Ausgaben in Sysctl hinzu, welches +`kern.features` hiess. Darin enthalten war eine kleine Liste an +Optionen, was von dem System unterstützt wurde. + +In Version 9 kommen nun viele weitere Optionen hinzu (mehr als 80). Es +ist geplant, dass sich jedes Subsystem bei sysctl registriert und somit +eine Liste der Features zustande kommt, welche auf dem aktuell laufenden +System vorhanden sind. Werden Subsysteme nicht in den Kernel kompiliert, +so erscheinen diese einfach nicht und man hat Gewissheit darüber, +dass das Feature nicht vorhanden ist. + +[ZFS](http://www.freebsd.org/news/status/report-2010-07-2010-09.html#ZFSv28-is-Ready-for-Wider-Testing) +------------------------------------------------------------------------------------------------------- + +Die aktuelle ZFS-Version in FreeBSD 8.1 ist die Version 15. Die letzte +in OpenSolaris verfügbare Version war 28. In FreeBSD 9 soll nun +Version 28 in FreeBSD verfügbar sein. Die meiste Arbeit daran ist +schon getan und ein Patch existiert. Allerdings muss dieser noch +ausgiebig getestet werden. Was kommt damit alles hinzu? +Deduplication,triple parity RAIDZ, diff, split, snapshot reference +count, die Möglichkeit zu einem früheren Stand eines Pools +zurückzukehren und read-only import. Eine Gute Zusammenfassung zu +dem Patch gibt es im im +[Announcement](http://lists.freebsd.org/pipermail/freebsd-fs/2010-August/009197.html). + +Es gibt noch einige weitere tolle Projekte, welche in FreeBSD 9 +enthalten sein werden und teilweise auch noch auf 8-CURRENT portiert +werden sollen, wie zum Beispiel Ressourcelimits, Erweiterungen an +VIMAGE/VNET, dem Chromiumport usw. FreeBSD 9 koennte also fast wie +Weihnachten und Geburtstag auf einmal werden ;) diff --git a/content/post/54.md b/content/post/54.md new file mode 100644 index 0000000..947b223 --- /dev/null +++ b/content/post/54.md @@ -0,0 +1,18 @@ ++++ +title = "Spielwahn mit Wasser" +date = "2010-12-24T16:50:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da heute wieder so viel schoener Schnee gefallen ist, hab ich einfach +angefangen und einen Schneemann gebaut. Er kommt in etwa auf 2,30m und +ist damit der groesste, den ich bisher gebaut habe. + +![](/images/snowman3.png) + +Viel Spass mit dem vielen Schnee ;) + +![](/images/snowman1.png)\ +![](/images/snowman2.png)\ +![](/images/snowman4.png) diff --git a/content/post/55.md b/content/post/55.md new file mode 100644 index 0000000..afcf6ee --- /dev/null +++ b/content/post/55.md @@ -0,0 +1,50 @@ ++++ +title = "ZFS Versionen" +date = "2011-01-05T13:37:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da es anscheinend keine aktuelle Liste der ZPOOL Versionen gibt mit den +Informationen, wann welche Funktion hinzugekommen ist, hinterlege ich +dir erstmal hier. + +Die Liste stammt aus einem Solaris 11 Express. Solaris 11 benutzt im +Moment ZPOOL 31, FreeBSD 8.1 Version 15, wobei 9.0 wahrscheinlich +Version 28 enthalten wird. + + ----- ---------------------------------------------------------- + VER DESCRIPTION + --- -------------------------------------------------------- + 1 Initial ZFS version + 2 Ditto blocks (replicated metadata) + 3 Hot spares and double parity RAID-Z + 4 zpool history + 5 Compression using the gzip algorithm + 6 bootfs pool property + 7 Separate intent log devices + 8 Delegated administration + 9 refquota and refreservation properties + 10 Cache devices + 11 Improved scrub performance + 12 Snapshot properties + 13 snapused property + 14 passthrough-x aclinherit + 15 user/group space accounting + 16 stmf property support + 17 Triple-parity RAID-Z + 18 Snapshot user holds + 19 Log device removal + 20 Compression using zle (zero-length encoding) + 21 Deduplication + 22 Received properties + 23 Slim ZIL + 24 System attributes + 25 Improved scrub stats + 26 Improved snapshot deletion performance + 27 Improved snapshot creation performance + 28 Multiple vdev replacements + 29 RAID-Z/mirror hybrid allocator + 30 Encryption + 31 Improved ‘zfs list’ performance + ----- ---------------------------------------------------------- diff --git a/content/post/56.md b/content/post/56.md new file mode 100644 index 0000000..53d38cd --- /dev/null +++ b/content/post/56.md @@ -0,0 +1,21 @@ ++++ +title = "Shells in anderen Sprachen" +date = "2011-01-11T07:54:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich hatte mir schon länger überlegt, warum es eigentlich keine Shells in +anderen Scriptsprachen ausser shell gibt. Python, Ruby und Perl bringen +eigene Shells mit, in denen man Code ausführen und testen kann. Diese +Shells sind allerdings nicht mit den Funktionen einer zsh oder bash +ausgestattet und es fehlt der einfache Zugriff auf Programme wie rsync +und co. + +Heute morgen habe ich allerdings die [Rush](http://rush.heroku.com/) +gefunden, eine Shell, welche in Ruby geschrieben wurde und auch mit +Rubysyntax bedient wird. + +Die “Navigation” sieht zwar recht gewöhnungsbedürftig aus und es gibt +noch keine direkte Möglichkeit um zum Beispiel git aufzurufen, aber ich +denke mal, dass das durchaus eine interessante Shell wird. diff --git a/content/post/57.md b/content/post/57.md new file mode 100644 index 0000000..ae19be9 --- /dev/null +++ b/content/post/57.md @@ -0,0 +1,78 @@ ++++ +title = "Dokumentation in Textile schreiben" +date = "2011-01-20T17:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da ich mal Dokumentation schreiben musste, OpenOffice aber schon beim +ersten Tastenschlag keine Lust mehr hatte, ich mich bei HTML staendig +verschrieben habe, bin ich einfach auf Textile umgestiegen und hab +erfolgreich Dokumetation schreiben koennen. + +Textile ist ein einfaches Wikiaehnliches Markup. Zusammen mit Ruby ist +daraus ein kleines Script geschrieben, welches mir mein textile File in +ein HTML-Grundgeruest stopft, den Code etwas aufhuebscht und dann +einfach schnell arbeitet. + +Als Bibliotheken kamen dabei [RedCloth](http://redcloth.org/), +[RedclothCoderay](http://redclothcoderay.rubyforge.org/) und +[CodeRay](http://coderay.rubychan.de/) zum Einsatz. + +Damit das Script funktioniert muessen die Gems CodeRay, RedCloth und +RedclothCoderay installiert sein. + +Als naechstes muss im Verzeichniss des Scriptes eine +index\_template.html angelegt werden. Darin kann +&\#123;&\#123;content&\#125;&\#125; als Platzhalter fuer den Content des +textile-Files benutzt werden. In die index.textile kommt dann das Markup +rein. Mit &\#123;&\#123;toc&\#125;&\#125; kann in diesem File eine +Inhaltsangabe aus den `h[1-3].` erstellt werden. + +Speichert einfach das folgende Script in einer Datei und ruft es mit +ruby auf und schon bekommt ihr euer textile umgewandelt. + +\# To change this template, choose Tools | Templates\ +\# and open the template in the editor. + +require ‘rubygems’\ +require ‘redcloth’\ +require ‘coderay’\ +require ‘redclothcoderay’ + +RedclothCoderay.coderay\_options :css =\> :class\ +search\_headlines = /h([1-3])\. +s(. +*)/ + +def build\_menu array, depth\ + result = “”\ + if array.length \> 0 then\ + array.each do |el|\ + result \<\< ‘**’** (depth + 1) +’ "‘+ +el[:bez]*“\":\#\#{el[:bez].gsub(/\\s/,‘\_’)}\\n”\ + if el.length \> 0 then\ + result \<\< build\_menu\ + end\ + end\ + end\ + result\ +end +\ +File.open ’index.html’, ’w’ do |file|\ + index = File.read\ + code = File.read\ + toc = \ + if match[0] 1.to\_s then + toc \<\< {:bez =\> match[1], :toc =\> []} + elsif match[0] 2.to\_s then\ + toc.last \<\< \ + elsif match[0] == 3.to\_s then\ + toc.last.last \<\< \ + end\ + ’h’*match[0]+’(\#‘+match[1].gsub(/\\s/,’\_‘)*’). ’*match[1]\ + end\ + code = code.gsub(/{{toc}}/, build\_menu(toc, 0)+“\n”)\ + file.write(index.gsub /{{content}}/, RedCloth.new(code).to\_html)\ +end\ +puts ’ready’ diff --git a/content/post/58.md b/content/post/58.md new file mode 100644 index 0000000..3f4f609 --- /dev/null +++ b/content/post/58.md @@ -0,0 +1,49 @@ ++++ +title = "daily zfs snapshots" +date = "2011-04-26T13:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +In (Open)Solaris gab es eine Funktion mit dem Namen TimeMachine. Das +sind einzelne Scripte, welche in regelmaessigen Abstaenden laufen und +Snapshots der Dateisysteme erstellen. + +Da es diese Funktion unter FreeBSD so noch nicht gibt, hatte ich mir +gedacht, so ein Script selbst zu bauen. Wie ich dann feststellen durfte, +gibt es bereits eine handvoll Scripte, die genaue diese Aufgabe auf +verschiedene Art und Weise vollbringen. + +Da ich aber ohnehin Uebung in Shellscripten brauchte, habe ich es +einfach mal weiter geschrieben und dabei herausgekommen ist ein Script, +welches taegliche, woechentliche, monatliche und jaehrliche Snapshots +erstellen kann. Die Konfiguration wird nicht in ein Config file +geschrieben sondern in Form von Properties direkt auf die ZFS-Partition +geschrieben. + +Einzig in der /etc/periodic.conf muss ein Eintrag +`snapshot_zfs_enable="YES"` hinterlegt werden. + +Das Script koennt ihr euch [hier](//downloads/zfs_snapshot.sh) +runterladen. Dieses koennt ihr nach +`/usr/local/etc/periodic/daily/900.snapshot_zfs` oder nach +`/etc/periodic/daily/900.snapshot_zfs` entpacken. Wenn in der +`/etc/periodic.conf` der Eintrag fuer snapshots drin ist, dann laeuft +das Script von nun an jeden Tag. + +Jetzt koennen wir fuer eine ZFS Partition mal das Snapshot einschalten: + +\ +\# zfs set org.snap:auto-snapshot=on tank/storage\ +\# zfs get org.snap:auto-snapshot\ +NAME PROPERTY VALUE SOURCE\ +tank/storage org.snap:auto-snapshot on local\ +tank/storage/foo org.snap:auto-snapshot on inherited from tank/storage\ + + +Mit diesen Einstellungen jeden Tag ein Snapshot erstellt, wobei 10 +taegliche, 3 woechentliche und 3 monatliche Snapshots aufgehoben werden. +Zusaetzlich gibt es noch die Option fuer jaehrliche Snapshots. Die Zahl +der aufzuhebenden Snapshots laesst sich mit den Properties +`org.snap:keep-daily`, `org.snap:keep-weekly`, `org.snap:keep-monthly` +und `org.snap:keep-yearly` festlegen. diff --git a/content/post/59.md b/content/post/59.md new file mode 100644 index 0000000..f05c9a1 --- /dev/null +++ b/content/post/59.md @@ -0,0 +1,26 @@ ++++ +title = "DTrace fuer den Linuxlator in FreeBSD" +date = "2011-04-27T15:34:00+00:00" +author = "Gibheer" +draft = false ++++ + +DTrace ist eine sehr nette Sache, wenn man wissen will, was auf seinem +System alles los ist. Warum zum Beispiel ein Programm X eigentlich tut, +dass auf einmal alles so traege ist. DTrace stammt von Sun Solaris und +hat auch den Einzug in FreeBSD gefunden. + +FreeBSD hat die Moeglichkeit durch eine Linux ABI Programme +auszufuehren, die eben diese brauchen. Bisher war es aber nicht moeglich +mittels DTrace in diese Funktionen schauen zu koennen. + +Alexander Leidinger hat allerdings seinen Patch von 2008 fuer -current +aktualisiert, so dass man damit die Moeglichkeit hat, auch mit DTrace in +die Linux Schnittstelle schauen zu koennen. + +Er hat dazu auch eine +[Zusammenfassung](http://www.leidinger.net/blog/2011/03/28/new-dtrace-probes-for-the-linuxulator/) +geschrieben, in der er den Status des Patches beschreibt. + +Ob und wann dieser Patch allerdings so weit ist, dass man ihn in +FreeBSD-current findet, schreibt er leider selbst nicht. diff --git a/content/post/6.md b/content/post/6.md new file mode 100644 index 0000000..c054640 --- /dev/null +++ b/content/post/6.md @@ -0,0 +1,24 @@ ++++ +title = "Symbole in Ruby" +date = "2009-06-11T08:35:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ruby hat einen Datentyp, der recht interessant ist. Er ist weder +Integer, noch Boolean, noch String, aber er kann benutzt werden, wie ein +String oder ein Boolean. + +Die Rede ist von Symbolen. + +Bevor ich jetzt anfange wie einer der vielen, auch Symbole erklären +zu wollen, verweise ich lieber auf [13 Wege um ein Ruby Symbol zu +betrachten (Ruby Symbole auf +ruby-mine.de)](http://www.ruby-mine.de/2007/3/3/13-wege-um-ein-ruby-symbol-zu-betrachten"). + +Die Erklärung enthaelt 13 unterschiedliche Ansätze um diese +Konstrukte zu erklären. + +Symbole sind auf jeden Fall einen Blick wert, vor allem, da es sie +meines Wissens nach, weder in PHP noch in Java gibt, aber durchaus einen +guten Mehrwert bieten. diff --git a/content/post/60.md b/content/post/60.md new file mode 100644 index 0000000..ef85166 --- /dev/null +++ b/content/post/60.md @@ -0,0 +1,27 @@ ++++ +title = "jede Menge Umzuege" +date = "2011-04-27T16:23:00+00:00" +author = "Gibheer" +draft = false ++++ + +Endlich haben wir auch den letzten Umzug hinter uns. Stormwind und ich +haben in den letzten 2 Monaten einen Umzugsmarathon hingelegt. Zu aller +erst haben wir angefangen den Blog von serendipity auf jekyll und damit +von dynamisch generierten Seiten auf statische Seiten umzustellen. + +Dann haben wir auch noch den Wohnort gewechselt und hocken nun in +Karlsruhe in einer wunderschoenen Wohnung direkt am Berg. Hier auch noch +mal ein dickes danke an die Helfer. Es sieht sogar schon etwas wohnlich +aus ;)\ +Und zu guter letzt habe ich auch noch den Hoster von hetzner zu ovh +gewechselt. Wahrscheinlich haben das viele noch garnicht mitbekommen, +aber der wechsel fand innerhalb von einem Tag statt, inklusive der +Domainumstellung verlief sehr glatt. + +Bisher gab es nur kleinere Probleme mit IPv6, welche aber anscheind +geloest sind. + +Wir werden wahrscheinlich noch weitere Sachen in den Blog einbauen, wie +zum Beispiel eine Blaetterfunktion oder eine Liste aller Keywords, die +wir in den Eintraegen haben. Aber das kommt spaeter noch. diff --git a/content/post/61.md b/content/post/61.md new file mode 100644 index 0000000..fa6bcf7 --- /dev/null +++ b/content/post/61.md @@ -0,0 +1,68 @@ ++++ +title = "Technik hinter dem neuen Blog" +date = "2011-05-18T12:25:00+00:00" +author = "Gibheer" +draft = false ++++ + +Whaerend der alte Blog noch auf eine Datenbank zurueck gegriffen hat, +ist der neue Blog komplett statisch. Alle Blogeintraege werden in Form +von Textdateien geschrieben und anschliessend zu html konvertiert. + +Als Generator benutzen wir [jekyll](https://github.com/mojombo/jekyll), +was auch bei [github](http://github.com) zum Einsatz kommt. Es laesst +sich einfach erweitern und mit verschiedenen Markupsprachen kombinieren. +Die einzelnen Eintraege bekommen einen Markupunabhaengigen Header +verpasst in dem Daten gespeichert werden, wie zum Beispiel Keywords, das +Erscheinungsdatum, der Autor und was man noch so moechte. + +Da mir html schreiben auf dauer zu nervig war, habe ich mich umgeschaut, +welche anderen Sorten von Markup es denn gibt und bin auf +[Textile](http://redcloth.org/textile), +[Markdown](http://daringfireball.net/projects/markdown/syntax), +[Haml](http://haml-lang.com/) und noch ein paar andere gestossen. Da ich +Textile schon durch [redmine](http://redmine.org) kannte und die syntax +mir einfacher als die von Markdown vorkam, habe ich mich fuer Textile +entschieden. Haml wollte ich fuer die Layouts benutzen, allerdings waere +es einiges an Aufwand gewesen Jekyll dies beizubringen. Also sind +zumindest die Layouts in einfachem HTML geschrieben. + +Da ich ab und zu auch mal Syntax-Highlighting benoetige, stand +natuerlich noch die Frage im Raum, mit welcher Engine sich dieses +Problem loesen laesst. Jekyll hat dafuer bereits eine Schnittstelle +eingebaut, welches auf die Pythonlib Pygments zugreift. Es erschien mir +allerdings etwas abwegig beim kompillieren zwei verschiedene +Scriptsprachen laufen zu lassen. Da die einzig andere Loesung unter Ruby +[coderay](https://github.com/rubychan/coderay) heisst, habe ich dieses +eingebaut und mit Textile verkuppelt. + +Da wir das Design ein bischen aufpeppen wollten und damit auch etwas +CSS3 einzustreuen, stand natuerlich die Frage im Raum: “Wollen wir die +ganzen besonderheiten selber bauen?” Natuerlich nicht! Deswegen habe ich +zuerst [Sass](http://sass-lang.com/) und spaeter noch +[Compass](http://compass-style.org/) hinzugenommen. + +Sass ist eine Sprache, mit der sich leicht CSS schreiben laesst. Es +bietet Unterstuetzung fuer Variablen, Funktionen und +[Mixins](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins). +Mit letzterem lassen sich Attributsbloecke bilden und dann mit einer +Zeile an der jeweiligen Stelle importieren. + +Compass bietet dazu weitere Funktionen, um zum Beispiel Farben zu +bearbeiten, Farbverlaeufe zu erstellen oder das komplette Layout zurueck +zusetzen. + +Wenn man sein Design dann fertig hat, kann man Sass dann anweisen die +CSS-Datei\ +so zu formatieren, dass einiges an Speicher gespart werden kann. + +Da der Blog nun allerdings komplett statisch ist, haben wir ein +Javascript von Disqus mit eingebaut, welches eine Diskusionsplatform +bereitstellt. Ob sich das allerdings lohnt, muss sich erst noch zeigen. + +Den Blog insgesamt werde ich vielleicht bald auf +[github](http://github.com) hochladen, aber mal schauen. Auf jeden Fall +werde ich noch ein paar weitere Eintraege machen, in denen ich weitere +Teile vorstellen werde. + +viel Spass diff --git a/content/post/62.md b/content/post/62.md new file mode 100644 index 0000000..d34c1a6 --- /dev/null +++ b/content/post/62.md @@ -0,0 +1,66 @@ ++++ +title = "Schwarze Seelen brauchen bunte Socken - Teil 3" +date = "2011-06-03T16:42:00+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo Ihr, +========== + +letztes Wochenende war es mal wieder so weit. In Leipzig war wieder +[Wollefest](http://www.leipziger-wolle-fest.de). Diesmal das 4. und das +dritte bei dem ich dabei war. + +Ich muss gestehen, dass ich im Moment nicht so sehr auf schon +“strickfertige” Wolle stehe. Deswegen habe ich mir überwiegend Kammzüge +gekauft. + +!(float\_right)/images/lwf2011-wolle.jpg! Die zwei Wollknäule von +[Schoppel](http://www.schoppel-wolle.de) (Farbe “Kleiner Fuchs”) habe +ich für eine Ergänzung meines eigentlich schon fertigen Rocks gekauft. +Aber leider ist er etwas kurz geraten, so dass er nicht wirklich zum +Rock - eher zum Nierenwärmer - taugt. Aber dieser Markel muss natürlich +behoben werden. Auch wenn das noch viel Arbeit bedeuten wird. + +Nur dem schönen Dankeschönstrang von der +[Zauberwiese](http://www.zauberwiese.de) konnte ich dann doch nicht +widerstehen und musste ihn unbedingt mitnehmen. Ausserdem noch ein Paar +Ohrringe… man erinnere sich an die Gießkannen von letztem Jahr. Diesmal +nur ein klein wenig unauffälliger, mit verschiedenen Aufschriften +“Leben” und “Tod”. + +Die Verkäuferin hat mir erzählt, dass die die Worte aus einem alten +Buch, in dem sich ein Pärchen immerzu Liebesbriefe geschrieben hat und +leider doch nicht zusammen finden konnte. Wer weiß?\ +Die sind auf jeden Fall einen Hinkucker wert. + +Eigentlich wollte ich meine Kniestrümpfe an dem Samstag weiterstricken, +aber daraus wurde nichts. Ich hatte nämlich mein [Little +Gem](http://www.majacraft.co.nz/wheels/little_gem.php) mit nach Leipzig +genommen… und da ich es schon mal dabei hatte, sollte ich es auch mit +aufs Wollefest nehmen und unbedingt ein bissel was Spinnen. Zum Opfer +fiel mir ein Kammzug aus der Krabbelkiste von +[Dibadu](http://www.dibadu.de), den ich an diesem Tag zur Hälfte +versponnen habe (Die Spule kann man auch auf dem Foto sehen). + +!(float\_left)/images/lwf2011-ohrringe.jpg! Ich hatte mich extra in die +hinterste Ecke verkrochen, aber trotzdem hab ich das Gefühl, dass ich +die meist fotographierte Person auf dem Wollefest war. So viele kamen +dann doch vorbei, fanden mein Spinnrad total süß und wollten wissen, was +das für eins ist. Dabei war ich bei weitem nicht die einzige Spinnerin +auf dem Fest. + +Auf dem gepflasterten Platz neben dem Stand des Strickcafes hatte sich +nämlich Lady Ramone niedergelassen und ihren Spinnkurs gegeben. Es +sollten möglichst kunstvolle Garne hergestellt werden. + +Ich hätte am liebsten auch mitgewerkelt, aber ich hab diesen Kurs schon +für das [Wollfest in +Nierstein](http://www.handspinngruppe-schwabsburg.de) gebucht auf dem +ich kommendes Wochenende bin. + +Ich bin schon gespannt, was mich da erwartet. + +**Bis denne…**\ +… ich werde natürlich berichten diff --git a/content/post/63.md b/content/post/63.md new file mode 100644 index 0000000..8117ee9 --- /dev/null +++ b/content/post/63.md @@ -0,0 +1,161 @@ ++++ +title = "Accesslogs in die Datenbank" +date = "2011-06-21T16:30:00+00:00" +author = "Gibheer" +draft = false ++++ + +Da ich mal unsere access-logs der letzten paar Tage auswerten wollte, +brauchte ich eine Moeglichkeit die Daten in eine Datenbank zu packen. +Dummerweise sind die Log-Dateien der Webserver nicht Datenbankgerecht +und keiner hat ein Interface um Datensaetze gleich in eine Datenbank zu +schreiben. + +Deswegen hab ich mir eine Methode ueberlegt, mit der ich die Daten in +die Datenbank bekomme, ohne dass es viel Aufwand bedarf. + +Voraussetzungen +=============== + +Da das hier eine Art kleines Tutorial wird hier eine Liste der Programme +die ich benutzt habe: + +\* lighttpd\ + \* PostgreSQL\ + \* simples Shell (sh FreeBSD Version)\ + \* cron\ + \* logrotate (newsyslog in FreeBSD) + +Logformat setzen +================ + +Als erstes brauche ich ein Logformat, welches sich auch gut verarbeiten +laesst. Im Default sind alle Felder durch Whitespaces getrennt und es +gibt Felder, welche nicht immer gefuellt sind, was sich nur sehr schwer +parsen laesst. + +Deswegen hatte ich mir ueberlegt, das Logformat in Richtung CSV-Datei +auszurichten. Im lighttpd muss dazu das Module `mod_accesslog` +eingebunden werden. + +Danach steht die Option +`accesslog.format`:http://redmine.lighttpd.net/wiki/1/Docs:ModAccesslog +zur Verfuegung. Diese habe ich bei uns auf folgenden Wert gesetzt + +\# log format for csv\ +\# h host ip +\# t timestamp of the end of the request\ +\# m request method +\# s status code\ +\# b bytes sent +\# U request URL\ +\# f real filename +\# q query string\ +\# T time used in secounds +accesslog.format = "h|t|m|s|b|U|f|q|T|i|{Referer}i"\ + + +Das Zeichen `|` ist dabei mein CSV-Trennzeichen, damit ich die Werte +auseinander halten kann. + +Datenbankschema +=============== + +Das Datenbankschema entspricht dem Schema der CSV-Datei. + +CREATE TABLE logs (\ + ip text,\ + datum text,\ + method text,\ + code integer,\ + bytes integer,\ + req\_file text,\ + full\_path text,\ + query\_string text,\ + time\_taken integer,\ + user\_agent text,\ + referer text\ +);\ + + +optionaler User +--------------- + +Wenn man auf Nummer sicher gehen will, kann man noch einen zusaetzlichen +User anlegen, welcher nur Insertrechte auf diese Tabelle hat. Damit kann +man ausschliessen, dass irgendwas doofes passiert, wie zum Beispiel ein +Drop Table oder aehnliches. + +Das geht dann mit folgendem Befehl: + +create role wwwimport login password +’changeme![]('; + +h1. Logrotate + +Lighttpd schreibt per default nach @/var/log/lighttpd/access.log@ bis kein Speicher mehr da ist. Wenn man allerdings die Datei allerdings verschiebt und eine neue hinstellt ohne den Server neu zu starten, so loggt dieser in die verschobene Datei. Wird sie geloescht, dann loggt der Server garnicht mehr. +Da das fuer die Logverarbeitung ungeschickt ist, musste da irgendwie ein logrotate rein. Unter FreeBSD geht das mit @/etc/newsyslog.conf@ wo ich den Eintrag + +/var/log/lighttpd/access.log www:www 664 7 * @T00 Z /var/run/lighttpd.pid + +gesetzt habe. Das erstellt Archive im Format @access.log..gz@. Allerdings wird dabei auch am Anfang der neuen und am Ende der alten Datei eine Zeile eingesetzt, dass ein rotate stattgefunden hat. + +h1. das Script als cron + +Um die Daten in die Datenbank zu bekommen habe ich den Befehl "COPY":http://www.postgresql.org/docs/9.0/static/sql-copy.html genommen, da er schneller als 9000 einzelne Selects arbeitet. +Zusaetzlich hat der Timestamp den kleinen Makel, dass er von [ und ] umgeben ist, wodurch sich das Feld nicht einfach als Timestamp speichern laesst. +Die Timestamps lassen sich allerdings recht einfach mit folgendem Befehl bereinigen + +sed -e "s/[][]//g" + +Das Problem mit der zusaetzlichen Zeile loesen wir mit einem @grep@. + +grep -v "logfile turned over" + +geloest. Das gibt nur noch die Zeilen aus, welche nicht den String enthalten. + +Insgesamt kommt dabei bei mir folgendes kleines Script raus. + +#)/usr/bin/env ksh + +LOG\_PATH=“/var/log/lighttpd”\ +LOG\_FILE=“access.log”\ +TABLE=“logs”\ +DATABASE=“test”\ +DBUSER=“wwwimport”\ +DBPASS=“changeme![](" + +WORKDIR="/tmp/logimport" + +# create a workdir +if [ -d $WORKDIR ]; then + echo 'Job is running)’\ + exit 1\ +else\ + mkdir ~~m 700 \$WORKDIR\ +fi +\ +files=\$\ +workfile="\${WORKDIR}/dump.sql" +\ +echo "COPY \${TABLE} FROM STDIN WITH DELIMITER ‘|’;" \>\> \$workfile +\ +for file in \$files; do\ + gzcat \$file | sed~~e”s/[][]//g" | grep ~~v “logfile turned over” \>\> +\$workfile\ + rm \$file\ +done +\ +PGPASSWORD=“\$DBPASS” psql~~U \$DBUSER -f \$workfile \$DATABASE + +1. delete the workdir\ + rm \$workfile\ + rmdir \$WORKDIR\ + exit 0 + +Das habe ich dann noch irgendwo gespeichert und im cron mit + +0 23 \* \* \* sh logimport.sh + +eingetragen. Jetzt importiert es munter meine Logs und ich kann anfangen +`R` zu lernen. diff --git a/content/post/64.md b/content/post/64.md new file mode 100644 index 0000000..d975959 --- /dev/null +++ b/content/post/64.md @@ -0,0 +1,14 @@ ++++ +title = "neues Lebenszeichen - neuer Blog" +date = "2011-08-11T13:04:03+00:00" +author = "Gibheer" +draft = false ++++ + +Nachdem es hier lange Still war, gibt es mal wieder ein Update. In der zwischenzeit haben wir den Blog auf eine eigene Software umgezogen, weil uns Jekyll nicht gepasst hat. Fuer mich war es zwar einfach von der Konsole aus die Beitraege zu verfassen, allerdings fehlte die Moeglichkeit auch mal von unterwegs "schnell" etwas zu verfassen. + +Nun haben wir eine eigene Blogsoftware (die auch auf github liegt). Mal schauen wie gut wir damit zurecht kommen. Im Gegensatz zu jekyll generieren wir keine statischen Files, sondern der Content wird in der Datenbank gespeichert und bei jedem Request neu generiert. Das ist im Moment noch etwas langsam, aber da werd ich noch was bauen, damit das besser passt. + +Es wird noch eine Kommentarfunktion hinzukommen und es ist geplant unterschiedliche Typen von Blogposts machen zu koennen. Ersteres wird wahrscheinlich recht einfach werden, letztes ist im Moment nur eine grobe Idee in meinem Kopf. + +Es ist auf jeden Fall ein nettes Experiment und mal schauen, wie es sich in Zukunft weiter entwickeln wird. diff --git a/content/post/65.md b/content/post/65.md new file mode 100644 index 0000000..64a1e0a --- /dev/null +++ b/content/post/65.md @@ -0,0 +1,20 @@ ++++ +title = "SmartOS - a new Solaris" +date = "2011-08-15T20:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +Some minutes ago I saw on [hacker news](http://news.ycombinator.com/) the following line [Joyent Open Sources SmartOS: Zones, ZFS, DTrace and KVM (smartos.org)](http://smartos.org/). +Who is behind SmartOS? +====================== + +What does that mean? I took a look and it seems, that Joyent, the company behind [node.js](http://nodejs.org/), has released their distribution of [Illumos](https://www.illumos.org/). +After the merge of sun and oracle, OpenSolaris as a project was closed in favor of Solaris11. As OpenSolaris was OpenSource the project Illumos emerged from the remains of OpenSolaris, but there was no release of the Illumos kernel in any project till now. + +So what is different? +===================== + +The first things I saw on their page are dtrace zfs and zones. So it's a standard solaris. But there is more: *KVM*! If the existence of zones means also, that it has crossbow and resource limits, then it would be absolutely gorgeous! It would be possible to build the core services on solaris zones and on top of that multiple dev or production machines with linux, windows or whatever you want. + +I will test it first in a virtual box to see, how stable and usable it really is, as there is no documentation on the website yet. After my test I will report back. diff --git a/content/post/66.md b/content/post/66.md new file mode 100644 index 0000000..f898e00 --- /dev/null +++ b/content/post/66.md @@ -0,0 +1,16 @@ ++++ +title = "SmartOS - hype and a demo iso" +date = "2011-08-18T06:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +So, there is this new distribution of Illumos, [SmartOS](http://smartos.org) but it's not as ready as they claimed. Sure, there is an ISO but that ISO has no installer and no package manager. So one of the crucial part for using SmartOS is missing. + +As Joyent wrote on the [blog](http://blog.smartos.org) they are working on a wiki and the documentation and this night, they showed the [wiki](http://wiki.smartos.org). Until now there is only a documentation on how to use the usb image which got released the same time. But i think, that there will be much more coming. + +At the same time I found out, that kvm was released into the Illumos core too, so that kvm will be available with every other distribution too. And [OpenIndiana](http://openindiana.org) said, they want it in their 151 release too. 151 was planned to be released some months ago, so let's see, how fast they can get that out to the users. + +Joyent too should release a real distribution as fast as they can, because they created a large hype for SmartOS, but have nothing to use it in production. The ports are missing and an upgrade path is missing too. They wrote, that they are already using it in production, so why did they not release that? + +Illumos, OpenIndiana and Joyent with SmartOS are missing a big chance here to make that fork of OpenSolaris popular. They created much traction, but without having something, which could be used in production. We will see, how fast they can react. Hopefully, the release of either OpenIndiana or SmartOS, will be useable and stable in production. Then, they have a chance of getting me as an user. diff --git a/content/post/67.md b/content/post/67.md new file mode 100644 index 0000000..1de80eb --- /dev/null +++ b/content/post/67.md @@ -0,0 +1,10 @@ ++++ +title = "PostgreSQL 9.1 was released" +date = "2011-09-13T20:43:25+00:00" +author = "Gibheer" +draft = false ++++ + +Yesterday PostgreSQL 9.1 was released. It has some neat features included, like writable common table expressions, synchronized replication and unlogged tables. Apart from that, some performance tuning was included as well. + +If you are interested, take a look yourself at the [release notes](http://www.postgresql.org/about/news.1349) diff --git a/content/post/68.md b/content/post/68.md new file mode 100644 index 0000000..b56debe --- /dev/null +++ b/content/post/68.md @@ -0,0 +1,14 @@ ++++ +title = "OpenIndiana 151a released" +date = "2011-09-14T08:15:00+00:00" +author = "Gibheer" +draft = false ++++ + +After the release of [PostgreSQL 9.1](http://www.postgresql.org/about/news.1349), today another great open source project released a new version - [OpenIndiana](http://wiki.openindiana.org/oi/oi_151a+Release+Notes). + +OpenIndiana is based on a fork of OpenSolaris, named [Illumos](http://illumos.org). It was announced in august 2010. OpenIndiana has evolved since that time and got a stable release 148 and today 151a. That release is very solid and got one thing, which Solaris 11 has and most likely will never have: *KVM*. + +So from today you get a Solaris fork with crossbow, resource containers, zones and the kernel virtual machine, converted from linux to Illumos from the developers of [Joyent](http://joyent.com). They built there own distribution, [SmartOS](http://smartos.org), which is a bootable OS for managing a cloud like setup but without the zones. + +So if you have a large Infrastructure and want to seperate some programs from each other or have some old infrastructure, try OpenIndiana and it's zones and kvm. diff --git a/content/post/69.md b/content/post/69.md new file mode 100644 index 0000000..e803e2e --- /dev/null +++ b/content/post/69.md @@ -0,0 +1,12 @@ ++++ +title = "Solaris - a new way to 'ifconfig'" +date = "2011-09-15T14:29:27+00:00" +author = "Gibheer" +draft = true ++++ + +kleinere Hilfestellungen zu ipadm + +http://192.9.164.72/bin/view/Project+brussels/ifconfig_ipadm_feature_mapping +http://arc.opensolaris.org/caselog/PSARC/2010/080/materials/ipadm.1m.txt +http://blog.allanglesit.com/2011/03/solaris-11-network-configuration-basics/ diff --git a/content/post/7.md b/content/post/7.md new file mode 100644 index 0000000..0c36ffd --- /dev/null +++ b/content/post/7.md @@ -0,0 +1,28 @@ ++++ +title = "Webserver unter Ruby" +date = "2009-06-11T09:12:00+00:00" +author = "Gibheer" +draft = false ++++ + +Wenn man unter Ruby eine Webserveranbindung braucht, so kann man das +über einzelne Plugins wie fcgi, thin oder ähnliches regeln. +Allerdings geht dann die Fähigkeit verloren, die Applikation +über einen beliebigen Webserver laufen zu lassen, zum Beispiel in +der Produktionsumgebung über lighttpd mit fcgi und zum testen +über WEBrick. + +Rack bietet da eine tolle Möglichkeit, die Applikation in einer +Webumgebung laufen zu lassen, ohne das man selbst an alle Server denken +muss, weil eine Portierung so einfach ist. + +Für Rack gibt es, bis auf die Dokumentation der einzelnen +Funktionen, keine andere Quelle, die anschaulich erklärt, wie man +Rack benutzen kann. + +Es gibt eine Serie von Screencasts, die genau diese Lücke +füllen. Remi hat auf seiner Seite anfang des Jahres den Screencast +[Rack Basics](http://remi.org/2009/02/19/rack-basics.html) erstellt, der +auf sehr gute Art und Weise erklärt, wie man mit Rack umgehen kann. +In Teil 2 und 3 beschäftigt er sich auch noch mit Middleware, wie +zum Beispiel einen File Reloader, die man hinzuschalten kann. diff --git a/content/post/70.md b/content/post/70.md new file mode 100644 index 0000000..e7c6834 --- /dev/null +++ b/content/post/70.md @@ -0,0 +1,17 @@ ++++ +title = "get pfexec back in Solaris" +date = "2011-09-16T19:08:39+00:00" +author = "Gibheer" +draft = false ++++ + +If you tried Solaris 11 or OpenIndiana in a fresh installation, you may have noticed, that pfexec may not work the way you are used to. I asked in #openindiana on `irc.freenode.org` and I was told, that the behavior was changed. OpenSolaris was used to have an `Primary Administrator` profile which got assigned to the first account created on the installation. The problem with that is the same as on Windows - you are doing everything with the administrator or root account. To avoid that, sudo was introduced, which needs the password of your account with the default settings. What both tools are very different at what they do and at what they are good at. So it's up to the administrator to define secure roles where appropriate and use sudo rules for the parts, which have to be more secured. + +If you want back the old behavior, these two steps should be enough. But keep in mind, that it is important that you secure your system, to avoid misuse. + +* there should be line like the following in `/etc/security/prof_attr` +`Primary Administrator:::Can perform all administrative tasks:auths=solaris.*,solaris.grant;help=RtPriAdmin.html` +* if there is, then you can add that profile to your user with +`usermod -P'Primary Administrator` + +It is possible to combine these two mechanics too. You could build a zone to ssh into the box with a key and from there, ssh with sudo and a password into the internal systems. diff --git a/content/post/71.md b/content/post/71.md new file mode 100644 index 0000000..9f55752 --- /dev/null +++ b/content/post/71.md @@ -0,0 +1,20 @@ ++++ +title = "set environment variables in smf manifests" +date = "2011-09-26T14:35:10+00:00" +author = "Gibheer" +draft = false ++++ + +If you are in the need to set an environment variable for an smf service, you are looking for envvar. It get's set in the `service` scope or in the `exec_method` scope. Here is a small example, how it's used. + +``` + + + + + + + +``` + +This example sets the environment variable `FOO` to bar. This is espacially useful, when you have to modify `PATH` or `LD_LIBRARY_PATH`. Just don't forget, that you did it. diff --git a/content/post/72.md b/content/post/72.md new file mode 100644 index 0000000..28c3642 --- /dev/null +++ b/content/post/72.md @@ -0,0 +1,32 @@ ++++ +title = "How to use sysidcfg for zone deployment" +date = "2011-10-28T13:41:53+00:00" +author = "Gibheer" +draft = false ++++ + +This is mostly for myself that I can remember how to use the least documented feature of Solaris and openindiana - the `sysidcfg` files. + +These files help deploying new zones faster, as you don't have to configure them by hand afterwards. But what is the syntax and how can you use them? + +Here is an example file + + name_service=NONE + # name_service=DNS {domain_name= name_server=} + nfs4_domain=dynamic + timezone=Europe/Stockholm + terminal=xterms + root_password= + security_policy=NONE + network_interface= {primary hostname= default_route= ip_address= netmask= protocol_ipv6=yes} + network_interface= {hostname= ip_address= netmask= protocol_ipv6=yes default_route=NONE}` + +The most important thing first: you don't need system_locale after openindiana 151 anymore. If you have it in your config, even with C, delete it or else the setup will not work! + +If you don't have a dns record for your zone yet, set the @name_service@ to NONE. If you have already a record set, use the commented syntax. + +The next interesting setting is root_password. Here you don't input the password in cleartext but crypted. I wrote a little script to generate this string. You can find the code [here](https://github.com/Gibheer/zero-pwcrypter). + +The network_interface part is pretty easy, if you take these lines as a dummy. If you have only one interface, you can name the first interface PRIMARY. That way, you have a bit less to write. + +That's all so far. I will update this post, when I have figured out, what to fill into nfs4_domain and security_policy. diff --git a/content/post/73.md b/content/post/73.md new file mode 100644 index 0000000..b328c5f --- /dev/null +++ b/content/post/73.md @@ -0,0 +1,66 @@ ++++ +title = "openindiana - how to get routing working" +date = "2011-10-29T16:01:11+00:00" +author = "Gibheer" +draft = false ++++ + +This time, we are going to get routing working on the global zone for our other zones. You can replace the global zone with another zone too, as the setup is the same. + +What's needed? +============== + +First, we need to install ipfilter, if it isn't already installed. To do that, just invoke + + # pkg install ipfilter + +This will install the package filter and NAT engine. Latter is the part, we want to use now. + +We will asume, that the global zone has to interfaces with the following setup + +* bge0 -> 192.168.4.1/24 +* bge1 -> 192.168.5.1/24 + +configure ipnat +=============== + +With `ipnat` installed, we need to write a small configuration. For this example, we set up routing for every machine in the subnet. + +For that, open the file `/etc/ipf/ipnat.conf` and write the following lines: + + map bge0 192.168.5.0/24 -> 0/32 portmap tcp/udp auto + map bge0 192.168.5.0/24 -> 0/32 + +These two lines say, that all packages from the subnet to the rest shall be relabeled and forwarded. + +After that, all we need to do is enable the ipfilter and the routing deamons with the following commands. + + # svcadm enable ipfilter + # routeadm -e ipv4-forwarding + # routeadm -e ipv4-routing + # routeadm -u + +The last command checks if all deamons are running according to the settings. To see, which settings are set and what the deamons are doing, run the `routeadm` command without any arguments. + +configure the zone +================== + +Now we fire up the zone to test, if we can get anywhere near routing. In our case, the zone only has one interface, so that it detects the router itself per icmp. + +We can prove that very easy with + + # netstat -rn + +The default gateway should point to our global zone. To make a last test, you can ping an ip in another subnet. If the global zone says, this host is alive, the zone should do too. + +A good IP to test is 8.8.8.8, as it is really easy to remember. + +That was all. Have fun with your access + +links and hints +=============== + +You can get some more documentation to ipfilter and routing in the man pages of ipnat, ipf and routeadm. Some example rule sets for ipf can be found in `/usr/share/ipfilter/examples/nat.eg`. + +* [a rough setup of routing](http://blog.kevinvandervlist.nl/2011/06/openindiana-zone-with-nat/) +* [NAT on solaris](http://www.rite-group.com/rich/solaris_nat.html) diff --git a/content/post/74.md b/content/post/74.md new file mode 100644 index 0000000..1c89b53 --- /dev/null +++ b/content/post/74.md @@ -0,0 +1,97 @@ ++++ +title = "openindiana - how to configure a zone" +date = "2011-10-29T15:14:16+00:00" +author = "Gibheer" +draft = false ++++ + +In this short post, we will get a container running on a openindiana host. We will do some things in crossbow, but of the following stuff is just configuring the zone. At the end of this blog post, you will find some links to related pages. + +some preparations +================= + +Make sure, that you have a free vnic created with dladm to use in the zone or else, we will have no network available. Further, we need a place on the filesystem, where our zone can be created. We need 500MB to 1.5GB of free space. + +writing a zone configuration +============================ + +In the first step, we have to write a zone configuration. You can use zonecfg directly, but it's better to write it into a textfile and let zonecfg read that file. That way, you can check the configuration into a vcs of your choice. + +The config should look like this. + + create -b + set zonepath=/zones/zone1 + set ip-type=exclusive + set autoboot=false + add net + set physical=zone1 + end + commit + +With this configuration, we build a zone, which get's saved in `/zones`. `/zones` has to be a zfs partition or else the zone can not be created. + +The sixth line sets the network device for the zone to the vnic `zone1`. + +Now we feed the file to zonecfg and let it create *zone1*. + + # zonecfg -z zone1 -f zone1.conf + + +installation of the zone +======================== + +The next step is to install the zone with the command: + + # zoneadm -z zone1 install + +or clone it from a template with + + # zoneadm -z zone1 clone template_name + +Now we have to wait a bit and can write the next configuration file. + +writing a sysidcfg +================== + +I wrote a rough post about the [sysidcfg](http://zero-knowledge.org/post/72) already, so take a look there, if you are interested in further details. + +For this example, we use the following content. + + name_service=NONE + nfs4_domain=dynamic + terminal=xterms + # the password is foobar + root_password=0WMBUdFzAu6qU + security_policy=NONE + network_interface=zone1 { + primary + hostname=zone1 + default_route=NONE + ip_address=192.168.5.3 + netmask=255.255.255.0 + protocol_ipv6=no + } + + +booting the zone +================ + +When the installation process has ended, copy the file to `/zones/zone1/root/etc/sysidcfg`. This way, the zone can read the file on the first boot and set most of the stuff. + + # zoneadm -z zone1 boot + +To check if everything gets configured, log into the zone and check the output. + + # zlogin -e ! -C zone1 + +It will take some time until the zone is ready to use, but it should not ask for further details. When the prompt shows, the configuration completed. + +Now you can login into the zone and make further adjustments. Some topics will get their own blog entries here, so take a look at the other entries for help too. + +links +===== + +Here are some links for further details to this topic: + +* [crossbow example from c0t0d0s0](http://www.c0t0d0s0.org/archives/5355-Upcoming-Solaris-Features-Crossbow-Part-1-Virtualisation.html) +* [howto sysidcfg](http://zero-knowledge.org/post/72) diff --git a/content/post/75.md b/content/post/75.md new file mode 100644 index 0000000..7006ab2 --- /dev/null +++ b/content/post/75.md @@ -0,0 +1,12 @@ ++++ +title = "openindiana - ntpd does not start" +date = "2011-10-30T19:58:24+00:00" +author = "Gibheer" +draft = true ++++ + +Here comes a small hint for everybody else, who wants to run a ntp server in a zone: It does not work! + +The reason for that is, that ntp needs access to the time facility of the kernel. But only global zones are allowed to access this part of the kernel. But don't worry, you don't need a ntp client on the zones, as they get their time information from the global zone. + +That cost me about 4 hours to find out. I hope, this could save you some time. diff --git a/content/post/76.md b/content/post/76.md new file mode 100644 index 0000000..274c98c --- /dev/null +++ b/content/post/76.md @@ -0,0 +1,8 @@ ++++ +title = "great resource to ipfilter" +date = "2011-11-05T03:43:41+00:00" +author = "Gibheer" +draft = false ++++ + +In the need of a resource about `ipnat`/`ipfilter` I found [http://obfuscation.org/ipf/ipf-howto.html](http://www.obfuscation.org/ipf/ipf-howto.html). `ipfilter` is a packet filter running on Solaris and illumos distributions. diff --git a/content/post/77.md b/content/post/77.md new file mode 100644 index 0000000..1d59848 --- /dev/null +++ b/content/post/77.md @@ -0,0 +1,137 @@ ++++ +title = "openindiana - set up ssh with kerberos authentication" +date = "2011-11-12T21:45:01+00:00" +author = "Gibheer" +draft = false ++++ + +This time, we will build a base kerberos setup. At the end, you will be able to login into another machine using kerberos only. + +You need the following things, to make kerberos work: + +* a working dns server +* 2 servers + +I will explain this setup on an openindiana system with 2 zones. `kerberosp1` will be my kerberos machine and `sshp1` will be my ssh server with kerberos support. + +setup of kerberos +================= + +The setup of kerberos was pretty easy, after reading 3 tutorials about it. The essential part here is to decide, how the realm and the admin account should be called. + +To start the setup, call `kdcmgr`. At first, it asks your realm, which you should name like your domain. +After that, you have to generate an admin principal.A principal is like an account for a user or admin. But it's also used for services. I named mine `kerberosp1/admin`. Give it a safe password and you are done. + +Now you should have an populated `/etc/krb5/` directory. Open the file `kdc.conf` in that directory and search for `max_life`. It was set to 8 hours for me, which was too long. Adjust the value to 4h or 16h, like you want. I did the same with `max_renewable_life`. + +Edit: You should add the following option in the realms section to your realm. + + kpasswd_protocol = SET_CHANGE + +Kerberos uses a separate protocol for changing the password of principals. A RPC like protocol is used in the solaris version and microsoft has another one too. So the only option compatible on all is `SET_CHANGE`. But to make things worse, the solaris default does not even work in an internal network. So just add this entry and save some stress from trying to find out, why this is not working. + +setting up some accounts +======================== + +To use the kerberos service, check first, if the kdc is running and start it, if it's not. For openindiana, the check is + +`svcs krb5kdc` + +which should return online. + +After that, as root start the kerberos shell with `kadmin.local`. This is a management shell to create, delete and modify principals. +Here we are going to create some policies. With these, we can set some minimal standards, like the minimum password length. + +I created three policies. An `admin`, `user` and a `service` policy. These got the following settings: + +* admin + * minlength 8 + * minclasses 3 +* user + * minlength 8 + * minclasses 2 +* service + * minlength 12 + * minclasses 4 + +This sets some password limitations for every principal group I have. `minclasses` is used for different types of characters. There are lower case, upper case, numbers, punctation and other characters. +The create a new policy use the command `addpol` or `add_policy` with `-minlength` and `-minclasses`. You can simply type the command to get some help or read the man page. + +After creating the policies, we have to create some principals. First, we should create one for ourselves. You can do this with the command `addprinc` or `add_principal`. Give it a policy with the argument `-policy` and a name. You will have to input a password for this principal according to the policies. + +You can use this scheme to create user accounts too. For that, you can generate a password for them with the program `pwgen`. It's pretty helpful and can generate pretty complex passwords, so that should be best. + +Now we need a principal for our ssh server. The name of this principal should be `host/name_of_service.your.domain.name`, so in my case, it is `host/sshp1.prod.lan`. But I did not want to generate any password and added the argument `-randkey` which generates a password according to the policies we set. + +Now we have to export the key of the last principal into a keytab file, that can be read by the service, which wants to use it. This is done with the command `ktadd` like this + +`ktadd -k /etc/krb5.keytab host/sshp1.prod.lan` + +This generates our file in /etc/krb5.keytab. Copy this file into the kerberos directory (on openindiana it's `/etc/krb5/`) and delete the one on the kerberos host. This is important, as another execution of ktadd will append the next key to that file. + +setting up ssh +============== + +For making ssh work with kerberos, we need `/etc/krb5/krb5.conf` and `/etc/krb5/krb5.keytab`. In the step before, we already moved the `krb5.keytab`. We can copy the `krb5.conf` from the kerberos server to the ssh server. + +Now you can start the ssh deamon. + +try to log in +============= + +For the test, we will try to connect to the ssh host from the kerberos host. So start a shell on the kerberos server and type `kinit`. This should ask for your password. If it was correct, `klist` should show you, that you have been granted a ticket. + +Now try to open a ssh session to the server, with `-v` set for more informations and it should work. + +problems that can occur +======================= + +no default realm +---------------- + +The is the message + + kinit(v5): Configuration file does not specify default realm when parsing name gibheer + +which hints, that your `/etc/krb5/krb5.conf` is missing. + +client/principal not found +-------------------------- + +The message + + kinit(v5): Client 'foo@PROD.LAN' not found in Kerberos database while getting initial credentials + +is a hint, that you forgot to add the principal or that your username could not be found. Just add the principal with `kadmin` and it should work. + +ssh does not use kerberos +------------------------- + +If ssh does not want to use kerberos at all, check for the GSSAPI options. These should be enabled by default, but can be disabled. If that's the case, add the following line to your `sshd_config`. + + GSSAPIAuthentication yes + +After a restart, ssh should use kerberos for authentication. + +links +===== + +* [setup of kerberos on opensolaris](http://www.linuxtopia.org/online_books/opensolaris_2008/SYSADV6/html/setup-148.html) +* [MIT kerberos page](http://web.mit.edu/kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-admin/krb5_002econf.html) +* [KDC Setup on Solaris](http://wiki.creatica.org/cgi-bin/wiki.pl/Kerberos_KDC_server_on_Solaris) +* [Kerberos password](http://fnal.gov/docs/strongauth/princ_pw.html#46115) +* [Kerberos policies](http://pig.made-it.com/kerberos-policy.html) +* [Administrative Guide to Kerberos](http://techpubs.spinlocksolutions.com/dklar/kerberos.html#err_server_not_found) + +one last word +============= + +I have one last word for you: Kerberos does not do authorization! + +That means, that kerberos can not say, if one principal is allowed to use a service or not. It just manages the authentication for you. +If you want to manage the access, there are some possibilities for that. One is to use ldap, often used in conjunction with kerberos. Or you manage the `passwd` files or any other file yourself or you use a service like [chef](http://wiki.opscode.com/display/chef/Home) or [puppet](http://puppetlabs.com/). + +changelog +========= + +* added some explanation to `kpasswd_protocol` diff --git a/content/post/78.md b/content/post/78.md new file mode 100644 index 0000000..fcd6ba5 --- /dev/null +++ b/content/post/78.md @@ -0,0 +1,17 @@ ++++ +title = "openindiana - curl CA failure" +date = "2011-11-14T19:09:54+00:00" +author = "Gibheer" +draft = false ++++ + +There is a bug in openindiana that does not let you get the content of a page with curl, when it's secured with ssl. The cause of this is an option set on compile time. This option is the the path to the certificate storage. +In the case of openindiana this is set to `/etc/curl/curlCA`, but all certificates reside in `/etc/certs/CA/`. This leads to the following error message, when you try it: + + curl: (77) error setting certificate verify locations + +To fix this, run the following script. + + mkdir /etc/curl && cat /etc/certs/CA/*.pem > /etc/curl/curlCA + +This writes all certificates of the default CA in the file curl is looking for and after that, it works. diff --git a/content/post/79.md b/content/post/79.md new file mode 100644 index 0000000..f05a7c0 --- /dev/null +++ b/content/post/79.md @@ -0,0 +1,99 @@ ++++ +title = "openindiana - getting rubinius to work" +date = "2011-11-14T21:39:48+00:00" +author = "Gibheer" +draft = true ++++ + +Hey there! This time, we will get rubinius running on openindiana. As there is not package for llvm yet, it get's compiled within the build. + +I got it this far because of crsd. He told me how to get llvm running, so that we could get rubinius to compile. +After that [dbussink](https://twitter.com/#!/dbussink) got rbx to compile within two days! He found some really strange things, but in the end, rubinius can run on a solaris platform! + +requirements +============ + +But first, you have to fulfill some requirements. First you have to add the sfe publisher to get the gcc4. +You can do that with the command + + pkg set-publisher -O http://pkg.openindiana.org/sfe sfe + +After that install the following packages + +* developer/gcc-3 +* system/header +* system/library/math/header-math +* gnu-tar +* gnu-make +* gnu-binutils +* gnu-coreutils +* gnu-findutils +* gnu-diffutils +* gnu-grep +* gnu-patch +* gnu-sed +* gawk +* gnu-m4 +* bison +* git + +Yeah, that's alot of gnu, but we need it to get everything going. The cause of this are the old versions of solaris software, which do not support many features. The default compiler is even gcc 3.4.3! + +After you have installed these packages, install the following package from sfe. + +* runtime/gcc + +The order is important, as gcc3 and gcc4 set symlinks in /usr/bin. If you install them in another order, the symlink is not correct and you end up having a lot of work. + +some patching +============= + +After that, we have to fix a small bug in gcc with editing the file `/usr/include/spawn.h`. + + 73,76d72 + < #ifdef __cplusplus + < char *const *_RESTRICT_KYWD argv, + < char *const *_RESTRICT_KYWD envp); + < #else + 79d74 + < #endif + 86,89d80 + < #ifdef __cplusplus + < char *const *_RESTRICT_KYWD argv, + < char *const *_RESTRICT_KYWD envp); + < #else + 92d82 + < #endif + +This fixes a bug in gcc with [the __restrict key word](http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49347). + +fix the path +============ + +Now that we installed and fix a bunch of things, we need to include the gnu path into our own. Use the following command to get this done + + export PATH="/usr/gnu/bin:$PATH" + +Yes, it needs to be at the first place or else one of the old solaris binaries get's chosen and then, nothing works and produces weired errors. + +getting rbx to compile +====================== + +with an own build +----------------- + +If you want to build rbx yourself, get the code from [https://github.com/rubinius/rubinius.git](https://github.com/rubinius/rubinius.git). After that, configure and rake and everything should be fine. + +with rvm +--------- + +If you want to get it working with rvm, install rvm like normal. After that you can simply install rbx with + + rvm install rbx + +That's all you need. + +conclusion +========== + +After dbussink fixed all the errors, rbx compiles fine, when the toolchain is there. To get to this point was not easy, but we did it. So have a lot of fun with hacking on and using rubinius! diff --git a/content/post/8.md b/content/post/8.md new file mode 100644 index 0000000..094e58b --- /dev/null +++ b/content/post/8.md @@ -0,0 +1,42 @@ ++++ +title = "Rack und XMMS2" +date = "2009-06-17T22:13:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich hab heute mal ein kleines bischen mit Rack und Ruby rumgespielt und +dabei ist ein kleines Script rausgekommen, mit dem es möglich ist, XMMS2 +per Weboberfläche zu steuern. + +Es ist keineswegs komplett oder wirklich benutzbar, aber dafür hab ich +das auch in irb zusammen geschrieben und war nach 2h fertig + +\ +require ‘rubygems’\ +require ‘rack’\ +require ‘xmmsclient’ + +\$xmms2 = Xmms::Client.new ‘rackclient’\ +\$xmms2.connect ‘path-to-ipc’ + +Rack::Handler::WEBrick.run lambda {|env|\ + body = “\”\ + if env[‘PATH\_INFO’] == ‘/next’\ + \$xmms2.playlist\_set\_next\_rel(1).wait.value\ + \$xmms2.playback\_tickle.wait\ + sleep 0.3\ + end\ + mediaentry = \$xmms2.medialib\_get\_info(\ + \$xmms2.playback\_current\_id.wait.value\ + ).wait.value\ + body \<\< “\#{\ + mediaentry[:artist][:”plugin/vorbis“]\ + } - \#{\ + mediaentry[:title][:”plugin/vorbis“]\ + }”\ + body \<\< ‘
naechster’\ + body \<\< ‘\
’\ + [200, {’Content-Type’ =\> ‘text/html’}, body]\ +}, :Port =\> 8080\ + diff --git a/content/post/80.md b/content/post/80.md new file mode 100644 index 0000000..dbc9b3d --- /dev/null +++ b/content/post/80.md @@ -0,0 +1,22 @@ ++++ +title = "find cycle detected" +date = "2011-11-22T19:31:29+00:00" +author = "Gibheer" +draft = false ++++ + +If you encounter the following error with `make install` + + find: cycle detected for /lib/secure/32/ + find: cycle detected for /lib/crypto/32/ + find: cycle detected for /lib/32/ + find: cycle detected for /usr/lib/elfedit/32/ + find: cycle detected for /usr/lib/secure/32/ + find: cycle detected for /usr/lib/link_audit/32/ + find: cycle detected for /usr/lib/lwp/32/ + find: cycle detected for /usr/lib/locale/en_US.UTF-8/32/ + find: cycle detected for /usr/lib/locale/en_US.UTF-8/LO_LTYPE/32/ + find: cycle detected for /usr/lib/locale/en_US.UTF-8/LC_CTYPE/32/ + find: cycle detected for /usr/lib/32/ + +use `ginstall` in your Makefile instead of `install`. It seems just broken on solaris. diff --git a/content/post/81.md b/content/post/81.md new file mode 100644 index 0000000..8e86406 --- /dev/null +++ b/content/post/81.md @@ -0,0 +1,51 @@ ++++ +title = "Lustige Gehversuche mit... verschlüsselten Festplatten" +date = "2012-01-19T14:54:02+00:00" +author = "Stormwind" +draft = true ++++ + +**Hallo ihr,** + +mein letztes System hat also über zwei Jahre gehalten. Ihr werdet euch +vielleicht (noch/nicht) erinnern an:\ +http://zero-knowledge.org/post/25 + +Nun brachten mit die (un)glücklichen Umstände eines sterbenden +Monitorkabels dazu mein geliebtes Hermelin gegen die Grinsekatze +auszutauschen. + +Der bedeutendste Unterschied zwischen den beiden ist eine Zahl… genauer +gesagt eine 2. + +Während Hermelin ein ThinkPad X60 Tablet war, welches einen Intel Core +Duo als Prozessor hatte, hat die Grinsekatze als ThinkPad X61 Tablet +einen Intel Core 2 Duo. + +Was mir natürlich den Sprung von 32 auf 64bit erlaubt. + +Und ein paar tolle andere Extras, wie zum Beispiel dass ich den RAM +nicht nur auf maximal 3 GB sondern gleich auf 8 GB aufrüsten konnte. +(Tja, theoretisch könnte auch ein 32bit Linux mehr Speicher verwalten, +jedoch ist der Chipsatz von Hermelin nicht dazu in der Lage mehr zu +verwalten.) + +Um den Sprung auf die 64bit machen zu können, muss jedoch das System neu +installiert werden. Dies bot mir eine passende Gelegenheit einmal Bilanz +zu ziehen. + +**BTRFS** + +Mein altes System lief mit BTRFS als Dateisystem. Und das erstaunlich +Stabil, ich konnte auf jeden Fall keinen Datenverlust feststellen. + +Allerdings habe ich alle Vorteile, die das System bringen könnte +irgendwie gar nicht genutzt. Was vielleicht auch daran lag, dass ich +angst hatte, dass etwas Explodiert, wenn ich einen Snapshot erstelle +oder wenn ich versuche während der Laufzeit meine home-Partition zu +erweitern. + +Insofern war es lustig, weil es so exotisch war, mehr aber leider auch +nicht. + +**Und jetzt neu…** diff --git a/content/post/82.md b/content/post/82.md new file mode 100644 index 0000000..6b53729 --- /dev/null +++ b/content/post/82.md @@ -0,0 +1,25 @@ ++++ +title = "archlinux + rubygems = gem executables will not run" +date = "2012-03-31T08:31:55+00:00" +author = "Gibheer" +draft = false ++++ + +Two weeks ago, I had a problem with installing rubygems on my laptop. Yesterday, another person had the same problem, so I will document what is wrong here. + +The problem itself manifests in the way, that it installs gems with the error message + + WARNING: You don't have /home/steven/.gem/rbx/1.8/bin in your PATH, + gem executables will not run. + +If you then want to use the binary provided with the gem, it will not work and it happens with all ruby versions, be it rubinius, jruby or 1.9. What makes it worse is the fact, that it only occurs on archlinux installations, till now. And it is not a problem of rvm! + +So if you are on archlinux, look into `/etc/gemrc`. There will be a line saying + + gemrc: --user-install + +To solve the problem, create a file `~/.gemrc` and put the line + + gemrc: + +in it. By doing that, the file `/etc/gemrc` will be ignored. And if you are manipulating that file, look into [all the other options](http://docs.rubygems.org/read/chapter/11) you can set. diff --git a/content/post/83.md b/content/post/83.md new file mode 100644 index 0000000..f4fee88 --- /dev/null +++ b/content/post/83.md @@ -0,0 +1,91 @@ ++++ +title = "the Illumos eco system" +date = "2012-04-11T08:15:05+00:00" +author = "Gibheer" +draft = false ++++ + +After my openindiana server is already running for 4 months straight, I thought, I write a bit about the ecosystem of Illumos and its state. + +Illumos ecosystem +================= + +Illumos is the base system of which every distribution uses. It's more or less +the base system, like FreeBSD. With Solaris 11 being the original OpenSolaris, +Illumos is a fork of what was open source of OpenSolaris in 2010. + +The development on Illumos is pretty active and at the moment, there is no merge with the Solaris code base planned. Oracle distributed code after the Solaris 11 release, but it was mostly code which had to be distributed either way. So there were no updates on kernel or ZFS code. + +This has a huge impact on the future development of Illumos as everything has to be developed by contributors like Joyent, Nexenta and others. But it also has implications for most of the core features of Solaris, the most important ZFS. These are already noticeable with Solaris 11 having ZFS version 31 and FreeBSD and Illumos having version 28. This means, that neither FreeBSD nor Illumos can do something with a zpool created on a Solaris 11. This already makes a switch from one system to another difficult. + +But nevertheless the contributors to Illumos work to make it better. The largest part at the moment is to get Illumos compiling with GCC 4.6.1. At the first look, it seems like a minor problem, but OpenSolaris was not written to be built with GCC but with the proprietary SunStudio. As far as I could see, this has some major implications and raised huge holes in the code, which has to get fixed. +With that the base system is also upgraded from older versions of Perl and python, which also will be a longer process. + +Another huge part is the process of building packages. Solaris 10 and older used the SVR4 format. That was pretty simple and looked like rpm. OpenSolaris introduced a new format named IPS - Image Packaging System. This is also compatible with the SVR4 format. OpenSolaris had a pretty big infrastructure for building IPS packages, but it was lost when oracle acquired sun and shut it down. +The problem now is, how to build new packages. Some are using SVR4 to build the IPS packages, which works good and the repository already has a bunch of newer releases of many projects. +Another attempt was to use pkgsrc. This is a project of NetBSD and already supports Solaris. This attempt died pretty fast. They were not used like FreeBSD ports and also not for compiling the packages. +The third approach is to build a packing system on top of dpkg/apt. It is a collaboration between Nexenta, OpenIndiana and others. There is also a plan to build a new distribution out of it - named illumian. + +One major difference between Solaris 11 and Illumos is that Illumos has KVM. It got ported from Linux by Joyent and works pretty good. With this step, Illumos not only had Zones for virtualization but also a full virtualization to get Linux running. + +distribution ecosystem +====================== + +There are a bunch of distributions out there, trying to solve different problems. + +[Solaris 11 - the first cloud os][solaris11] +---------- + +Not so much a distribution of Illumos, but of the old OpenSolaris. Solaris 11 is a pretty good allround distribution. It is used from small systems to huge ones, running one application or some hundred on one machine. Some use it for storage and others to virtualize the hell out of it with zones and crossbow. + +[OpenIndiana - open source and enterprise][openindiana] +----------- + +OpenIndiana was one of the first distributions using the Illumos core. It is available as a server distribution and a desktop one. The server one is targeted for the same usage as Solaris 11. As OpenIndiana uses Illumos it also has support for KVM and therefore can be used as a platform to host many fully virtualized instances on top of ZFS and crossbow infrastructure. + +A problem at the moment is the pretty old software it offers. Most of the packages are from OpenSolaris and therefore nearly 2 years old. Most of them don't even get security patches. The reason for that is the packaging topic mentioned above. As long as they don't have a strategy, nothing will change here. The only option is to use the sfe repo at the moment. + +This may change in the future, because of the joint effort with Nexenta of packaging releases. + +OpenIndiana also has a desktop part which is targeted at ubuntu users wanting ZFS and time machine. As I used OpenSolaris already on a laptop I can only say "Yes, it works". But you have to decide yourself, if you can live with pretty old but stable software. And many projects are not even available in package form, so that one would have to compile it yourself. + +[Nexenta - enterprise storage for everyone][nexenta] +------- + +Nexenta is another distribution who switched to Illumos core pretty fast. It is intended to be used for storage systems, but can also be used for other kinds of servers. It also uses the debian package system and a gnu userland. It is available as a community edition and "enterprise" edition. + +The packages are a bit more up to date than the OpenIndiana ones. With the combined effort of both projects, they may keep closer to the actual releases. + +[illumian - illumos + debian package management][illumian] +-------- + +Illumian is a new project and collaboration work between Nexenta and OpenIndiana. It will provide packages through the debian package management dpkg/apt. The target audience seems to be the same as OpenIndiana. The plan at the moment is to release all packages in the same version as in OpenIndiana, so that the ultimate choice will just be, if you want to use dpkg or IPS. + +[SmartOS - the complete modern operating system][smartos] +------- + +This is not so much a distribution as a live image. Its purpose is to use all disks in the server to create a zpool and use that to provide storage for virtual machines, be it zones or KVM instances. The KVM instances are also put into zones to attach dtrace to the virtual instances to see, what's going on in that instance. +SmartOS offers also pretty nice wrappers around the VM operating to get new instances up fast. + +The company behind SmartOS is Joyent, more known for building node.js. They use SmartOS as the central pillar of their own JoyentCloud, where they host node.js applications, databases and also Linux machines. + +[omnios][omnios] +------ + +OmniOS is a very new distribution and from OmniIT. It offers not much at the moment apart from an ISO image and a small wiki. +It is intended to be used much like FreeBSD. They provide a very stripped down Illumos core with updated packages as far as possible and nothing more. Every other package one might need has to be built and distributed through a package repository. The reason behind this is, that they only want to provide the basic image, which everybody needs, but not the packages needed only by themselves. And even these packages may be one or two versions behind. +And let me tell you - the packages they already updated may be considered bleeding edge by many debian stable users. + +What next? +========== + +This was the excursion into the world of Illumos based distributions. I myself will switch away from OpenIndiana. It's great, that Illumos lives and breathes more than 4 months ago, but there is much work left to do. SmartOS had a huge impact for me and others and Joyent and Nexenta do great work on improving the Ecosystem. +But it will be hard to get back to the times where OpenSolaris was. Too much time went by unused. But I'm looking forward what else might come up of Illumos land. + +[solaris11]: http://www.oracle.com/us/products/servers-storage/solaris/solaris11/overview/index.html "Solaris 11" +[illumos]: http://illumos.org/ "the illumos project" +[openindiana]: http://openindiana.org/ "OpenIndiana" +[smartos]: http://smartos.org/ "SmartOS - the complete modern operating system" +[illumian]: http://illumian.org/ "illumian" +[nexenta]: http://nexentastor.org/ "Nexenta - the storage platform" +[omnios]: http://omnios.omniti.com "OmniOS from OmniTI" diff --git a/content/post/84.md b/content/post/84.md new file mode 100644 index 0000000..7067449 --- /dev/null +++ b/content/post/84.md @@ -0,0 +1,22 @@ ++++ +title = "Backups with ZFS over the wire" +date = "2012-04-12T21:22:47+00:00" +author = "Gibheer" +draft = false ++++ + +Okay, let's say you are a proud owner of a system and use ZFS. Now lets assume that you lost a disk from your storage and want a fast backup of your data without the hassle of packing up everything, checking for permissions and so on. If the target system has ZFS too, then this will be fun for you, because I will show you, how to make a backup of a ZFS partition and all its descendants in some small steps. + +First, you have to build a recursive snapshot for the backup. This can be done with + + zfs snapshot -r tank/testpartition@backup-today + +After that the real magic happens. We send this snapshot over ssh and import it on the other side. + + zfs send -R tank/testpartition@backup-today | ssh target.machine "zfs recv -u tank/backup-machine" + +Now all partitions from =tank/testpartition= will be put in =tank/backup-machine= and everything will be preserved. Links will be links, permissions will be the same. The flag =-u= is to prevent mounting the partitions on the target machine or else all partitions will be mounted as they were before. + +As this sends the complete dataset over the wire, it is not that usable for backups every day. For this use case, use incremental sends (with the option =-i=). On the receiving side, nothing changes. + +Thanks at this point to [shl](http://blogs.interdose.com/sebastian/) for showing me ZFS. diff --git a/content/post/85.md b/content/post/85.md new file mode 100644 index 0000000..2d65fc8 --- /dev/null +++ b/content/post/85.md @@ -0,0 +1,34 @@ ++++ +title = "Schwarze Seelen brauchen bunte Socken 2012.1" +date = "2012-04-15T16:40:02+00:00" +author = "Stormwind" +draft = false ++++ + +Hallo ihr, +========== + + +da habe ich es doch tatsächlich völlig verschwitzt letztes Jahr auch von dem Wollfest in Nierstein zu berichten. Also habe ich nun kurz entschlossen die Nummerierung etwas angepasst. + +Dieses Jahr bin ich schon ganz früh dran mit Wollfesten. (Im Übrigen nicht zu verwechseln mit dem bösen Wollfasten.) +In Backnang fand nämlich vorgestern und gestern das [2. Backnanger Wollfest](http://www.backnanger-wollfest.de/) statt und an dem Samstag war ich dann auch dabei. + +
+Wollbeute Teil 1

+
+ +Somit konnte ich meine schon vorhandenen Wollvorräten mit noch mehr Wolle weiter aufstocken, wie man auf den Bildern unschwer erkennen kann. +Aus dem Hause Zitron gibt es jetzt ein tolles 4-fach Sockengarn, was aus zwei normalen weißen und zwei schon vorgefärbt schwarzen Fäden besteht, was bedeutet, dass es jetzt auch wunderschön dunkle Sockenwolle vom Wolldrachen gibt, die nicht zum Teil komplett Schwarz sein muss. War ja klar, dass ich mir da wieder zwei Stränge unter den Nagel reißen musste. + +Auch sehr schön, die beiden Kammzüge aus Seide einmal in grün und einmal in orange aus 100% Tussah Seide. (Ich schmachte dahin, es ist so wundervoll weich.) Da habe ich auch schon eine Idee was es werden soll, jetzt müsste es also nur noch versponnen und verzwirnt werden. Aber dazu fehlt mir noch den Faden, den ich zum verzwirnen benutzen möchte, den habe ich aber schon bestellt. Jetzt muss er nur noch hier ankommen. Ihr dürft also gespannt sein. Und ich bin es auch, obs am Ende so wird, wie ich das möchte. +Ich habe auch noch zwei weitere Kammzüge mitgebracht, allerdings sieht man den zweiten auf dem Foto nicht, da er schon zu 50% meinem Spinnrad zum Opfer gefallen ist. + +
+Wollbeute Teil 2 +
+ +Und auch meinen Kater habe ich eine Freude gemacht, weil er nun einen neuen - wenngleich auch toten - Freund hat. Das Schaffell, was man im Hintergrund der Bilder sieht. Wobei er sich erst noch ein Bisschen daran gewöhnen muss. Ich glaube er hat vorher noch nie ein Fell gesehen und fand es erstmal gruselig bis er endlich einen Fuß bzw. Pfote darauf gesetzt hat. + +Bis denne, +Stormwind diff --git a/content/post/86.md b/content/post/86.md new file mode 100644 index 0000000..47718a0 --- /dev/null +++ b/content/post/86.md @@ -0,0 +1,14 @@ ++++ +title = "touchpad keeps scrolling" +date = "2012-04-20T17:49:06+00:00" +author = "Gibheer" +draft = false ++++ + +If you have synaptics and your application just keeps scrolling even after you stopped then put the following in your xorg.conf and it should stop that: + + Section "InputClass" + Option "CoastingSpeed" "0" + EndSection + +That should help. diff --git a/content/post/87.md b/content/post/87.md new file mode 100644 index 0000000..077a465 --- /dev/null +++ b/content/post/87.md @@ -0,0 +1,12 @@ ++++ +title = "extend PATH in Makefile" +date = "2012-06-02T20:48:18+00:00" +author = "Gibheer" +draft = false ++++ + +Whenever you have the need to "patch" the path in a Makefile, you can do that with the following line. + + PATH := $(PATH):/optional/path + +Use $(PATH) to get the PATH variable from the environment. `:=` is used to avoid circular dependencies in the form, that PATH gets reassigned over and over again. If you leave the colon, then make will inform you about this. diff --git a/content/post/88.md b/content/post/88.md new file mode 100644 index 0000000..670001e --- /dev/null +++ b/content/post/88.md @@ -0,0 +1,16 @@ ++++ +title = "create encrypted password for postgresql" +date = "2012-06-25T13:46:31+00:00" +author = "Gibheer" +draft = false ++++ + +If you ever have the need to generate an encrypted password to put it into scripts or anything else, then you can use the following SQL command to generate it: + + select 'md5'||md5('password'||'rolename'); + +or in shell + + echo -n 'passwordrolename' | md5sum | awk '{ print "md5" $1 }' + +Important is, that your rolename is appended to your password and this construct then put into md5. The important piece in the source is [pg_md5_encrypt()](http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/libpq/md5.c) diff --git a/content/post/89.md b/content/post/89.md new file mode 100644 index 0000000..97ef33f --- /dev/null +++ b/content/post/89.md @@ -0,0 +1,36 @@ ++++ +title = "Solaris SMF on linux with systemd" +date = "2012-07-26T07:48:30+00:00" +author = "Gibheer" +draft = true ++++ + +One of the nicer things on Solaris is SMF, the service management facility. It is a replacement for the SysV init system. It's major features were parallel starting of services, built in service dependencies and pretty good reporting functionality. It also could pretty exactly report, which service failed and what other services were failing over that one. So the dependencies worked in starting and stopping direction. +One of the worst parts of it was the horrible XML file you had to write for a service to work. I never found them very intuitive and too complex to "just" start and stop a service. + +It was a pretty good experience and I found it confusing on linux, that no init system was the same. On gentoo all init scripts have a status, only some have on debian. One has to take care of logging yourself and dependencies were either managed through a start order (in archlinux in /etc/rc.conf), by alphabetical order and runlevels (in gentoo) or they built their own system into the init scripts as comments (the debian way). + +Then came ubuntu und built their own init system named upstart. It is a bit between the old SysV init system as it uses init like script files but extended them for some further information, like when to start a service. But most of the file still is mostly script code and gets executed by a shell. +One of the largest change for old users is, that this system can't make use of `/etc/init.d/scriptname start` anymore. Instead you use `start service` or `stop service`. I think, this is a pretty good API and much better for new users to learn. +It can react on events to start and stop services and also can try to restart failed services. Services can also communicate with upstart over dbus. + +Systemd on the other hand is a very different to SysV. At first I was a bit skeptical because of all the negativity. But now I run 3 systems with systemd and till now, it feels good. These three systems are all archlinux boxes and there the migrations is very easy. You can take a look at the [wiki page][archlinux-wiki-systemd]. You can run systemd parallel to SysV init and start it with a parameter in grub. If you feel confident enough you can uninstall the old system and use only systemd in the future. + +So what exactly has systemd, what SysV is missing? + +It uses udev (or udev systemd?) pretty intensive, so that it can show you information about your hardware. +Another thing is, that it can start the daemons in parallel. This alone cut my boot time in half. But it is not that important to me. It was just a wow effect. +Next is the management of the service themselves. The command `systemctl` is the API to everything in systemd, so not as nice as upstart. But with just `systemctl` you already get an overview which services are currently loaded, running and which failed (here is a [gist of what it looks like][github-systemctl-output]). You can start and stop services with `systemctl start` or `systemctl stop` but this will make it not permanent. If you come from solaris and SMF you will find it confusing, as an _enable_ or _disable_ will activate and start the service, or disable and stop the service. But I found it pretty helpful when switchting from one thing to another and I just don't want to stop the service. +Think about switching the login manager. You may have installed the new one, enable it to start at boot time and disable the old one. Now you can still do other things and wait with the restart or you switch to the terminal and stop the old one and start the new one. I waited and did some configuration and afterwards, restarted the hole machine. Did not take me any longer than switching to the console. +Another feature is, that systemd has an included logger. For some it may be not a feature as they already use a configured syslog-ng and don't worry, you can still use it. The program is called journalctl and is bundled with systemd. Systemd starts every deamon within the logger context, so that every program does not have to worry about logging anymore but can just spout it onto STDOUT and systemd takes care of the rest. Yes, it sounds pretty retarded, but with it comes a pretty neat feature. If you now call `systemctl status service` you get an overview of the status of the service including the last couple log entries! As systemd builds automatic cgroups it can also show our the daemon dependencies. You can see how it looks like for [net-auto-wireless][github-systemctl-status] on my laptop. + +And I would say, that this is by far the best systemd could give me. If a service dies, I need to know all these things and this is the first system, which can show me. Not even SMF could do that. It would just tell me that my service died and others died of it as well, but it could not tell me exactly why or show me the logs. + +Yes, my machines all boot faster and I profit from it. I shut down my pcs now. But that is nothing in comparison to the context I get when looking at a service. I can only recommend for everyone to try systemd and look for yourself, if it may help you get your work done faster. + +At the moment fedora, Suse and Mandriva seem to be only one using systemd by default. There are other distributions having packages for them. From debian I know, that you [can't replace][debian-systemd] the SysV as easy as on archlinux. But it seems to work. There are already many service files out there for various daemons so it seems to get moving pretty fast. It will be interesting how fast it will be adopted by various distributions. + +[archlinux-wiki-systemd]: https://wiki.archlinux.org/index.php/Systemd +[github-systemctl-output]: https://gist.github.com/3180643#file_gistfile1.txt +[github-systemctl-status]: https://gist.github.com/3180643#file_systemctl_status_net_auto_wireless +[debian-systemd]: http://wiki.debian.org/systemd#Issue_.231:_sysvinit_vs._systemd-sysv diff --git a/content/post/9.md b/content/post/9.md new file mode 100644 index 0000000..80e7e0c --- /dev/null +++ b/content/post/9.md @@ -0,0 +1,110 @@ ++++ +title = "Was ist XMMS2?" +date = "2009-06-23T12:47:00+00:00" +author = "Gibheer" +draft = false ++++ + +Ich wurde gestern gefragt, was [XMMS2](http://xmms2.xmms.se) eigentlich +sein soll und warum ich ihn in meinem Beitrag über Rack und XMMS2 +benutzt habe. + +etwas Geschichte +================ + +Der alte XMMS, der seit einigen Jahren nicht mehr aktiv weiterentwickelt +wird, war der klassische Musikplayer. Er hatte ein Frontend, das an +Winamp erinnerte, konnte dessen Styles verwenden und hatte Unmengen an +Plugins. Irgendwann fanden sich andere Entwickler, die einen Nachbau von +XMMS begonnen hatten und nun unter dem Namen Audacious verfügbar +ist. Die gentoo-Entwickler gaben Audacious irgendwann den Vorzug und +XMMS verschwand aus dem Portage. + +Als der XMMS verschwunden war, probierte ich erstmal Audacious aus, der +zu dem Zeitpunkt allerdings viele Bugs hatte und bei weitem nicht an das +Vorbild heran kam. So konnte er nicht meinen kompletten Musikordner +laden, sondern schmierte zwischendurch einfach ab. + +Deswegen schaute ich mir mal an, was die XMMS-Entwickler eigentlich tun. +So ein großartiges Projekt stellt man ja nicht ohne weiteres ein, wenn +die Entwickler noch vorhanden sind. Und sie arbeiteten an XMMS2. + +Nachfolger +========== + +Als erstes Vorweg, XMMS2 ist kein Nachfolger des XMMS. Er sieht nicht +nur anders aus, auch die Funktionen unterscheiden sich teilweise +erheblich. + +XMMS2 ist eine komplette Neuentwicklung eines Musikplayers, der ein +anderes Konzept verfolgt. Denn anders als beim XMMS, steht die Ausgabe +und Verwaltung der Musik im Vordergrund. + +Dazu wurde der Player in eine Serverapplikation verlagert, die durch die +User gestartet werden muss. Sobald der Server einmal läuft, kann ueber +einen Client, auf den Server zugegriffen werden. + +Da sich aber, wie so oft, die Geschmaecker unterscheiden, gibt es bei +der Grundinstallation nur einen Konsolenclient dazu, der allerdings die +volle Funktionalität abdeckt. Weitere Clients können problemlos in fast +jeder beliebigen Sprache geschrieben werden. Es gibt Sprachanbindungen +fuer Java, Mono, Ruby, Python, Perl, C++ und einige weitere. Eine eigene +Sprachanbindung kann auch verwirklicht werden, so lang man die Library +in C schreiben kann, wie zum Beispiel bei TCL. + +Es gibt schon eine vielzahl von +[Clients](http://wiki.xmms2.xmms.se/wiki/Clients), die benutzt werden +koennen. Zudem gibt es Installationspakete in Debian, Ubuntu, Archlinux +und einigen anderen Distributionen. + +Der Vorteil der Serverarchitektur liegt fuer mich darin, dass ich den +Deamon starten kann, ohne dass ich unbedingt einen Client am laufen +haben muss, der die ganze Zeit in der Programmleiste herumlungert. Da +ich den Server über Konsole steuern kann und ich sowieso sehr viele +Konsolen offen habe, ist es für mich ein leichtes, den Player zu +bedienen. Ich habe mich auch über die Python-Bindings eine Anbindung +fuer X-Chat an XMMS2 geschrieben, um Leute mit meinem Lied zu nerven +oder XMMS2 zu bedienen. + +Neben den Anbindungen für die vielen Programmiersprachen, bietet XMMS2 +auch noch ein paar sehr nette Funktionen. So wird im Hintergrund eine +Mediendatenbank verwaltet, in der man schnell nach Informationen zu +Liedern suchen kann, wie zum Beispiel Artist, Songtitel, +Erscheinungsjahr usw. Diese Informationen werden aus den Dateien selbst +heraus gelesen. Das bedeutet, dass zusätzliche Informationen, wie sie +zum Beispiel bei ogg-files hinterlegt werden können, auch in der +Datenbank enthalten sind. + +Zusätzlich kann man die Daten der Lieder ändern, nach dem Suchen in die +Playlist laden und so weiter. + +XMMS2 bietet auch die Möglichkeit mehrere Playlists zu verwalten, ohne +jedoch immer wieder die Playlisten über pls-files zu laden. Diese sind, +im Falle des Konsolen Clients, einfach über den Namen erreichbar. + +Eine echte Neuerung finde ich allerdings die +[Collections](http://wiki.xmms2.xmms.se/wiki/Collections). Collections +sollen dazu dienen, die eigene Musik besser verwalten zu können. So ist +zum Beispiel denkbar, dass man allen Liedern bestimmte Keywords gibt und +diese so je nach Stimmungslage auswählen kann oder das sogar der Client +merkt, wie die Stimmung des Zuhörers ist und er anhand der Collections +passende Musik heraussucht. + +Ich bin leider noch nicht dazu gekommen, dieses Feature zu testen. +Deswegen weiß ich auch nicht, wie weit die Implementierung an dieser +Front ist. Wenn ich mal dazu komme, diese Funktion zu testen und ich ein +Ergebnis habe, werde ich das hier natürlich schreiben. + +Fazit +===== + +Der XMMS2 befindet sich immer noch in der Entwicklung, ist aber sehr gut +zu gebrauchen. Ich benutze seit über einem Jahr nur noch den XMMS2 und +bin vollauf zufrieden. Ich kann ihm eigentlich jedem Empfehlen, der +gerade auf der Suche nach einem neuen Player ist. Dabei ist es +eigentlich egal, ob ein Frontend von Nöten ist oder nicht, da es +durchaus schicke Frontends gibt. + +Und ihr seht ja selbst, wie schnell es geht, einen eigenen Client fuer +diesen Player zu schreiben. Versucht das mal mit einem anderen Player +;o) diff --git a/content/post/90.md b/content/post/90.md new file mode 100644 index 0000000..e382623 --- /dev/null +++ b/content/post/90.md @@ -0,0 +1,24 @@ ++++ +title = "rotate log files with logadm" +date = "2012-07-26T07:59:05+00:00" +author = "Gibheer" +draft = false ++++ + +To rotate logs on a Solaris system you have to configure logadm to do it. + +This is a small example on how it could look like for lighttpd. + +Execute the two following statements to create two log entries + + logadm -w /var/lighttpd/1.4/logs/access.log -p 1d -C 8 -a 'pkill -HUP lighttpd; true' + logadm -w /var/lighttpd/1.4/logs/error.log -p 1d -C 8 -a 'pkill -HUP lighttpd; true' + +After that, there should be two new entries in `/etc/logadm.conf` with all parameters you gave to logadm. The parameters mean, that the logs will be rotated once a day and 8 old logfiles will be stored. With every rotation lighttpd will be reloaded to use the new empty log file. For more parameters read the man page of logadm. there are also some nice examples at the bottom. + +To try it out and see if it runs, create enough log entries and then call logadm with the logfile. In this case it would be + + logadm /var/lighttpd/1.4/logs/access.log + logadm /var/lighttpd/1.4/logs/error.log + +After that, it should have created new log files and reloaded lighttpd. diff --git a/content/post/91.md b/content/post/91.md new file mode 100644 index 0000000..c97daf5 --- /dev/null +++ b/content/post/91.md @@ -0,0 +1,18 @@ ++++ +title = "automatic locking of the screen" +date = "2012-08-03T12:39:11+00:00" +author = "Gibheer" +draft = false ++++ + +After I switched everywhere to a tiling wm, I wondered how everybody else locks his screen. Sure, you can lock the screen with a keybinding, but what when you leave the pc for talking and then leave it be? + +The tool I found is [xautolock][xautolock] and works pretty good. After a configurable time span it starts the lock and after another time it can also start suspend, hibernate or whatever. I use it with the following settings: + + xautolock -locker slock -time 2 -killer "systemctl suspend" -killtime 10 & + +This starts slock, the simple locker, after two minutes and sends the pc into suspend after 10 minutes in activity. As it runs in the background, you can either start it through .xinitrc or with your wm of choice. + +To lock the screen by command, bind `xautolock -locknow` to your keys and it calls the deamon which then calls the locker. + +[xautolock]: http://freecode.com/projects/xautolock diff --git a/content/post/92.md b/content/post/92.md new file mode 100644 index 0000000..0dc268d --- /dev/null +++ b/content/post/92.md @@ -0,0 +1,94 @@ ++++ +title = "building a multi instance postgres systemd service" +date = "2012-09-28T11:00:00+00:00" +author = "Gibheer" +draft = false ++++ + +Just out of curiosity I tried to build a service for PostgreSQL and the systemd init system. Before that, I only read the service files of postgres and dhcp delivered with Archlinux. What I wanted to build is a service file able to start multiple instances of postgres with separate configuration files. + +This was much easier than I thought it would be. + +Systemd supports that pretty well and the only thing to do, is add an '@' to the service file name. Everything after '@' is then put into a variable `%I`, which can be used in the service file. So my service file was named 'pg@.service' and I put it into `/etc/systemd/system`. Another possible location is `/usr/lib/systemd/system/`. + +The service file looks like an `.ini` file. It has the three sections Unit, Service and Install. The section Install in which target the service is installed. Targets are like run levels in other init systems. The postgres service gets installed into the multi-user target, which is started after the network: + + [Install] + WantedBy=multi-user.target + +The next part is Unit. This section describes the service with a short description and a description of the dependencies. Postgres just needs the network up, so this section looks like this: + + [Unit] + Description=run PostgreSQL instance %I + After=network.target + +There you can also see the %I, which is replaced with the part after '@' from the name in systemd. + +The next section is a bit larger and describes everything needed to manage the service itself, like start, stop and reload. + + [Service] + User=postgres + Group=postgres + TimeoutSec=120 + Type=forking + + EnvironmentFile=/etc/conf.d/pg.%I + + SyslogIdentifier=postgres-%i + + ExecStartPre=/usr/bin/postgresql-check-db-dir ${pgdata} + ExecStart= /usr/bin/pg_ctl -s -D ${pgdata} start -w -t 120 + ExecReload=/usr/bin/pg_ctl -s -D ${pgdata} reload + ExecStop= /usr/bin/pg_ctl -s -D ${pgdata} stop -m fast + + OOMScoreAdjust=-200 + +Okay, this is a bit longer than the other parts. The first Couple of options handle the user to start with and he startup timeout. The timeout can't be replaced with a variable because all options from the config will be loaded as environment variables on execution. The Type option is very important, because it can't be set to anything else as forking for postgres, because it will fork to the background. So if you start it as a simple service systemd would loose the handler to postgres and stop it immediately. + +The next options are EnvironmentFile and SyslogIdentifier. The first is for a small config file in `/etc/conf.d/pg.instance` where you replace instance with the instance name. As you can see with the %I in place, it will fill up the full name with the instance identifier. So you can use different config files for different instances. The same happens to the SyslogIdentifier. I thought it would be awesome if the log can be showed per instance and this is what you need to make it happen. + +The option OOMScoreAdjust is just an option for the OOMKiller, that it should leave postgres alone as much as possible. + +The option ExecStartPre calls a script which is delivered with postgres on Archlinux and does a check for the data dir. If it does not exist, it will log a line on how to create it. Pretty neat. ExecStart, ExecStop and ExecReload describe the actions to be done, when the service should be started, stopped or reloaded. As you can see, the script uses `${pgdata}` to determine where to look and that variable comes from the EnvironmentFile, which looks for my first instance like this + + pgdata=/tmp/ins1 + +The file is saved as `/etc/conf.d/pg.ins1` and is really nothing more than this. The rest can handle postgres itself. + +Now how do we get the service file into systemd? You do a + + systemctl --system daemon-reload + +and then + + systemctl start pg@ins1.service + +This creates your first service and tries to start it. You will get an error message like the following + + Job for pg@ins1.service failed. See 'systemctl status pg@ins1.service' and 'journalctl' for details. + +If you run the status, you will see that it failed, how it failed and the log message from the check script. After that, you can create the instance and start it anew there it is. + + # systemctl status pg@ins1.service + pg@ins1.service - PostgreSQL database server + Loaded: loaded (/etc/systemd/system/pg@ins1.service; disabled) + Active: active (running) since Tue, 25 Sep 2012 09:27:54 +0200; 3 days ago + Process: 372 ExecStop=/usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast (code=exited, status=0/SUCCESS) + Process: 624 ExecStart=/usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120 (code=exited, status=0/SUCCESS) + Process: 619 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=0/SUCCESS) + Main PID: 627 (postgres) + CGroup: name=systemd:/system/postgresql.service + ├ 627 /usr/bin/postgres -D /var/lib/postgres/data + ├ 629 postgres: checkpointer process + ├ 630 postgres: writer process + ├ 631 postgres: wal writer process + ├ 632 postgres: autovacuum launcher process + └ 633 postgres: stats collector process + +Now if you want to see some logging, you can ask `journcalctl` and give it the log string. + + journcalctl SYSLOG_IDENTIFIER=postgres-instance1 + +That's all there is to multi instance services on syslog. To figure everything out actually took not even much time, as the documentation is pretty good. Just a hint, don't look in the web for documentation but in the man pages. The best starting point to look for documentation is `man systemd` and then take a look at the _SEE ALSO_ section. + +Have fun! diff --git a/content/post/93.md b/content/post/93.md new file mode 100644 index 0000000..9c48d0e --- /dev/null +++ b/content/post/93.md @@ -0,0 +1,53 @@ ++++ +title = "release of zero 0.1.0" +date = "2012-12-01T08:30:00+00:00" +author = "Gibheer" +draft = false ++++ + +Today we release a small project from me - [zero][zero-github] 0.1.0. + +It is aimed at being a toolkit for building web services. It is build around the idea of abstracting away what is tedious work and work with the information clearer. With that in mind, some modules are already included. These are the following. + +Request +------- + +This class provides an interface to information regarding the request and making them available grouped together in other parts. + +One example is the grouping of parameters in one attribute `request.params` which makes *get* and *post* parameters available separately. As many developers also regard URLs as some kind of parameters it is possible to define custom key/value pairs. + +Another example is the grouping of all accept headers under `#accept`, which makes accessing type information nice to read: `request.accept.types`. + +Response +-------- + +The response class helps in building responses in a easy way. It provides similar interface as the `Rack::Response`. It also does a small check already for status code correctness and will probably get more helpers in the future to set common headers and status codes. + +Router +------ + +Zero has a small router which takes routes and pushes the request to other applications. A similar implementation is Rack::URLMap, but this router is also able to extract variables from the URL and puts them into the Request. + +Renderer +-------- + +The renderer is a facility to render templates according to the accept type wanted by the client. That is possible by providing a map of short type names to the actual mimetypes which is then used internally to search for the right template. With this, developers have only to provide the template and mapping and then the rendering takes care of actually using it. + +The router does not take care of the actual method of the request. This can be done before the router with a small application defining routers for every possible method or working with the method in the applications called by the routers. + +Controller +---------- + +This component is still a "Work in Progress" but can already be used to glue all these parts together. It splits the work into two steps - processing the request and rendering the resulting data. If that workflow does not fit, it is also possible to extend or modify the controller to adapt other work flows. + +Status and Future of the toolset +-------------------------------- + +The idea is to make web service development easier than before and this is only the beginning of zero. The plan is to extend the toolkit with more modules and make all modules possibly available as stand alone modules. That way, zero can be used in other projects to replace parts or help in making developing easier. It is a Work in Progress at the moment but the results so far are very promising. + +We also have a [repository for example applications][zero-examples] and we will extend it with the time to show as many aspects of the toolkit as possible. + +If you are interested, checkout [zero on github][zero-github] or have a look at the [examples][zero-examples]. + +[zero-github]: https://github.com/Gibheer/zero +[zero-examples]: https://github.com/Gibheer/zero-examples diff --git a/content/post/94.md b/content/post/94.md new file mode 100644 index 0000000..1b4e2e9 --- /dev/null +++ b/content/post/94.md @@ -0,0 +1,64 @@ ++++ +title = "inner and natural joins" +date = "2012-12-05T21:01:29+00:00" +author = "Gibheer" +draft = false ++++ + +Today someone told me about natural and inner joins. As I'm using SQL for many years already, I was a bit puzzled at first. I heard of the terms, but thought till now, that they were meaning the same. + +The first thing I did was looking in the [PostgreSQL documentation][pg-doc] and yes, they are not the same. But they are also the same. + +The inner join is the default for doing joins. It just joins two tables using the on clause. + + # select * + from tableA A + join tableB B + on A.id = B.id; + + | a.id | b.id | + |------|------| + | 3 | 3 | + +Now an interesting thing is, that the on clause can be replaced by a using clause when both tables provide the same columns. This not only makes the select a bit shorter, but also reduces the number of columns in the result. All columns listed in the using clause will be left out from the result and replaced with a new column with the name used in the using clause. The select from above would then look like this + + # select * + from tableA A + join tableB B + using (id); + + | id | + |----| + | 3 | + +The natural join goes one step further and tries to search for common columns itself and generate a using clause itself. The resulting query then looks like this + + # select * + from tableA A + natural join tableB B; + + | id | + |----| + | 3 | + +As nice as this seems it can backfire pretty fast, when one has two tables with a column of the same name, but completely different content not meant to be joined. Then it is possible just to get nothing. + + # select * from foo limit 1; + id | test | bar + ----+------+----- + 1 | 1 | 3 + + # select * from baz limit 1; + id | test | bar + ----+------+----- + 1 | 1 | 20 + + # select * from foo natural join baz + id | test | bar + ----+------+----- + +As all columns are named the same, but the content is different in column bar, no common row is found and therefore returned. + +For further information, the [PostgreSQL documentation][pg-doc] is pretty good. + +[pg-doc]: http://www.postgresql.org/docs/current/static/queries-table-expressions.html diff --git a/content/post/95.md b/content/post/95.md new file mode 100644 index 0000000..ddb454f --- /dev/null +++ b/content/post/95.md @@ -0,0 +1,26 @@ ++++ +title = "compile errors on omnios with llvm" +date = "2012-12-09T08:40:00+00:00" +author = "Gibheer" +draft = false ++++ + +This is some kind of hint for others, which may have the same problems I had. + +I wanted to compile [llvm](http://llvm.org/) 3.1 on omnios, an illumos distribution but it did not work out like I wanted it to. One of the first errors I got was a linking error. + + Text relocation remains referenced + against symbol offset in file + llvm::LoopBase::getLoopPredecessor() const 0x149a /tmp/build_gibheer/llvm-3.1.src/Release/lib/libLLVMCodeGen.a(MachineLICM.o) + llvm::LoopBase::getExitBlocks(llvm::SmallVectorImpl&) const 0x6200 /tmp/build_gibheer/llvm-3.1.src/Release/lib/libLLVMCodeGen.a(MachineLICM.o) + ld: fatal: relocations remain against allocatable but non-writable sections + +The problem in this case is, that parts of the llvm code are not compiled position independent (PIC). As I learned, this can be solved with the following setting. + + LDFLAGS="-mimpure-text -Wl,-ztextwarn" + +This changes the way of linking to only warn about position independent code, but still link it all together. It is not a nice solution, but with this, it is possible to find out, where it is gooing wrong. + +After that problem partially solved, I had another problem. Solaris supports 32bit and 64bit programs on the same environment, just like you can do on linux with multilib. The first compile of llvm produced 32bit binaries. When trying to compile llvm for 64bit, it was just impossible. I tried different things, like setting `CFLAGS`, `LDFLAGS`, `OTHER_OPTIONS` whatever there was and the only thing to get it compiled for 64bit is to overwrite `CC` and `CXX`. It seems like the Makefile just ignores the CFLAGS and therefore does only compile the code for the hostsystem seemingly bitness. + +But both of these problems got solved with 3.2, which I tried from svn and they work. The release date of 3.2 is only 7 days away, so hopefully it will still work by then. Nice thing is, [Rubinius](https://github.com/rubinius/rubinius) can already use it :D diff --git a/content/post/96.md b/content/post/96.md new file mode 100644 index 0000000..826a0bf --- /dev/null +++ b/content/post/96.md @@ -0,0 +1,144 @@ ++++ +title = "moving a zone between zpools" +date = "2013-01-05T09:11:53+00:00" +author = "Gibheer" +draft = false ++++ + +I got an interesting question regarding zones on Solaris in #omnios. + +> scarcry: Does anyone know how to move a zone from one zpool to another? + +There are some guides out there on how to move a zone from one machine to +another, but most of them install the zone in the same place as before. + +But instead of moving it from one machine to another, this small guide will just +show what to do, when only the location is chaning. + +preparations +------------ + +First, we need to setup the partitions and zones for our little experiment. For +this example, I will use the pool `rpool` and the following partitions + +* `rpool/zones/old` mounted to `/zones/old/` +* `rpool/zones/new` mounted to `/zones/new/` + +We also need the zone config, so here is it. + + create -b + set zonepath=/zones/old/zone1 + set ip-type=exclusive + set autoboot=false + add net + set physical=zone1 + end + commit + +Just install the zone with the normal commands + + $ zonecfg -z zone1 < zone.config + $ zoneadm -z zone1 install + $ zoneadm -z zone1 boot + +Check if the zone is running and write a file, just to make sure, we have the +same zone at the end. + +moving the zone +--------------- + +For this guide, we will assume, that the zone is in production use and can't be +offline too long. For that to work, we will do a first snapshot, when the zone +is still running. + + $ zfs snapshot -r rpool/zones/old/zone1@move1 + +After that, we can replay that snapshot into the new location. + + $ zfs send -R rpool/zones/old/zone1@move1 | zfs recv rpool/zones/new/zone1 + +This step will take some time, depending on the size of your zone. Now we stop +the the zone and detach it. + + $ zoneadm -z zone1 halt + $ zoneadm -z zone1 detach + +This frees the zfs partition from the zone and makes it accessible. We need that +a bit later. +Now we need an incremental snapshot and move that data to the new location. + + $ zfs snapshot -r rpool/zones/old/zone1@move2 + $ zfs send -R -i move1 rpool/zones/old/zone1@move2 | zfs recv rpool/zones/new/zone1 + +When we now list all zfs partitions, we see, that a partition zbe is mounted two +times into the same location. + + rpool/zones/old/zone1/ROOT/zbe 724M 1.59T 723M /zones/old/zone1/root + rpool/zones/new/zone1/ROOT/zbe 724M 1.59T 723M /zones/old/zone1/root + +To fix that, issue the following command. + + zfs set mountpoint=/zones/new/zone1/root rpool/zones/new/zone1/ROOT/zbe + +Now the partition has to be mounted, so that zoneadm can find it for the attach. +You can do that with the following command + + zfs mount rpool/zones/new/zone1/ROOT/zbe + +Now with the partition in the correct place, we have to tell the zone, where to +look for its new partition. + + $ zonecfg -z zone1 + zonecfg:zone1> set zonepath=/zones/new/zone1 + zonecfg:zone1> verify + zonecfg:zone1> commit + zonecfg:zone1> exit + +With the zone reconfigured, attach the zone. + + $ zoneadm -z zone1 attach + +This may take a bit of time, as the content of the zone gets checked for +compatibility. When it is back, check the zone is installed. + + $ zoneadm list -cv + ID NAME STATUS PATH BRAND IP + - zone1 installed /zones/new/zone1 ipkg excl + +Now boot the zone and we are done. + + $ zoneadm -z zone1 boot + +Now check if everything is where you expect it to be and start your services and +everything is good. + +ideas +----- + +Here are some ideas, what can be done differently in the process. + +### **iterative snapshots** + +If you zone has a lot of traffic, where many changes aggregate between the first +snapshot and the second, do some more iterative snapshots before taking down the +zone. +This has the advantage, that you can close the gap of changes to a minimum size +and therefore make the move at the end a bit faster. But check the available +disk space in the process to avoid a full disk. + +### **create a new zone** + +Instead of chaning the old zone and therefore making a rollback more complicated, +create a new zone, which looks exactly like the old one. +Instead of chaning the old one, do instead + + $ zonecfg -z zone2 + zonecfg:zone2> create -a /zones/new/zone1 + +This will set everything from the old zone with the new zonepath. Keep in mind, +that this will also use the old interface. If you don't want that, create a new +interface before and change it in the config step. + +You can also restore that zfs partition in a partition which has the correct. + +I hope it helps and you have some fun playing with it. diff --git a/content/post/97.md b/content/post/97.md new file mode 100644 index 0000000..d085e5f --- /dev/null +++ b/content/post/97.md @@ -0,0 +1,33 @@ ++++ +title = "filter program logs in freebsd syslog" +date = "2013-02-19T08:30:37+00:00" +author = "Gibheer" +draft = false ++++ + +I had the need to filter logs from different programs into different places - in this case the postgres and nginx logs. The man page of `syslog.conf` describes it pretty good, but misses some examples to make it more clear. So here is how I configured it, to make it easier. + +First, I edited the `syslog.conf` + + # filter everything apart from postgres and nginx + !-postgres,nginx + *.err;kern.warning;auth.notice;mail.crit /dev/console + # and all the other stuff + + # filter only postgres + !postgres + *.* /var/log/postgresql.log + + # filter only nginx + !nginx + *.* /var/log/nginx.log + +The next step is to setup the log rotate. This happens in `/etc/newsyslog.conf`. The man page is very helpful, so if you want to adjust something, take a peek into it. + + # postgresql + /var/log/postgresql.log 640 5 100 * JC + + # nginx + /var/log/nginx.log 640 5 100 * JC + +And that is all. If you want to add more program filtes, you have to define them in the `syslog.conf` as *notfilter* and *filter* and add the rotate to `newsyslog.conf`. diff --git a/content/post/98.md b/content/post/98.md new file mode 100644 index 0000000..2a1bbd6 --- /dev/null +++ b/content/post/98.md @@ -0,0 +1,20 @@ ++++ +title = "sysidcfg replacement on omnios" +date = "2013-07-17T22:19:44+00:00" +author = "Gibheer" +draft = false ++++ + +A very nice feature on Solaris was the possibility to initialize new zones with a sysidcfg file. This does not exist on omnios. With kayak, omnitis deployment server, a way to run postboot scripts was created. The way is the file `/.initialboot`. +This is just a shell script which gets executed on the first boot and gets removed afterwards. Nothing much but already very useful to make the initial setup for dns and the ip. + +A little example. I have a zone foo1 with a vnic barnic1. I want to setup dns and dhcp for the interface. The zone is installed in `/zones/foo1/` so we have to root file system mounted as `/zones/foo1/root`. + +We create the `/.initialboot` file (which ends up as `/zones/foo1/root/.initialboot` with the following content + + ipadm create-if foonic1 + cp /etc/nsswitch.dns /etc/nsswitch.conf + ipadm create-addr -T dhcp foonic1/ipv4 + echo "nameserver 192.168.56.1" >> /etc/resolv.conf + +Now boot the zone and after 5minutes or so everything is setup and ready to go. Makes it really easy. diff --git a/content/post/99.md b/content/post/99.md new file mode 100644 index 0000000..8efb1fa --- /dev/null +++ b/content/post/99.md @@ -0,0 +1,17 @@ ++++ +title = "grub can't read zpool" +date = "2013-08-05T19:13:16+00:00" +author = "Gibheer" +draft = false ++++ + +This weekend I had a small problem with my omnios installation. The installation is now more than a year old and back then, the feature flags for zfs were really fresh. So as time went on, zfs got better but somehow it was missed to update the grub installation. +When I then booted my server on friday, I did not get up again as grub was unable to load my zpool. + +Thanks to Rich Lowe from illumos project the bug got fixed. But I had to somehow run installgrub on my system to get it up again. For that to work, I had to find a system which either boots a current illumos kernel or lets me enter a kernel paramter. + +To make things more complicated, the current omnios installation medium did not like my system and just rebooted with a kernel panic without me having a chance to get my kernel paramter from the zpool. FreeBSD 9.1 was not able to read the zpool because of the feature flags. After half a day of try and error I just went with SmartOS and lo and behold - it worked! + +So I imported my zpool with `zpool import -o /mnt rpool`, read my menu.lst to get the parameter and restarted with omnios to enter that command to the kernel in grub and I got a live environment up to do installgrub! + +For me, the parameter in question is `-B acpi-user-options=0x2,$ZFS-BOOTFS` to switch off ACPI on my Sandy Bridge Celeron system. diff --git a/themes/zero/layouts/_default/list.html b/themes/zero/layouts/_default/list.html new file mode 100644 index 0000000..6232de8 --- /dev/null +++ b/themes/zero/layouts/_default/list.html @@ -0,0 +1,3 @@ +{{ partial "header.html" . }} + {{ partial "li" . }} +{{ partial "footer.html" . }} diff --git a/themes/zero/layouts/_default/si.html b/themes/zero/layouts/_default/si.html new file mode 100644 index 0000000..c00b047 --- /dev/null +++ b/themes/zero/layouts/_default/si.html @@ -0,0 +1,20 @@ +
+
+

{{ .Title }}

+
+ +
+ {{ .Content }} +
+
diff --git a/themes/zero/layouts/_default/single.html b/themes/zero/layouts/_default/single.html new file mode 100644 index 0000000..c41b37b --- /dev/null +++ b/themes/zero/layouts/_default/single.html @@ -0,0 +1,3 @@ +{{ partial "header.html" . }} + {{ .Render "si" }} +{{ partial "footer.html" . }} diff --git a/themes/zero/layouts/_default/summary.html b/themes/zero/layouts/_default/summary.html new file mode 100644 index 0000000..35840f2 --- /dev/null +++ b/themes/zero/layouts/_default/summary.html @@ -0,0 +1,11 @@ +
+
+

{{ .Title }}

+
+ +
+ {{ .Content }} +
+
diff --git a/themes/zero/layouts/index.html b/themes/zero/layouts/index.html new file mode 100644 index 0000000..f5896b1 --- /dev/null +++ b/themes/zero/layouts/index.html @@ -0,0 +1,10 @@ +{{ partial "header.html" . }} +
    + {{ range first 10 (where .Data.Pages "Section" "post") }} +
  • + {{ .Render "summary" }} +
  • + {{ end }} +
+ older posts +{{ partial "footer.html" . }} diff --git a/themes/zero/layouts/partials/footer.html b/themes/zero/layouts/partials/footer.html new file mode 100644 index 0000000..b605728 --- /dev/null +++ b/themes/zero/layouts/partials/footer.html @@ -0,0 +1,2 @@ + + diff --git a/themes/zero/layouts/partials/header.html b/themes/zero/layouts/partials/header.html new file mode 100644 index 0000000..497acb6 --- /dev/null +++ b/themes/zero/layouts/partials/header.html @@ -0,0 +1,9 @@ + + + + {{ if eq .URL "/" }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }} + + + +

{{ .Site.Title }}

+ diff --git a/themes/zero/layouts/partials/li.html b/themes/zero/layouts/partials/li.html new file mode 100644 index 0000000..c828330 --- /dev/null +++ b/themes/zero/layouts/partials/li.html @@ -0,0 +1,18 @@ +This should work, right? + {{ if .Paginator.HasPrev }} + prev + {{ else }} + prev + {{ end }} +
    + {{ range .Paginator.Pages }} +
  • + {{ .Render "summary" }} +
  • + {{ end }} +
+ {{ if .Paginator.HasNext }} + next + {{ else }} + next + {{ end }} diff --git a/themes/zero/layouts/post/summary.html b/themes/zero/layouts/post/summary.html new file mode 100644 index 0000000..7cf7716 --- /dev/null +++ b/themes/zero/layouts/post/summary.html @@ -0,0 +1,11 @@ +