Heute morgen auf dem Weg zum Flughafen. Der Taxifahrer war heute morgen um 3 noch nicht so ganz wach oder nicht mehr. Auf jeden Fall fuhr der Taxifahrer ziemlich oft von der einen auf die andere Spur (bei 2 Spuren pro Richtung). Irgentwann hatte er sich mit sich selber wohl geeinigt und fuhr mit dem Mercesstern zielend mittig auf der gestrichelten Linie. Als die Straße sich auf eine Spur verengte hat er wohl 3 oder 4 mal den Bordstein mit den Reifen und oder Felgen geditscht. Ich habe das nicht weiter kommentiert. Es war schon ein wenig wie fliegen bzw. Achterbahnfahren.
sudo owns me!
Today I installed sudo on my freeBSD test server. Typed a wrong password and got: You type like i drive. owned! That is a difference from freeBSD to linux sudo
sudo -s also works.
sudo also has an insult mode, which will question your intelligence if you enter a password in wrong.
fun with chmod
Fun thing to do as root, in root: chmod -R 666 * Just as bad as rm -rf *, but more fun. “The files are all there, but I can’t do anything with them!” And you can’t change permissions, since chmod isn’t executable either. :-)
mod lua error handling sux
I still dislike the 500 error handling in lua. Well scripting got easier with practicing :P But the error handling realy sux a lot compared to PHP where I come from. I made a bit “benchmarking”. OK I took very different scripts, but PHP seems faster to me than lua. Plus for lua is that you are able to write direcly into apache log files.
Happy 7DB
Happy 7DB to you geeks ;-)
first script for mod_lua apache2.3/2.4
function handle(r)
r.content_type = "text/html"
--r.headers_out["X-Powered-By"] = "mod_lua; " .. _VERSION
r:puts("Hi!")
return apache2.OK
end
Mod lua expects a function with the name handle() else there is a 500 Error. The error handling is pretty anoying…
compile lua on windows
Grab the “newest” (2008) http://www.lua.org/ftp/lua-5.1.4.tar.gz
unpack it. Compiling with VC++ is very easy.
Open the x64 %comspec% /E:ON /V:ON /T:0E /K “C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd” /Release
or x86 command line
%comspec% /k “”C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat”” x86
browse to lua folder and run
etc\luavs copy /y src\*.* .\
Done!
build mod_geoip
Obtain GeoIP-1.4.6 from maxmind.com and built per included instructions.
Build Module against an IPv6 Enabled Apache Build
Obtain GeoIP-1.4.6 from maxmind.com and built per included instructions. Build Module against an IPv6 Enabled Apache Build del *.obj *.exp *.lib *.so set APACHE=C:\Apache22 set GEOIPROOT=C:\Build\GeoIP-1.4.6 cl /nologo /MD /O2 /LD /W3 -DWIN32 -D_WIN32 -I%GEOIPROOT%\libGeoIP -I%APACHE%\include /c /Fomod_geoip.obj mod_geoip.c link /NODEFAULTLIB:LIBCMT kernel32.lib "%APACHE%\lib\libhttpd.lib" "%APACHE%\lib\libapr-1.lib" "%APACHE%\lib\libaprutil-1.lib" "%GEOIPROOT%\libGeoIP\GeoIP.lib" /nologo /subsystem:windows /dll /machine:I386 /out:mod_geoip.so mod_geoip.obj
patch requires admin privileges on Windows 7
The patch.exe requires admin privileges on Windows 7. This is pretty annoying! The first thing that worked was just renaming the file to pach.exe Stupid windows. But I didn’t like that cause than I mostly typed it wrong and patch command was missing. I found a better solution:
Create a text file in the same directory with the name patch.exe.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker"/> </requestedPrivileges> </security> </trustInfo> </assembly>
Save as UTF8. Now it works. Well I have to test if it is possible to embedd the manifest than good bye $%&# asking for admin permission
