Linux / Windows – what’s the difference…


Good snippet for when You have to revalidate page on every load (sportnews etc.)

Add to Your .htaccess: FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"  

Snippet for replacing certain code within PHP code

Replaces/searches by row on unix commandline: find folder/* -type f -name \*.php -exec sed -i.bak.php "s/function_name('blahblah');/\$variable['blahblah'];/" {} \; – searches in certain folder – searches in .php files – makes backup of modified files NB! Some things must be escaped with \ mark

Fix for old code when GLOBALS are needed on newer PHP versions

Quickfix is: if (! isset($PXM_REG_GLOB)) { $PXM_REG_GLOB = 1; if (! ini_get('register_globals')) { foreach (array_merge($_GET, $_POST) as $key => $val) { global $$key; $$key = (get_magic_quotes_gpc()) ? $val : addslashes($val); } } if (! get_magic_quotes_gpc()) { foreach ($_POST as $key => $val) $_POST[$key] = addslashes($val); foreach ($_GET as $key => $val) $_GET[$key] = addslashes($val); } […]

All local mail sent out via external smarthost (Exim4 on Ubuntu 16.04)

Steps to do: 1. First run (start basic exim conf): sudo dpkg-reconfigure exim4-config And use these config options: General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail System mail name: IP-address to listen on for incoming SMTP connections:, ::1 Other destinations for which mail is accepted: Machines to relay […]

NetBeans on Ubuntu

Earlier I had version NB 8.0.* on my laptop – worked like a charm. On Ubuntu 16.04 I installed NB 8.1.* via official repo – and that’s where the problems started… I had no luck enabling auto-completion from included file – Interwebs was full of probable “solutions” to remove cache and/or to check settings and/or […]

Kuidas kasutada Windows OS’is DIG’i

DIG käsud ja seletused on leitavad lehelt: DIG Windowsile on alla laetav BIND paketi osana lehelt:

Torrentid ja jälgimine

Siinkohal kirjutan enda tarbeks põhiliselt kokkuvõtva teabe P2P võrgu võimalikest “turvavigadest” ja nende “parandamisest”. (Enamus lingid teistele lehtedele või nendel olev teave võib olla natuke vananenud…) Et siis… – enamus inimestest kasutab reeglina P2P networki failide jagamiseks/laadimiseks – suur osa sellest moodustavad torrentid. Viimasel ajal (loe: viimase 3 aasta jooksul) aga on hakatud “tasuta torrent […]

hg and mercurial on bitbucket – ssh on linux connection problems

FoodForThought: Error: dev$ hg pull remote: Permission denied (publickey). abort: no suitable response from remote hg!

, , ,

IP block from MySQL via iptables

Nifty bash script: #!/bin/bash # 19.09.2013 – Kristjan Tarjus # this script retrieves data from mysql using bash and adds them to iptables for blocking dbase=”YOURDBDATABASE” table=”YOURDBTABLE” host=”YOURDBHOST” user=”YOURDBUSER” dbpass=”YOURDBPASS” #For multiple servers – this script checks via IP function int-ip { /sbin/ifconfig $1 | grep “inet addr” | awk -F: ‘{print $2}’ | awk […]

OwnCloud and upload problem

If you happen to encounter upload or sync problem with android device or other server, then solution would be to add to .htaccess file in same folder: <files “remote.php”> Order allow,deny Allow from all </files>  

, , , ,

Previous Posts