Feb
15
2009
Notes to myself and Googlers on installing a virtual hosting control panel Virtualmin (a great add-on to Webmin) on Ubuntu server:
wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod 755 install.sh
./install.sh
— installs Virtualmin automatically with all dependencies, with a nice skin which is also used by Webmin (which I remember used to be quite ugly by default)
chmod 711 /var/spool/postfix/var/run/saslauthd
— fixes login failure when trying to send mail through virtual server
- it seems apache vhost, ftp, e-mail and DNS is properly configured automatically, will add more info here as I move on with my hosting migration to Virtualmin probably
Nov
29
2008
Straciłem nad tym więcej czasu niż chcę się przyznać; miałem dodać mały element graficzny o nazwie pliku zspon.png do strony jednego z Klientów i jakimś cudem nie pojawiał się on nigdy na stronie, a Firebug pokazywał że ma on “display: none”, choć żadnego CSSa nie przypisywałem.
Okazało się, że Adblock z filtrami Filterset.g wycina mi obrazki które mają w nazwie “spon” :> Wyłączenie Adblocka na czas developmentu to dobry pomysł, choć ja zostawiam włączony - jak ktoś będzie go używał to wolę zawczasu wiedzieć co mu zniknie i zmienić nazwę pliku
zs-pon.png się wyświetla
Nov
27
2008
Google wasn’t awfully helpful while I was searching for solution to word wrapping a text when drawing in Java, so let’s teach Google this:
private void drawStringRect(Graphics2D graphics, int x1, int y1, int x2, int y2,
float interline, String txt) {
AttributedString as = new AttributedString(txt);
as.addAttribute(TextAttribute.FOREGROUND, graphics.getPaint());
as.addAttribute(TextAttribute.FONT, graphics.getFont());
AttributedCharacterIterator aci = as.getIterator();
FontRenderContext frc = new FontRenderContext(null, true, false);
LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
float width = x2 - x1;
while (lbm.getPosition() < txt.length()) {
TextLayout tl = lbm.nextLayout(width);
y1 += tl.getAscent();
tl.draw(graphics, x1, y1);
y1 += tl.getDescent() + tl.getLeading() + (interline - 1.0f) * tl.getAscent();
if (y1 > y2) {
break;
}
}
}
Nov
07
2008
Szczeciński sąd zakazał pokazywania piersi dzieciom w związku z czym należy je teraz karmić butelką lub ostatecznie z zawiązanymi oczami.
Sep
02
2008
After upgrading NetBeans to 6.5 the -post-compile task I added so JiBX bindings are compiled stopped working for me throwing an exception about bindings not found at runtime.
The solution to this is to disable “Compile on Save” feature in project properties.