Enable Key based SSH (for machine to machine talking (backup, etc))

Thanks to Dan for expediting this one! mikrodots@MikroDroplet:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/mikrodots/.ssh/id_rsa): Created directory ‘/home/mikrodots/.ssh’. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/mikrodots/.ssh/id_rsa. Your public key has been saved in /home/mikrodots/.ssh/id_rsa.pub. The key fingerprint is:[…]

Unix set Hostname

Set Hostname: (Derive what you need from the following): root@MikroDroplet:/home/mikrodots# hostname MikroDroplet root@MikroDroplet:/home/mikrodots# cat /etc/hostname MikroDroplet root@MikroDroplet:/home/mikrodots# cat /etc/hosts 127.0.0.1 MikroDroplet.MikroManage.com MikroDroplet localhost root@MikroDroplet:/home/mikrodots# hostname MikroDroplet root@MikroDroplet:/home/mikrodots# hostname -f MikroDroplet.MikroManage.com

Ubuntu UFW – Uncomplicated Firewall

Ensure you are firewalled: root@MikroDroplet:/home/mikrodots# apt-get install ufw Reading package lists… Done Building dependency tree Reading state information… Done ufw is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. root@MikroDroplet:/home/mikrodots# ufw allow 22/tcp Rules updated Rules updated (v6) root@MikroDroplet:/home/mikrodots# ufw enable Command may disrupt existing ssh connections.[…]

Root Cron to run Python

I was having some issues with a cron job I created as root using crontab -e the entry was: */15 * * * * /path/to/file.py After ripping my hair out overnight (Troubleshooting tips): tail /var/log/cron (checks if it is running) add a line to your crontab: MAILTO=”you@domain.com” – will email you debugging info Here’s the[…]

MySQL on FreeBSD 10

# pkg install mysql56-server # echo ‘mysql_enable=”YES”‘>>/etc/rc.conf # service mysql_server start # mysql -u root mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘rootpwd’); mysql> SET PASSWORD FOR ‘root’@’host_name’ = PASSWORD(‘rootpwd’); # mysql -u root mysql> SET PASSWORD FOR ”@’localhost’ = PASSWORD(‘anonpwd’); mysql> SET PASSWORD FOR ”@’host_name’ = PASSWORD(‘anonpwd’); mysql> CREATE USER ‘colin’@’localhost’ IDENTIFIED BY ‘SuperPassword!’; mysql>[…]

Debugging Python and Ruby

Both Command Line based debuggers are very similar. Python: http://docs.python.org/2/library/pdb.html : # python -m pdb debugfile.py Once in: b (line #) – sets breakpoint s – step into n – next c – continue r – run til return Ruby: http://www.tutorialspoint.com/ruby/ruby_debugger.htm : # ruby -r debug debugfile.rb Once in: b (line #) – sets breakpoint[…]