{"id":444,"date":"2012-07-15T10:21:02","date_gmt":"2012-07-15T17:21:02","guid":{"rendered":"http:\/\/www.lothlorien.com\/kf6gpe\/?p=444"},"modified":"2012-07-15T10:21:31","modified_gmt":"2012-07-15T17:21:31","slug":"before-we-begin-with-haskell-yesod-the-environment","status":"publish","type":"post","link":"https:\/\/www.lothlorien.com\/kf6gpe\/before-we-begin-with-haskell-yesod-the-environment\/","title":{"rendered":"Before we begin with Haskell &#038; Yesod: the environment"},"content":{"rendered":"<p>So, a word about the environment I&#8217;m going to use. I&#8217;m going to do my general hacking in Haskell on Ubuntu 12.04, running on either my MacBook Air or a Nokia Booklet 3G, depending on what&#8217;s closer. I&#8217;ll be using the haskell-platform installed from the stable debian repository. As I want to push things into a &#8220;production&#8221; instance, I&#8217;m going to be hosting things on Amazon&#8217;s EC2 &#8212; if I get serious about this project and want to share data, I&#8217;ll scale out on EC2.<\/p>\n<p><strong>Getting Started: Ubuntu on the MacBook Air<\/strong><br \/>\nInstalling Ubuntu Desktop i386 12.04 on my MacBook Air was a bit of a trial, and I didn&#8217;t document all the steps thoroughly. The general approach was to follow the steps at the Ubuntu site <a href=\"https:\/\/help.ubuntu.com\/community\/MactelSupportTeam\/AppleIntelInstallation\" target=\"_blank\">here<\/a>, although one thing I did that gave me problems was to create a separate partition on the drive for the installation media, because doing that meant that I couldn&#8217;t repartition the disk when I did the install. Eventually, I was able to make a bootable USB stick, boot the USB stick using rEFit, format the new partitions, and I was set. Dual-booting between Ubuntu and Mac OS X using both the built in ssytem and rEFit works great.<\/p>\n<p><strong>Getting Started: Ubuntu on the Nokia Booklet 3G<\/strong><br \/>\nI have a special place in my heart for the Nokia Booklet 3G, because the darned thing is indestructible, and sports a 3G modem for anywhere-wireless connectivity. Unfortunately, it feels about as slow as the VAX 11\/70 I shared with sixty university students the week before finals, so it doesn&#8217;t get as much love from me as it otherwise might. But I prefer its keyboard over that on the MacBook Air, actually, and the pretty blue cover just looks sweet.<\/p>\n<p>Earlier releases of Ubuntu on the Booklet were pesky to set up because of the stupid integrated graphics driver, but that&#8217;s been well-documented for some time. Here&#8217;s what I did to get things running:<\/p>\n<ol>\n<li>Use UNetBoot to create a bootable USB stick with Ubuntu Desktop i386 12.04.<\/li>\n<li>When booting from the stick, switch to the console using ctrl-alt-f1, log in, and<br \/>\n<code>sudo lightdm restart<\/code> to get past the black screen.<\/li>\n<li>Run the installer as normal.<\/li>\n<li>When the system reboots, switch to the console using ctrl-alt-f1, log in, and<br \/>\n<code>sudo lightdm restart<\/code> to get past the black screen.<\/li>\n<li>Fix the video issue permanently on boot by editing the grub configuration: change <code>GRUB_CMDLINE_LINUX_DEFAULT<\/code> in \/etc\/default\/grub to <code>\"quiet console=tty1 acpi_backlight=vendor acpi_osi=Linux mem=896mb\"<\/code> and update grub using sudo update-grub.<\/li>\n<li>Fix a problem with the trackpad during standby by editing \/etc\/pm\/config.d\/gma500 and adding the line <code>ADD_PARAMETERS='-quirk-vbemode-restore'<\/code>.\n<\/ol>\n<p><strong>Getting Started: Getting Haskell and Yesod on Ubuntu<\/strong><br \/>\nOnce you&#8217;ve got Ubuntu all set up and updated with the latest packages, open a shell and run:<br \/>\n<code><br \/>\nsudo apt-get update<br \/>\nsudo apt-get install emacs23<br \/>\nsudo apt-get install haskell-platform<br \/>\nsudo apt-get install haskell-mode<br \/>\n<\/code><br \/>\nNow, add <code>$HOME\/.cabal\/bin<\/code> to your path in your .bashrc or the shell configuration of choice, and reload the shell configuration file.<br \/>\n<code><br \/>\ncabal update<br \/>\ncabal install yesod-platform<br \/>\n<\/code><br \/>\nto install yesod. <\/p>\n<p><strong>Getting Started: Getting Haskell and Yesod on EC2<\/strong><br \/>\nI couldn&#8217;t get a base AMI instance running with a later version of the haskell platform &#8212; I chose an instance that was too small and cabal failed to build. Picking a bigger instance, I couldn&#8217;t get the Haskell platform to build with the version of ghc that I chose. I then moved to using a RedHat instance backed by ebs, and as root:<\/p>\n<p><code><br \/>\nyum update<br \/>\nyum install gmp-devel<br \/>\nrpm -Uvh http:\/\/download.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-6-7.noarch.rpm<br \/>\nyum install haskell-platform<br \/>\n<\/code><\/p>\n<p>To get Yesod running, as your development user:<br \/>\n<code><br \/>\ncabal update<br \/>\ncabal install yesod-platform<br \/>\n<\/code><\/p>\n<p>Next up: setting up my first site!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, a word about the environment I&#8217;m going to use. I&#8217;m going to do my general hacking in Haskell on Ubuntu 12.04, running on either my MacBook Air or a Nokia Booklet 3G, depending on what&#8217;s closer. I&#8217;ll be using the haskell-platform installed from the stable debian repository. As I want to push things into &hellip; <a href=\"https:\/\/www.lothlorien.com\/kf6gpe\/before-we-begin-with-haskell-yesod-the-environment\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Before we begin with Haskell &#038; Yesod: the environment<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43,9,44],"tags":[],"class_list":["post-444","post","type-post","status-publish","format-standard","hentry","category-haskell","category-programming","category-yesod"],"_links":{"self":[{"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/posts\/444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/comments?post=444"}],"version-history":[{"count":19,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/posts\/444\/revisions\/472"}],"wp:attachment":[{"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lothlorien.com\/kf6gpe\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}