Архиви на блога

sort output from linux du command

du -h | perl -e ‘sub h{%h=(K=>10,M=>20,G=>30);($n,$u)=shift=~/([0-9.]+)(\D)/;return $n*2**$h{$u}}print sort{h($b)h($a)};’ > dusort.txt

Публикувано в linux

openvpn username password auth

In your config you need to add username-as-common-name auth-user-pass-verify /etc/openvpn/verify.php via-file Then create the file and paste in it #Now add this code into the file #!/usr/bin/php Don’t forget to add users 😉 echo „myfirstuser:password123“ > /etc/openvpn/users

С етикет: , ,
Публикувано в linux

security.mixed_content.block_active_content

This can be set to false in about:config security.mixed_content.block_active_content

С етикет: ,
Публикувано в linux

idea for id storing of files

If you have some time of id in your database and you want to save file associated with this id it’s not a good idea to make dir with id value and save the file there because on some point

С етикет: , , , , , ,
Публикувано в linux, php

mysql server has gone away or connection timeout

If you do a lots of things in one php script this usually takes some time and mysql can gone away 😉 for this when you run new query you can run it with this function which will connect again

С етикет: , ,
Публикувано в linux, php