Archive for the 'FreeBSD' Category

Creating Useful Bash Aliases

Bash can be configured to recognize any word you want and link it to a command. This is called an alias. This is can be used for many reasons. For instance, you could assign a short word like dvdbackupnow to execute a very long command that you don’t want to memorize each time you want to back up a DVD. We will explore a few useful aliases and how to add them to bash. Read more »

Encrypt a File on Linux or FreeBSD with GnuPG

If you ever wanted to quickly encrypt a file in Linux or FreeBSD without complicated keyrings and key files this is the post for you. In this guide we will use gnupg to quickly encrypt any file in Linux or FreeBSD. We will keep it simple and easy and leave out public/private key ring authentication and stick with simple password phrase encryption. Unlike password protection in zip files and other weak security implementation, PGP or GnuPG is a very secure way of encrypting files. It is pretty easy to set up so lets get going. Read more »

Numbering Each Line in a Text File

Sometimes we are given an error message that references a line number in a text file. We can number each line so we can find the error message right a way. In fact, we can print out the exact line that contains the error. This is often useful for finding errors in PHP. If there is an error in the syntax of PHP it will give you the line number it is on. Often times I don’t work in an environment that shows line numbers and I am not about to count each line by hand. Read more »

Finding Ports to Install in FreeBSD

FreeBSD is founded on the idea that compiling is faster/better than using pre-made packages. To make compiling easy FreeBSD uses a “package management” system called ports; however, it is difficult to find the port to compile since FreeBSD’s package management system is really just empty directories with build instructions. These directories are categorized by the package application so that you can browse them, but it is difficult sometimes to find a package. Read more »

First Time Upgrading FreeBSD

If you remember from my post on my Initial Impression of FreeBSD 7.0 I am fairly new at using FreeBSD. After my recent Wordpress SQL Injection Attack I went around updating everything that I could get my hands on. A FreeBSD server happened to be one of those things that need updating. Read more »

Securely Wipe a File with DD

Sometimes we have sensitive data that we want to get rid of. Since deleting a file doesn’t actually prevent it from being recovered we need to do some extra steps to ensure that it can’t be recovered. In this post we will use DD to complete this task. DD is often the tool digital forensics use to duplicate hard drives we will use it for a more destructive use so that our data can’t be recovered. Read more »

Use Rsync for Daily, Weekly and Full Monthly Backups

Today, we will be using rsync to make daily, weekly, incremental backups and then a full compressed/archived backup once a month. We will then use cron to automate the process. Lets face it us humans get lazy sometimes and most backup systems loose complete effectiveness if they are not completely automated. Read more »

Duplicating a CD with DD

Want to make an exact copy of a CD without installing k3b or some other burning software? You can do it in Linux/Freebsd with one line of code using dd. The nice thing about dd is that it will make a disk level duplicate of the CD. It should be a 100% exact copy. Read more »

Next Page »