Archive for the ‘Software’ Category

Fix from address (root@localhost.localdomain) in sendmail

Posted 322 days ago by Alex in Randomness, Software, Technology

I’m usually a postfix guy. That’s what I run on my servers and it’s the configuration I understand. So when someone asked me to take a look at an issue on a server running sendmail, I was a bit befuddled.

The problem was that any messages sent from the command line, were arriving with a from address of root@localhost.localdomain. This was a bit of a problem. To test and confirm I ran the following:

echo "Who will this message be addressed from?  The world may never know." | mail -s "Testing sendmail" alex

And sure enough, I get an email address from root@localhost.localdomain. I end up Googling combinations of ‘root@localhost.localdomain’, ‘localhost.localdomain’ and ‘sendmail’. The options were pretty much useless. Too much noise about changing the sendmail configuration options.

In the end, I stumbled upon the real way to fix it…. Open /etc/hosts and change add the host’s name before the localhost.localdomain entry on the first line.

127.0.0.1     host.foobar.com host localhost.localdomain localhost
::1           localhost6.localdomain6 localhost6

Turns out, sendmail looks for the first hostname in the hosts file for the loopback address and uses that in the from field when a from address isn’t specified by the mail client.

Installing FreeNAS to a flash drive on a Mac

Posted 347 days ago by Alex in Hardware, Interesting Links, Software, Technology

I’m building a NAS and decided to use FreeNAS to deploy it (rather than buy a hardware solution). The installation instructions were easy enough though they didn’t include instructions on how to install FreeNAS onto a flash drive while running a Mac. I found a 512MB flash drive that was perfectly suitable for the install.
Note: The instructions below include terminal commands. The command is presented with an example of expected output.

  1. Download the latest release of FreeNAS from the downloads page. The version I downloaded was titled ‘FreeNAS-amd64-embedded-0.7.2.5543.img’. Make sure you get the .img file, not the .iso.
  2. Plug your flash drive into your computer and open a new terminal window.
  3. Using diskutil, find the device node for your flash drive:
    mac:~ alex$ diskutil list
    /dev/disk0
       #:                  TYPE NAME                    SIZE       IDENTIFIER
       0: GUID_partition_scheme                        *500.1 GB   disk0
       1:                   EFI                         209.7 MB   disk0s1
       2:             Apple_HFS Macintosh HD            499.8 GB   disk0s2
    /dev/disk1
       #:                  TYPE NAME                    SIZE       IDENTIFIER
       0:                       CDROM                  *512.5 MB   disk1
  4. The flash drive’s device node in the above output is /dev/disk1. Now, unmount the drive:
    mac:~ alex$ diskutil unmountDisk /dev/disk1
    Unmount of all volumes on disk1 was successful
  5. Next, we’ll extract the image’s contents onto the flash drive. Warning: This will delete all of the data off of the drive.
    mac:~ alex$ sudo dd if=~/Downloads/FreeNAS-amd64-embedded-0.7.2.5543.img of=/dev/disk1
    203632+0 records in
    203632+0 records out
    104259584 bytes transferred in 66.608632 secs (1565256 bytes/sec)
  6. Lastly, eject the drive.
    $ diskutil eject /dev/disk1
    Disk /dev/disk1 ejected

Now you can use the flash drive to boot off of and run your FreeNAS instance from. Good times!

MAMP? More like LAMP.

Posted 351 days ago by Alex in Interesting Links, Internet, Software, Technology

So I was looking for web servers to run on my MBP. I came across MAMP which looks like a pretty good piece of software. While downloading I became curious if the MAMP team actually used MAMP servers.

Checking the HTTP headers revealed the following:

Server: Apache/2.2.4 (Linux/SUSE)

I’ll take that as a No.

For the record, I use the LAMP stack for my sites. I am messing around with offline development and needed an environment.

List last modified file in all subdirectories

Posted 441 days ago by Alex in Code, Randomness, Software

I don’t know when someone would use this little snippet, but I think it’s useful.

It will open every directory in /home and retrieve the last modified file in all subdirectories under that directory. Then it will print out the file’s modification time and path. This might be useful for a system administrator who wants to see when the last time a user modified a file in their home directory.

for i in `find /home -maxdepth 1 -mindepth 1 -type d`; do
  cd $i
  find `pwd` -type f -printf "%TY-%Tm-%Td %TT %p\n" | sort | tail -n 1
done

To run it, save the code as ‘directory-age-check.sh’ and run:

 sudo ./directory-age-check.sh | sort 

MineDraft.net

Posted 466 days ago by Alex in Interesting Links, Internet, Software

MineDraft

I, like many other Minecrafters, have lots of wonderful ideas to share with the Minecraft community. Frequently, we share our ideas by starting Minecraft, building our idea and taking screenshots and videos. These images and videos are uploaded to imgur or youtube and the links are shared. I found this to be a bit of a hassle.

Thus, MineDraft was born. With MineDraft, you can create your ideas in a simple to use interface, create a link to the design and share it with your friends. No more video editing or image cropping. No need to upload anything. Just draft and share.

MineDraft.net

Check it out on Reddit too!

Diaspora Released to Developers

Posted 509 days ago by Alex in Interesting Links, Internet, Software

The Diaspora Team made available the first public release of the new Diaspora open source social networking platform. I spent a couple hours tonight installing and playing around with it. So far, it looks pretty good. It’s very usable though not without its bugs. Since it’s a developer release, bugs are expected, right?

More information is here: http://www.joindiaspora.com/2010/09/15/developer-release.html