February 10, 2018 tim

You learn something new everyday and yesterday I discovered an awesome way to check the weather from a command line using wttr.in that will work with FreeBSD, Linux, Mac OS X, and any system that has cURL installed on it which is also available for windows. Download cURL for Windows Most Linux distributions ship with cURL and on FreeBSD it can be installed via pkgng like so # pkg install -y curl Now let’s check the weather # curl wttr.in Since wttr.in is geographically aware you will not have to specify your location, however if you are behind a VPN…

January 14, 2018 tim

In this tutorial we will cover how to export a list of all packages and their dependencies that have been installed via pkgng. This is useful when you need to rebuild a system from scratch or setup a new FreeBSD server that requires the same packages as an existing system. This is how we do it. On existing system run pkg prime-list > requirements.txt make a copy of requirements.txt  so you will have it in a time of need, or if you are just building an identical system copy it to the system using scp like so scp requirements.txt username@host:/some/remote/folder/…

April 15, 2017 tim

Recently I had a client who had a list of zip codes (Like everyone in the state of  Massachusetts) he wanted to create folders of each zip code on this list. This could have taken some time but thanks to my awesome skills and some Google-Fu I was able to work out a solution to do this on FreeBSD and in the process found the commands to create directories from a .txt list on Windows and Macs. In these examples we have a list of folder names in folders.txt and we run the below commands within the same directory as…

February 21, 2017 tim

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group (ISRG). More details can be found here https://letsencrypt.org/how-it-works/ This tutorial assumes you already have an existing website hosted with FreeBSD and an nginx reverse proxy. If you are using apache read this https://www.debarbora.com/Let’s-encrypt-SSL-Certificate-with-FreeBSD-&-Apache We start by installing https://certbot.eff.org/ # pkg install -y py27-certbot Request and download an SSL certificate by running the following command. temporarily stop nginx # service nginx stop # certbot certonly Select option 2) spin up a temporary webserver (standalone)…

February 20, 2017 tim

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group (ISRG). More details can be found here https://letsencrypt.org/how-it-works/ This tutorial assumes you already have an existing website hosted with FreeBSD and apache24. I will be posting another tutorial on using Let’s encrypt for nginx shortly. We start by installing https://certbot.eff.org/ # pkg install -y py27-certbot Request and download an SSL certificate by running the following command # certbot certonly Select option 1) Place files in webroot directory (webroot) and answer the remaining questions. our…

December 20, 2016 tim

In this tutorial we will cover how to mount an NFS share on FreeBSD 11. We will only be covering the client side of things in this post, for more information on how to setup a robust NFS server, check out http://www.freenas.org/ Configure the system start up with NFS client parameters. # nano /etc/rc.conf add this nfs_client_enable=”YES” nfs_client_flags=”-n 4″ rpc_lockd_enable=”YES” rpc_statd_enable=”YES” create a folder to mount the share # mkdir /mnt/nas02 Now we can map our NFS share like so # mount_nfs SERVER_IP:/path/on/nas /mnt/nas02 NFS shares can be automatically mounted # nano /etc/fstab add this SERVER_IP:/path/on/nas /mnt/nas02 nfs rw 0…

December 19, 2016 tim

All production servers need monitoring with email alerts so you know when the server is having trouble or is under heavy load. In the IT solution industry there is no shortage of monitoring and management tools out in the wild. Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance, repair, and can execute meaningful causal actions in error situations. This tutorial will cover locally installing, configuring, and testing monit. This setup requires that your FreeBSD system is able to send emails http://debarbora.com/FreeBSD-10.1-setup-ssmtp-For-Outgoing-Mail Install Monit # pkg install -y monit Set monit to…

August 13, 2016 tim

When using nginx as a reverse proxy for Apache servers, one of the first things you will notice is the back end Apache server logs will show all connections are made from the IP address of the proxy. Enter mod_rpaf2 an Apache module able to analyze X-Real-IP headers and pass the clients IP address to the back end Apache server thus logging the correct IP of website visitors. This tutorial assumes that you are using nginx as a front end proxy for apache24 and the nginx config file has the following headers in place proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;…

August 13, 2016 tim

osTicket (http://osticket.com/download) is a widely-used and trusted open source support ticket system & for those of you bold enough to host osTicket on your own without using a hosted solution, will find that there is no backup utility out of the box. In this post I will share my solution for backing up OSTicket and other LAMP/FAMP stack applications as well. I have created two scripts that we have used for the last 12 months on our production servers at work and it has saved my bacon more than once. Having both an automated backup and an offsite backup was…

June 13, 2016 tim

Like any other software it’s important to apply security updates as they are released, Drupal is no different. In this tutorial we will use a bash script and cron to auto apply Drupal security patches on a daily basis. This tutorial assumes you have Drupal 7 or 8 and drush installed on your FreeBSD server. I like to keep all of my scripts in /root/scripts, create this directory if you don’t already have a location for your bash scripts. # mkdir /root/scripts Create a script for automating Drupal updates # nano drupal_security_updates.sh Add this to the empty script file (where…