Archives
Admin / Logout

Adam Merrifield

a picture of me
I am a theme developer, a coder and internet personality.

what i am

I am the owner and operator of seyDoggy Systems, a small theme, code and design outfit based in Kitchener, Ontario, Canada. We primarily develop web based technologies but have begun to dabble in the desktop realm.

what i do

I code like a fool. I design like a fool. I am happiest when I can split my time between the two (though I tire of Photoshop faster then I do Sublime Text 2 or Terminal), and somehow I have managed to etch out a living doing so.

Dropping sendmail-postfix for msmtp

Apple OS X 10.8 Server.app was the worst move I ever made. The mail server issues in 10.8 Server.app were well known and I was too impatient to wait for fixes at the time of it’s launch. I’m used to running at the low level of the unix core, configuring mail servers and web servers manually so when I went to the GUI goodness of Server.app I was, to say the least, out of my element. I couldn’t leave the manual settings alone, while Server.app insisted on re-managing things for me. Add to that, every Server.app update tended to break things I’d previously configured.

I played this cat and mouse game with Server.app until finally any combination mail, postfix and sendmail was completely broken. Short of a clean install I was dead in the water as far as a mail server was concerned. Even the techs at Apple had no advice.

Having been a fan of msmtp on my Linux servers I figured, why not. Homebrew to the rescue…

  1. Install msmtp via homebrew (Terminal) [NOTE: Don't have homebrew?]:

    $ brew install msmtp --with-macosx-keyring
    
  2. Create or edit your ~/.mailrc to include:

    set sendmail=/usr/local/bin/msmtp
    
  3. Create or edit your ~/.msmtprc to include (replace with your credentials):

    # Example for a user configuration file
    
    # Set default values for all following accounts.
    defaults
    tls on
    logfile ~/.msmtp.log
    
    # A gmail service
    account [email protected]
    host smtp.gmail.com
    port 587
    protocol smtp
    auth on
    from [email protected]
    user [email protected]
    tls on
    tls_starttls on
    
    # Your mac should have certificates in /etc/certificates/
    # Pick one, if it doesn't work, try another one.
    # If you have no certicicates there then Google it.
    tls_trust_file /etc/certificates/Server Fallback SSL Certificate.5522E4EEF50C3C50FC549364EA761E7E3C4C3503.cert.pem
    
    # Set a default account
    # You need to set a default account for Mail
    account default : [email protected]
    
  4. Give your ~/.msmtprc the right permissions (Terminal):

    $ chmod 0600 ~/.msmtprc
    
  5. Create a new password item in Keychain Access (Keychain Access > File > New Password Item) with the following data (replace with your credentials):

    Keychain Item Name: smtp://smtp.gmail.com
    Account name: [email protected]
    Password: secret
    
  6. To test, run the following command (Terminal) [NOTE: click "Allways allow when the Keychain authorization request pops up"]:

    $ echo "Hello world" | Mail -s "msmtp test at `date`" [email protected]
    

SOURCES: msmtp, a free tool to send email from Terminal, send eBooks to your kindle, Use Mutt with Gmail

Comments (1) | Trackback

Cedar trail drm driver in DKMS format

If you use lubuntu–pure lubuntu, not just the lubuntu desktop environment installed over top of an Ubuntu install–then you’ve probably found that installing the proprietary cedarview driver for GMA3600 support can leave your GUI desktop unusable (black, dead, unbootable).

Here is the trick for getting things to work.

1. *Before* installing the driver, make a backup copy of lightdm.conf. In Terminal (Ctrl+Alt+T or Applications > Accesories > LXTerminal), enter the following:

sudo cp /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.bak

2. Activate the driver from Applications > Preferences > Additional Drivers.
3. After a while your screen will likely go black and nothing you do will bring it back. Give it another minute or two, then switch to console mode by typing Ctrl+Alt+F1
4. Log in to console mode with your credentials and type the folling:

sudo cp /etc/lightdm/lightdm.conf.bak /etc/lightdm/lightdm.conf

5. Then reboot by typing:

sudo reboot -h now

Now when you login you’ll have a working GUI and decent support for the GMA3600.

| Trackback

Postfix, Gmail and Mountain Lion Server

What a headache it’s been to get my mail server up and running — consistently — on Mac OS X 10.8! I guess the powers-that-be at Apple felt that it’d be a good idea to shift from /etc/postfix/ to /Library/Server/Mail/Config/postfix/ because… I don’t know, it has a proprietary ring to it perhaps? Who knows? Whatever the case it looks as though the transition was only partially complete, in that not all the paths were written and not all the directories were made.

If you’re like me and you’ve tried to strong arm control back over to /etc/postix then you’ve likely been just as frustrated that every time Apple updates the Server.app or serveradmin CLI (now burred deep within the Server.app, worth finding and adding to your $PATH) then all your s#!t breaks and you have to go back and do it again. Yeah for Apple Draconianism.

Since I can’t beat them, I might as well join them. So here are the steps to get Gmail piping out messages a la mail/sendmail/postfix from your command line with Mountain Lion 10.8, migrating from configurations in /etc/postfix/ to /Library/Server/Mail/Config/postfix/.

Assumptions

I assume a few things here:

  1. You have Server.app installed on your Mac.
  2. You’re comfortable in the command line.
  3. serveradmin have been buried recently. I suggest you add /Applications/Server.app/Contents/ServerRoot/usr/sbin to your $PATH.
  4. When I say “edit such-an-such file”, I assume that you have sudoer privileges and and an editor (VIM, Nano, TextMate, Sublime Text 2, etc…) that can edit these system files. In all of these examples I use subl for SublimeText, so substitute your favorite editor there.
  5. Backup, backup, backup. Don’t edit any of these files without making a backup copy first.
  6. Since you’re here, let’s assume that you already know why you want to do this and how to use command-line mail.

How to

  1. Stop the mail and postfix services:

    $ sudo serveradmin stop mail
    $ sudo postfix stop
  2. Let’s make sure you have the spool directory (one of those folders not originally created with the original release of the OS X 10.8 Server.app):

    $ sudo mkdir -p /Library/Server/Mail/Data/spool
  3. Open the postfix launch daemon:

    $ sudo subl /System/Library/LaunchDaemons/org.postfix.master.plist
  4. Replace the plist contents with:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
        <key>AbandonProcessGroup</key>
        <true/>
        <key>Label</key>
        <string>org.postfix.master</string>
        <key>OnDemand</key>
        <false/>
        <key>Program</key>
        <string>/usr/libexec/postfix/master</string>
        <key>ProgramArguments</key>
        <array>
                <string>master</string>
        </array>
        <key>QueueDirectories</key>
        <array>
                <string>/Library/Server/Mail/Data/spool/maildrop</string>
        </array>
        </dict>
    </plist>
  5. Unload/reload the plist:

    $ sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist
    $ sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist
  6. Open the main.cf:

    $ sudo subl /Library/Server/Mail/Config/postfix/main.cf
  7. Find and replace all instances of /etc/postfix/ with /Library/Server/Mail/Config/postfix/

  8. Add the following lines to the bottom:

    # my main.cf edits
    relayhost = [smtp.gmail.com]:587
    smtp_generic_maps = hash:/Library/Server/Mail/Config/postfix/generic
    smtp_tls_loglevel=1
    smtp_tls_security_level=encrypt
    smtp_sasl_auth_enable=yes
    smtp_sasl_password_maps=hash:/Library/Server/Mail/Config/postfix/sasl/passwd
    smtp_sasl_security_options = noanonymous
    smtp_use_tls = yes
  9. Find out who you are:

    $ whoami
  10. Open the aliases file:

    $ sudo subl /Library/Server/Mail/Config/postfix/aliases
  11. Find the line #root: you, uncomment it and replace “you” with the results of whoami:

    # Person who should get root's mail. Don't receive mail as root!
    root: adam 
  12. Initialize the alias database:

    $ sudo newaliases
  13. Find out your machine name:

    $ hostname
  14. Open the generic file:

    $ sudo subl /Library/Server/Mail/Config/postfix/generic
  15. Add these lines to the end (with your credentials in place of whoami and hostname):

    # my generic edits
    whoami@hostname [email protected]
    @hostname [email protected]
  16. Create a password file:

    $ sudo mkdir -p /Library/Server/Mail/Config/postfix/sasl 
    $ sudo subl /Library/Server/Mail/Config/postfix/sasl/passwd
  17. Add the following (with your credentials):

    [smtp.gmail.com]:587 [email protected]:yourpassword
  18. Set postfix permissions:

    $ sudo postfix set-permissions
    $ sudo postmap /Library/Server/Mail/Config/postfix/sasl/passwd
  19. Start the mail services:

    $ sudo postfix start 
    $ sudo serveradmin start mail
| Trackback

Setting Up The Mail Service in Mountain Lion Server | Krypted.com

“Mail is one of the hardest services to manage. Actually, mail is pretty simple in and of itself: there’s protocols people use to access their mail (such as IMAP and POP), protocols used to communicate between mail servers and send mail (SMTP, SMTPS)  and then there’s a database of mail and user information. In Mount Lion Server, all of these are represented by a single ON button, so it really couldn’t be easier. But then there’s the ecoysystem and the evil spammers.” — via Setting Up The Mail Service in Mountain Lion Server | Krypted.com.

| Trackback

sendmail program – Enabling postfix for outbound relay via Gmail

“Mac OSX comes with the postfix MTA, which is a fully featured SMTP server. Under normal circumstances, there is usually no need to enable or configure this software, as most email access is usually done via GUI clients such as the Mail.app – which uses the POP/IMAP and SMTP settings to connect with the email service provider.” — via sendmail program « /usr.

| Trackback

The innovations of Internet Explorer | NCZOnline

“Long before Internet Explorer became the browser everyone loves to hate, it was the driving force of innovation on the Internet. Sometimes it’s hard to remember all of the good that Internet Explorer did before Internet Explorer 6 became the scourge of web developers everywhere. Believe it or not, Internet Explorer 4-6 is heavily responsible for web development as we know it today…” — via The innovations of Internet Explorer | NCZOnline.

| Trackback

go-tool for quick directory switching

“go is a small shell command for changing directories quickly. Typically you have a set of directories that you work in. Typing out the names of those dirs in full can be tedious. go allows you to give a shortcut name for a directory…” — via go-tool – a command-line tool for quick directory switching – Google Project Hosting.

| Trackback

How to install Sublime Text 2 on Linux

“Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now.I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post will show you how to integrate Sublime Text to Unity which, I’m glad to report, has now matured into a fully functional user interface.” — via How to install Sublime Text 2 on Ubuntu 12.04 Unity | Technoreply.

| Trackback

You Don’t Need The Xcode “Command Line Tools” | Cocoanetics

When Apple made Xcode into its own app bundle it greatly simplified our lives as developers. This enabled incremental updates for the stable version can get from the app store. Also you get updates the same way as updates for other apps.To cut down on file size Apple made several items optional downloads, like the documentation, older versions of Simulator or Command Line Tools. The latter you need if you are building stuff outside of Xcode, like Open Source projects. You know, bare knuckles, command line geekery.However those tools are not needed if you want to say use svn or git. This article explains why.

via You Don’t Need The Xcode “Command Line Tools” | Cocoanetics.

| Trackback

Coloration – editor color scheme converter

coloration is editor/IDE color scheme converter. Right now it allows you to convert your favourite Textmate color scheme (in XML plist format) to Vim, JEdit and KDevelop/Kate/Kwrite color scheme. It tries to do its best to generate the most accurate result for given target.

via Coloration – editor color scheme converter.

| Trackback
Powered by RapidWeaver, WP-Blog and WordPress 3.5.1