Linux hardware listing

inxi -Fxzd
Posted in Uncategorized | Leave a comment

reCaptcha, allow_url_fopen

reCaptcha is easy, has plenty of tutorials. However you will find also many comments telling that it always returns bool(false). Many user eventually accept the false reply as “there is a reply at least, so I validate my form”.

The one thing to remember is that you need your php to connect to remote url.

-> allow_url_fopen should be ON, check that with phpinfo()

 

Posted in Uncategorized | Leave a comment

copy directories, only updated files

Use rsync, like:

rsync -a --ignore-times updatedfiles/* /var/www/filestoupdate/

 

Posted in Uncategorized | Leave a comment

Owncloud slow on Windows

Owncloud synchronization on a windows 7 machine used to be insanely slow, sometimes to the point of need to hard reset.

I could solve this by:
– open the Internet settings
– connections tab
– network parameters
– uncheck the box to detect automatically connection parameters

Posted in Uncategorized | Leave a comment

Postfix: Delete all emails from specific domain

In one shot:

 postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /@domain\.tld/ { print $1 }' | tr -d '*!' | postsuper -d -
Posted in Uncategorized | Leave a comment

SVN revert to revision X

revert to version XXX

svn update -rXXX

svn logs, last 10 entries

svn log  -l 10

svn log, more info from version XXX

svn log -rXXX --verbose
Posted in Uncategorized | Leave a comment

ramfs – temporarily mount filesystem in ram to speed things up

ram is faster than disk, this is less and less true with ssd, but in many situations it is still true, and can be useful to use the ram to serve files at high speed access.

Example script that first unmount a directory, then copy the content of another and mount it in ram:

# unmount
umount /var/www/servemequick
# mount
# copy source to temporary backup
cp -Rv /var/www/servemequick ./servemequick
# mount new ram directory with same path as source
mount -t tmpfs -o size=1g tmpfs /var/www/servemequick/
# copy backup to mounted new ram directory
cp -Rv ./servemequick/* /var/www/servemequick

Posted in Uncategorized | Leave a comment

postfix / smtpd – disable relay to specific domains

/etc/postfix/main.cf

make sure you have included this:

 hash:/etc/postfix/access,

in

smtpd_sender_restrictions = ................

Note you can also avoid receving to a specific domain if you add this also in reject_unauth_destination ruleset.

/etc/postfix/access

Have your domain listed like:

evildomain.tld   REJECT
outta.here       REJECT

Then you need to generate the actual file that postfix will use = access.db like this:

# postmap hash:/etc/postfix/access

restart postfix and that’s it.

Posted in Uncategorized | Leave a comment

Open portmapper – disable rpcbind

you can use firewall rules, or if you dont use nfs, just stop it and remove it from starting:

service rpcbind stop
update-rc.d nfs-common disable
update-rc.d rpcbind disable

Check that it is not listening to requests with:

rpcinfo -T udp -p IPADDRESS

Posted in Uncategorized | Leave a comment

This site can’t provide a secure connection uses an unsupported protocol. ERR_SSL_OBSOLETE_CIPHER HIDE DETAILS Unsupported protocol The client and server don’t support a common SSL protocol version or cipher suite.

This is a Google Chrome move for your own good. (After version 53)

Make sure your ssl.conf in apache mods does not allow old/weak protocols, have something like:

SSLCipherSuite ALL:!ADH:!RC4:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT
Posted in Uncategorized | Leave a comment