samba useful commands
Check whether the config file is correct # testparm List connected users and locked files # smbstatus List the shares of a host # smbclient -L <host> -N Lookup NetBIOS…
mysql: show grants of all users
Unfortunately, there's no a single MySQL command to display all privileges granted to all users, but that information can be gathered with the following procedure: 1. Login as root (or…
SOCKS proxy setup
A SOCKS proxy is very useful in case you want to surf the web securely over an insecure network or behind a very restrictive firewall. It's very easy to configure…
apache: enable .htaccess support
Do the following in order to enable .htaccess support: 1. Check if the module rewrite_module is loaded: # httpd -M | grep rewrite_module (in FreeBSD) # apachectl -M | grep…
Set up a master/slave replication in MySQL
Follow this step by step procedure to replicate a MySQL server (master) to another (slave): 1. CONFIGURE THE MASTER Enable binary log. To do this, add in / under section:…
How to flush / clear DNS cache
Here's how to flush the DNS cache (depending of the OS): In OS X For OS X and later: $ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder For OS X…
SSH login without password
To enable access to a remote host requiring a password, follow this procedure: 1. Generate SSH keys in the local host # ssh-keygen -t rsa -b 2048 -N '' This…
SSH troubleshooting
ERROR: Permission denied (publickey). This message appears when the remote ssh server has password authentication disabled. To fix this, edit /etc/ssh/sshd_config to enable password authentication: PasswordAuthentication yes Restart the SSH…
git: create a remote repository
If you have a local repository and want to create your own remote git repository as a backup (or share your work with others, here's what you need to do:…
apache: fixing ‘config variable XX is not defined’ error
PROBLEM: You try to execute from a shell some apache command like this: # apache2 -t -D DUMP_MODULES and you get the following error messages: AH00111: Config variable ${APACHE_LOCK_DIR} is…