12.4 C
San Antonio, TX
Home Blog

Build a Dynamic DNS Client with Rackspace API


This time I’ve want to create a homemade Server with my Raspberry Pi2 and publish it using my own sub-domain, the main problem is that the ISP provide me an dynamic IP and we should ensure that if my IP address change the sub-domain record should point to the new IP.

The instructions assume that you:
– Have a domain
– Have already changed your NS records to point to dns1.stabletransit.com and dns2.stabletransit.com.

1.- You should download the latest version of rsdns from github

2.- Go to your Rackspace portal (https://mycloud.rackspace.com/) and grab your Username & API key (It’s under “Your Account” -> “Account Settings” -> “API Key)

3.- Create a configuration file for rsdns (~/.rsdns_config) with your settings.

4.- You need your domain created on Rackspace(It’s under “Networking” -> “Cloud DNS” -> “Create Domain”) if you don’t have your domain created you are able to created using rsdns:

5.- Once you have a domain setup you need to create an A record. To create the A record you going to need an IP address, you can use http://icanhazip.com to get your actual current IP. Again to create a record you are able to do it from Rackspace panel (It’s under “Networking” -> “Cloud DNS” -> YOUR_DOMAIN -> “Add Record”) or you can use rsdns:

In the above the TTL is set to 1hr (3600 secs), this is so that DNS caches do not keep the record too long. That’s all the pre-work done, now lets get your dynamic host setup!

6.- The script to update your a record is rsdns-dc.sh, and you run it like this:

The script uses icanhazip to get your current IP, it then update the A record with it.

I never switch off my router so I have create a created a cronjob to run that script every 2 hours, plus the 1hr TTL should mean that the record is roughly in sync with my IP without making unnecessary requests

7.- I use CentOS, so I can simply drop the following file called rsdns-dc into /etc/cron.d/ with this…

Now we are done! Private Dynamic DNS on your own zone using the Rackspace API.

Spamassassin Error: cannot create user preferences file //.spamassassin/user_prefs: Permission denied on VestaCP – CentOS


When yo configure spamassassin on VestaCP (CentOS) sometimes you might have some problems with the autolearn feature and also with the bayes plugin of spamassassin.
The error looks like:

Basically the error are the permissions on: //.spamassassin/user_prefs

To fix it follow the next steps:

– Create the user spamd, in order to avoid to run spamassassin with the user nobody:

– Edit the file /etc/exim/exim.conf.

Change the line:


– Restart exim an spamassassin

After that verify that the files bayes_seen, bayes_toks and user_prefs exists on the spamd home (In this case /var/lib/spamassassin)


SFTP Jailed

SFTP Jailed

To configure your server to use a jailed user on SFTP you should do:

1. Edit the sshd_config file
We need to comment the following line:

And add the uncomment line, your modification will be same as:

Also, at the end of the file we should to add the next lines:

After save all the changes, we must restart the sshd daemon

2. Add sftponly group

3. Add jailed user and add to sftponly group

4. IMPORTANT – Create directory and establish correct permissions

*** If you have any connection problem please double check the permissions on the folders and check the logs on /var/log/secure ***

5. Mount DocumentRoot path on jailed user home directory

6. Make the mount point permanent, editing the fstab file:

Add the mount point at the end of the file:

Save and exit

7. Test connection:

View sources IP’s in Apache Logs

Cloud Load Balancer
Cloud Load Balancer

When you use the Rackspace Cloud Load Balancers, it is common that the IP logged in Apache is the Private IP (ServiceNet) from the Cloud Load Balancer, however, we can fix that.
We can view sources IP’s in Apache Logs doing some changes on Apache configuration file and also on the vhosts configuration files.
On your Apache configuration file, you should to find the line:

Modified to:

And also, on your vhosts configuration files you should to change the “combined” LogFormat definition will then be called in a “CustomLog” entry specific to your VirtualHost configuration. Here is an example VirtualHost definition to show you what I’m referring to:

After adding the X-Forwarded-For definition to the LogFormat definition, you can restart Apache and view the logs to notice the difference. If all is done properly, you will see an actual public IP in the first field of your logs instead of the Cloud Load Balancer IP.

Yosemite stuck on boot process


Sometimes, I’m having problems whit my Mac, when it’s sleep (hibernate) and I tried to “wake up” the Mac don’t start, and show me a Black Screen. So, I’ve rebooted and after that it is stuck on the boot process.
So, I’ve found these solution to avoid that Yosemite stuck on the boot process:

A.- Enter to Single-user or verbose mode
1. Shutdown the Mac
2. Pres the power button to start the computer
3. Immediately press and hold the Command Key and either of the following

  • the “s”key for single-user mode (Command-S)
  • the “v”key for verbose mode (Command-V)

B.- When you login on the Mac, you should run the following commands:

After the reboot, your Mac will boot as always. 🙂