November 10, 2008

most popular browser?

to check my apache log against browsers used I got some tips and came about that command:
zcat access.log.6.gz|awk '{print $12}'|sort|uniq -c|sort -g
and this I can easily visualize :)

Tags: ,
August 11, 2008

backup staff homesites

I needed to backup staff members’ homepages located at homedirs and access by Apache’s http://site/~name

so tar.gz the whole /home, but:

  • users got some private stuff in the $HOMEs
  • their $HOME/public_html is what I need to backup, but they got some large files in there

so…
find home -perm /004 -size -5M -type f -print0 | xargs -0 tar -rvf home.tar

-perm is for ‘readable to all’ files; size <5MB; type – only files (since tar is appending (r) and not creating (c) new archive with each file! )

the last hour was about dealing with files containing whitespaces, since xargs got each argument seperated by any whitespace… so -0 is for arguments seperated by null and -print0 is for listing files terminated  by a null character instead of by whitespace

Tags: , ,
July 7, 2008

secret dir

because of http://marekopel.wordpress.com/2008/02/10/78/ I needed to set .htaccess for a Apache2@Debian Web dir… just as many times before used the htpasswd, copied the .htaccess (with a path pointing to the created passfile) to the security-needing dir and… it didn’t work…

the same file moved to my personal subdir (/home/kopel/public_html/test) worked fine (http://www.zsi.pwr.wroc.pl/~kopel/test asked for user/pass created with htpasswd), but in the main site subdir (/var/www) the login form didn’t show…

after over an hour it turned out that a changing
AllowOverride None
in default <VirtualHost *> to
AllowOverride All

made it work

it was quite strange, because I couldn’t find the configuration for public_htmls to compare :(

and BTW: when creating a secret subdir, where only a few user have write access, one thing took me a while:

the write-enabled users got appended the group of the dir, but when they were creating a new subdir, its group was the default group of the user (not the secured dir’s group)… sticky bit did the trick -> setting gid for a dir: chmod -R g+s secret_dir

May 12, 2008

Java Security, a Tomcat i MySQL

prawie tydzień prób i błędów uruchomienia prostej JSP z dostępem do MySQL na Tomcat‘cie 5.5 na Ubuntu i Debian‘ie…

i okazuje się, że szukałem opcji TOMCAT5_SECURITY=no/etc/init.d/tomcat5.5

no ładnie :(

December 18, 2006

słuchaj, to do ciebie

chciałem przenieść w końcu phpmyadmin’a na https, no i godzina z życiorysu, bo jest drobna różnica między zrobieniem tego na Ubuntu i na Debianie… na tym drugim 3-a ręcznie wpisać Listen 443 do /etc/apache2/ports.conf

December 16, 2006

import?

próbowałem zaimportować mój blog z Moodle i ZSI przez RSS, ale importowały się same daty…

żeby z bloggera coś zaimportować, to potrzeba zainstalować php5-curl, ale coś nie ma go na oficjalnych serwerach Debiana…

ale poza tym działa… może aktualności ZSI na tym zrobić? tylko lokalizację polską najpierw…

Follow

Get every new post delivered to your Inbox.