initial commit and import
This is the initial import of all blog posts and a pretty workable theme. More work will follow.
This commit is contained in:
commit
02f704abe1
|
@ -0,0 +1 @@
|
|||
public/
|
|
@ -0,0 +1,9 @@
|
|||
baseurl = "http://zero-knowledge.org/"
|
||||
languageCode = "en-us"
|
||||
title = "zero-knowledge"
|
||||
theme = "zero"
|
||||
SectionPagesMenu = "main"
|
||||
|
||||
[taxonomies]
|
||||
author = "author"
|
||||
tag = "tags"
|
|
@ -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.
|
|
@ -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
|
|
@ -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 ;))
|
|
@ -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
|
|
@ -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.
|
|
@ -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`.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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://<yourscannerhere>/#hId-NetworkFolderAccounts`.
|
||||
The we add a new network folder with the following data:
|
||||
|
||||
* display name: scans
|
||||
* network path:
|
||||
* user name: scans
|
||||
* password: <enter 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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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)
|
|
@ -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
|
|
@ -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
|
|
@ -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.
|
|
@ -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`.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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 <yourserver>
|
||||
|
||||
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.
|
|
@ -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 * <content of ca.pub>
|
||||
|
||||
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.
|
|
@ -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.
|
|
@ -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
|
|
@ -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.
|
|
@ -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
|
||||
|
||||
<source:sh>[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\
|
||||
</source>
|
||||
|
||||
Es ist also nicht moeglich ausserhalb der Version 118 auf eine andere
|
||||
Version umzusteigen, ausser es wird das gesamte System mittels
|
||||
image-update mitgezogen.
|
|
@ -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
|
||||
|
||||
<source:sh>pfexec pkg install \$(pkg list ~~u | awk ‘{ print \$1 }’ |
|
||||
grep~~v “\^NAME”)</source>
|
||||
|
||||
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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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 ;)
|
|
@ -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.
|
|
@ -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…**
|
|
@ -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.
|
|
@ -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:sh>\
|
||||
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\
|
||||
</source>
|
|
@ -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
|
|
@ -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 <source:sh>pkg search -r soundcard.h</source> 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.
|
|
@ -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.
|
|
@ -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.
|
||||
|
||||
<source:php>filter\_var(“lustige@e-mail.adresse”,
|
||||
FILTER\_VALIDATE\_EMAIL);</source>
|
||||
|
||||
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**
|
|
@ -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/<version>/bin drin ist, sondern direkt in /usr/bin/. Ist
|
||||
aber nicht schlimm, da psql zu alten Versionen der Datenbank kompatibel
|
||||
ist.
|
|
@ -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
|
||||
|
||||
<source:sh>\
|
||||
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 <url> 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/ <publisher>
|
||||
|
||||
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\
|
||||
</source>
|
||||
|
||||
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.
|
|
@ -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: <source:sh>sh
|
||||
../dist/configure —prefix=/usr && make && make install</source> auf.
|
||||
|
||||
Das war es schon mal fuer db. Danach wechseln wir in das
|
||||
bogofilter-verzeichniss und fuehren
|
||||
|
||||
<pre>
|
||||
./configure —prefix=/usr && make && make install
|
||||
|
||||
</pre>
|
||||
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
|
||||
|
||||
<source:sh>\
|
||||
CC=“gcc ~~std=gnu99~~DSTDC ~~lsocket~~lnsl” ./configure —prefix=/usr
|
||||
—disable-libetpan —disable-ldap —disable-dbus\
|
||||
</source>
|
||||
|
||||
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)
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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)
|
|
@ -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.
|
||||
|
||||
<source:sh>\> dladm show-link\
|
||||
LINK CLASS MTU STATE OVER\
|
||||
intern1 etherstub 9000 unknown —\
|
||||
vm\_intern1 vnic 9000 up intern1\
|
||||
vm\_extern1 vnic 1500 up rge0\
|
||||
</source>
|
||||
|
||||
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.
|
||||
|
||||
<source:sh>\> echo “192.168.1.100” \>\>
|
||||
/etc/hostname.vm\_intern1<br />\> echo “netmask 255.255.255.0 broadcast
|
||||
+ up” \>\> /etc/hostname.vm\_intern1</source>
|
||||
|
||||
das selbe Spiel machen wir auch mit dem zweiten Interface
|
||||
|
||||
<source:sh>\> echo “192.168.2.100” \>\>
|
||||
/etc/hostname.vm\_intern2<br />\> echo “netmask 255.255.255.0 broadcast
|
||||
+ up” \>\> /etc/hostname.vm\_intern2</source>
|
||||
|
||||
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
|
||||
|
||||
<source:sh>\> echo “192.168.2.1” \>\> /etc/defaultrouter</source>
|
||||
|
||||
Was nun noch bleibt ist der DNS-Server. Dafür muss die Datei
|
||||
/etc/nsswitch.dns nach /etc/nsswitch.conf kopiert werden.
|
||||
|
||||
<source:sh>\> cp /etc/nsswitch.dns /etc/nsswitch.conf</source>
|
||||
|
||||
Danach muessen noch die DNS-Server in die `/etc/resolv.conf` eingetragen
|
||||
werden und dann der DNS-Client gestartet werden. Das geht mit
|
||||
|
||||
<source:sh>\> svcadm enable -r dns/client</source>
|
||||
|
||||
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)
|
|
@ -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!<>!
|
|
@ -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.
|
|
@ -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:
|
||||
|
||||
<source:sql>\
|
||||
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);\
|
||||
</source>
|
||||
|
||||
Und Probieren folgenden select aus:
|
||||
|
||||
<source:sql>select projekt, important\_value, max(datum) from testmax
|
||||
group by projekt;</source>
|
||||
|
||||
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**
|
|
@ -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.
|
|
@ -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\*
|
|
@ -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.
|
||||
|
||||
<source:sql>\
|
||||
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’;\
|
||||
</source>
|
||||
|
||||
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 <code>Select blork(3);</code>
|
||||
selektieren und bekommt dann auch die drei Werte zurueck.
|
||||
|
||||
<source:sh>test=\# select blork(1);\
|
||||
blork\
|
||||
——-\
|
||||
3\
|
||||
2\
|
||||
1\
|
||||
(3 rows)\
|
||||
</source>
|
||||
|
||||
Die Funktion laesst sich dann auch ganz normal in JOINs und sonstiges
|
||||
einbauen, zum Beispiel
|
||||
|
||||
<source:sql>\
|
||||
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;\
|
||||
</source>
|
||||
|
||||
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).
|
|
@ -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)
|
|
@ -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**
|
|
@ -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.
|
|
@ -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.
|
|
@ -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**
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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, <strong>ABER</strong> 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.
|
|
@ -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
|
||||
`:! <befehl> %`. 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.
|
|
@ -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\*
|
|
@ -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.
|
||||
|
||||
<source:sql>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\$\$;</source>
|
||||
|
||||
Dieses Script lässt sich in psql ausführen. Viel Spass mit dem
|
||||
neuen Feature und beim ausprobieren.
|
|
@ -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.
|
|
@ -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)
|
|
@ -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
|
||||
<a href="http://llvm.org">LLVM</a> 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 ;)
|
|
@ -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)
|
|
@ -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
|
||||
----- ----------------------------------------------------------
|
|
@ -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.
|
|
@ -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.
|
||||
|
||||
<source:ruby>\# 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’</source>
|
|
@ -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:
|
||||
|
||||
<source:shell>\
|
||||
\# 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\
|
||||
</source>
|
||||
|
||||
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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
|
||||
<source>\# 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"\
|
||||
</source>
|
||||
|
||||
Das Zeichen `|` ist dabei mein CSV-Trennzeichen, damit ich die Werte
|
||||
auseinander halten kann.
|
||||
|
||||
Datenbankschema
|
||||
===============
|
||||
|
||||
Das Datenbankschema entspricht dem Schema der CSV-Datei.
|
||||
|
||||
<source:sql>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\
|
||||
);\
|
||||
</source>
|
||||
|
||||
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:
|
||||
|
||||
<source:sql>create role wwwimport login password
|
||||
’changeme![](';</source>
|
||||
|
||||
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
|
||||
|
||||
<source>/var/log/lighttpd/access.log www:www 664 7 * @T00 Z /var/run/lighttpd.pid</source>
|
||||
|
||||
gesetzt habe. Das erstellt Archive im Format @access.log.<counter>.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
|
||||
|
||||
<source:sh>sed -e "s/[][]//g"</source>
|
||||
|
||||
Das Problem mit der zusaetzlichen Zeile loesen wir mit einem @grep@.
|
||||
|
||||
<source:sh>grep -v "logfile turned over"</source>
|
||||
|
||||
geloest. Das gibt nur noch die Zeilen aus, welche nicht den String enthalten.
|
||||
|
||||
Insgesamt kommt dabei bei mir folgendes kleines Script raus.
|
||||
|
||||
<source:ksh>#)/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</source>
|
||||
|
||||
Das habe ich dann noch irgendwo gespeichert und im cron mit
|
||||
|
||||
<source>0 23 \* \* \* sh logimport.sh</source>
|
||||
|
||||
eingetragen. Jetzt importiert es munter meine Logs und ich kann anfangen
|
||||
`R` zu lernen.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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)
|
|
@ -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.
|
|
@ -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/
|
|
@ -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.
|
|
@ -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` <username>
|
||||
|
||||
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.
|
|
@ -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.
|
||||
|
||||
```
|
||||
<exec_method type="method" name="start" exec="/bin/bash">
|
||||
<method_context>
|
||||
<method_environment>
|
||||
<envvar name="FOO" value="bar" />
|
||||
</method_environment>
|
||||
</method_context>
|
||||
</exec_method>
|
||||
```
|
||||
|
||||
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.
|
|
@ -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=<your_domain> name_server=<your_dns_server>}
|
||||
nfs4_domain=dynamic
|
||||
timezone=Europe/Stockholm
|
||||
terminal=xterms
|
||||
root_password=<crypted_password>
|
||||
security_policy=NONE
|
||||
network_interface=<interface1> {primary hostname=<hostname> default_route=<route_ip> ip_address=<if_ip> netmask=<if_netmask> protocol_ipv6=yes}
|
||||
network_interface=<interface2> {hostname=<hostname> ip_address=<if_ip> netmask=<if_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.
|
|
@ -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)
|
|
@ -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)
|
|
@ -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.
|
|
@ -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.
|
|
@ -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`
|
|
@ -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.
|
|
@ -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!
|
|
@ -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
|
||||
|
||||
<source:ruby>\
|
||||
require ‘rubygems’\
|
||||
require ‘rack’\
|
||||
require ‘xmmsclient’
|
||||
|
||||
\$xmms2 = Xmms::Client.new ‘rackclient’\
|
||||
\$xmms2.connect ‘path-to-ipc’
|
||||
|
||||
Rack::Handler::WEBrick.run lambda {|env|\
|
||||
body = “\<html\>”\
|
||||
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 \<\< ‘<br><a href="/next">naechster</a>’\
|
||||
body \<\< ‘\</html\>’\
|
||||
[200, {’Content-Type’ =\> ‘text/html’}, body]\
|
||||
}, :Port =\> 8080\
|
||||
</source>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue