AWK: sumowanie
Wiecznie zapominam, więc dla potomnych i ku uciesze własnej pamięci:
~$ df -h | grep "/dev/sd" | awk '{ sum+=$4 } END { print "wolne: ", sum "GB"}'
Kentucky Fried Chicken, kurwa twoja mać.
Jeden raz, ok… zdarzyło się… Ale 3 razy? Pełną nazwą, zamiast jakże popularnym skrótem „K.F.C.”? Przegięcie!
Spytacie o co chodzi?
Magic Johnson w paskudny sposób przemycił reklamę do uroczystości ku pamięci Michaela Jacksona.
Na przypomnienie stara reklamówka K.F.C. z Magickiem w roli głownej.
http://www.youtube.com/watch?v=8sOtuLYD_wA
K.F.C. – od dzisiaj u was nie jadam. Magic – aż tak bardzo brakuje ci kasy? Swoją drogą, porównajcie sobie ówczesnego Magica, a obecnego grubasa. Widać kurczaczki służą :P
Anti sans-serif…
Mam serdecznie dosyć czcionek sans-serif. Ogłaszam bunt! Wszystkie moje strony od dzisiaj używają fontów z rodziny Georgia, serif;
Dziękuję za uwagę.
Postfix – the horrrrrrrorrrrrrrr!
Wszystko pięknie w/g konfiguracji:
http://www.howtoforge.com/perfect_setup_debian_etch_p5
Efekt? Nie działa. Ehhh, Debian…
May 19 13:11:14 (hidden) postfix/smtpd[6073]: connect from (hidden)
May 19 13:11:14 (hidden) postfix/smtpd[6073]: warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied
May 19 13:11:14 (hidden) postfix/smtpd[6073]: warning: (hidden): SASL LOGIN authentication failed: generic failure
May 19 13:11:14 (hidden) postfix/smtpd[6073]: lost connection after AUTH from (hidden)
Rozwiązanie:
http://linux.derkeiler.com/Mailing-Lists/Debian/2004-06/2122.html
Ufff. Chociaż i tak szybciej niż qmailem… (wzdech).
P.S. Postraffiam fsistkich debianofcóf :P
SQL: odwrócony SELECT DISTINCT
Czasami człowiek zapomina takich perełek… TAK! Wiem, że jest to rozwiązanie nieoptymalne.
select blabla from
tab as t1,
tab as t2
where t1.id <> t2.id and t1.name = t2.name;
Alternatywą dla tego byłoby użycie:
SELECT DISTINCT(id) from tabela;
wrzucenie tego do tablicy w php, a następnie użycie negacji:
SELECT * FROM tabela WHERE id NOT IN ($tablica);
Eventlog rotator for Windows
Well not exactly, but close…
Here’s the deal: i’ve been assigned a task, to figure out a way to rotate security logs on a Windows server, which has leveraged auditing policies.
Problem: Eventlog retention mechanism under Windows does not allow for creating new log files when the current logfile grows to a certain limit (which is plain stupid and short-sighted). Windows built in mechanism can only overwrite the oldest entries with newer ones if the logfile size limit has been reached.
After some extensive googling, i finally stumbled upon one blog entry that has put me on the right track. Microsoft does have a tool for parsing the binary logfiles (and not only that, but you’ll have to figure it out by yourself), using SQL format queries as commands. It’s called „Log Parser” (how obvious!), and is featured here.
I’ve downloaded the tool and started playing with VBScript (damn you Microsoft for not adopting Bash) and Log Parser, to get the desired result. I won’t go into details, as the file posted below is pretty self-explanatory (and well commented too).
Anyway, here’s „the result” (it’s a gzipped/tared vbscript, some antiviruses might go crazy ’bout it).
Enjoy!
P.S. I’ve yet to add a zipping function to it.
P.S.(2) It’s my first VBScript batch, please don’t laugh. Thank you.
Zeitgeist
Gorąco radzę – obejrzyjcie od początku, do końca. Dotyczy nas wszystkich.
Komiksy
Jedna z moich pasji. Jako, że czytuję regularnie, poniżej lista linków do tych, które czytam regularnie – może komuś się przyda:
Swojego czasu czytywałem również Megatokyo, Bug City, Nerdkya’ę oraz nieodżałowane szczecińskie Futerkowce. Część się skończyła (Futerkowce, Bug City), część znudziła, a część stała zbyt zakręcona by kontynuować lekturę (Megatokyo), ale zamieszczam ku pamięci i uciesze tych, co jeszcze nie czytali. Ciekaw jestem, czy tak jak ja – przebrniecie od pierwszego paska, do dnia dzisiejszego (wszystkie z listy powyżej zaliczone).
SBS 2003 Tricks #4.1
Ważne narzędzia:
- ntdsutil – narzędzie zarządzania Active Directory na poziomie administracyjnym (tak – wiem, masło maślane!)
- dcdiag – narzędzie diagnostyczne kontrolera domeny
- gpotool – narzędzie do sprawdzania poprawności GPO (z pakietu Windows Server 2003 Resource Kit Tools)
SBS 2003 Tricks #4
Znowu problem z kontrolerem domeny, znowu MSDTC (nie pamiętam czy pisałem o tym wcześniej, stąd ku pamięci):
MSDTC Event ID 4143 and 53258 on Windows Server 2003 SP1 Domain Controller
I got hit by a problem on a freshly installed virtual machine using a slipstreamed SP1 installation and promoted to a domain controller. Two events were appearing in the event log which were unexpected.
Source: MSDTC Event ID: 4143 Information
MS DTC has detected that a DC Promotion has happened since the last time the MS DTC service was started.followed by
Source: MSDTC Event ID: 53258 Warning
MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC will continue to function and will use the existing security settings.To resolve this, go through the following steps:
- Start/Administrative Tools/Component Services
- Navigate the tree view on the left to:
– Console Root
– Component Services
– Computers
– My Computer
- Right click on „My Computer” and select properties
- Select the MSDTC Tab
- Under „Transaction Configuration” near the bottom, click „Security Configuration”
- On the Security Configuration screen, just click OK – don’t change anything.
- Back on the „My Computer Properties” screen, click OK again to dismiss
- Right click on „My Computer” in the tree view and select „Stop MS DTC”
- Right click on „My Computer” in the tree view and select „Start MS DTC”
- Close the Component Services snapin.All should now be well again. Hope this helps someone.
Źródło: link
