Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

What is 2015_1101 Code Challenge?

The 2015_1101 Code Challenge is a learning exercise for students attending Dan's Linux JavaScript Class at 3pm on 2015-11-01 at Hacker Dojo:

We start with three tasks: Install Ubuntu, enhance it, and create account named ann: Next, we learn some Emacs:
  • emacs ~ann/.emacs
  • Experiment with the controls at the top of the emacs window
  • Add this syntax to file: ~ann/.emacs
    ;; ~ann/.emacs
    (global-set-key "\C-xs" 'shell)
    (global-set-key "\em"   'buffer-menu-other-window)
    (global-set-key "\eR"   'rename-buffer)
    ;; end of .emacs
  • Figure out how to save and exit
  • Verify your work:
    cat ~ann/.emacs
  • Start 'bare' emacs:
  • Start a shell in emacs with ctrl-x then letter 's'.
  • I should see something like this:
  • Rename the shell to SHELL1 with esc-key, then letter 'R'
  • I should see something like this:
  • List all buffers in my emacs with esc-key, then letter 'm'
  • I should see something like this:

I see the buffer-menu as similar to the Mac-Dock, Ubuntu-Launcher or the Windows-Taskbar.

The buffer-menu is my favorite emacs feature; it allows my mind to QUICKLY switch focus among three types of objects:
  • different shells
  • different files
  • different folders

The buffer-menu floats 'hot' shells, files and folders to the top.

This is useful behavior.

I mostly do 4 types of tasks on a laptop:
  • Interact with file
  • Interact with folder
  • Interact with shell
  • Interact with browser

I can do the first three types inside of emacs.

When I coordinate tasks with emacs rather than a Dock, I work much faster (because of the buffer-menu).

That sequence of creating a shell, and renaming it is the most difficult task I need to know.

All other emacs tasks can be done using mouse and arrow keys.

If I am an emacs power-user, I know two ways to use emacs to interact with folders.

The GUI-way is to click on the file-cabinet at the top.

Another way, which is quicker, is to type command ctrl-x then letter 'f'.

I should see something like this:

  • After I learn some Emacs or some other editor, I Install Node.js in this folder: ~ann/node/
  • cd ~ann
    tar zxf node-v5.0.0-linux-x64.tar.gz
    rm -rf node
    mv node-v5.0.0-linux-x64 node
  • Then, I add Node.js to PATH:
    export       PATH="/home/ann/node/bin:${PATH}"
    echo 'export PATH="/home/ann/node/bin:${PATH}"' >> ~ann/.bashrc
  • Run a test:
    which node
    node -e 'console.log("hello world")'
  • Install CoffeScript to test npm:
    which npm
    npm install -g coffee-script
    ls -la /home/ann/node/lib/node_modules/
    which coffee
    coffee -e 'console.log "hello coffee!"'
  • Start work on an app:
    cd ~ann
    echo 'gem: --no-ri --no-rdoc' >> ~ann/.gemrc
    rm -rf app25r
    git clone
    cd ~ann/app25r
    .  ~ann/app25r/app25r.bash
    rm -rf   $GEM_HOME
    mkdir -p $GEM_HOME
    /usr/bin/gem install bundler
    $GEM_HOME/bin/bundle install
    ~ann/app25r/bin/rake db:migrate
    ~ann/app25r/bin/rails r ~ann/app25r/db/csv2cars.rb
    ~ann/app25r/bin/rails s -p 3325
    /usr/bin/curl localhost:3325|head

If you want to deploy this repository to Heroku, follow this recipe:
  • Create an account at website
  • Download/Install Heroku client
    cd ~ann
    tar zxf heroku-client.tgz
    echo 'export PATH=/home/ann/heroku-client/bin:${PATH}' >> ~ann/.bashrc
    echo  export PATH=/home/ann/heroku-client/bin:${PATH}
  • I created ssh-key for ann account (assuming ann has none yet):
    ann@dev06:~$ ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/ann/.ssh/id_rsa): 
    Created directory '/home/ann/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/ann/.ssh/id_rsa.
    Your public key has been saved in /home/ann/.ssh/
    The key fingerprint is:
    7c:73:e0:26:8b:62:f6:a4:1d:78:22:e5:cd:3a:5c:eb ann@dev06
    The key randomart image is:
    +--[ RSA 2048]----+
    |                 |
    |                 |
    |          .      |
    |       . . .     |
    |    .   S = .    |
    |   o +.. = o     |
    |  ..B.B..        |
    |   +oX..         |
    |    ooE          |
  • I used heroku-client to "login" my shell. I gave a copy of ann public ssh-key to heroku:
    heroku status
    heroku auth:login
    heroku auth:whoami
    heroku keys:add
  • I used heroku-client to create a blank app named rails411 at
    cd ~ann/app25r
    ~ann/heroku-client/bin/heroku create rails411
  • git-push ~ann/app25r to heroku
    cd ~ann/app25r
    git add .
    git commit -am rails
    git push heroku master
  • Setup the database on heroku for my Rails app there:
    ~ann/heroku-client/bin/heroku run rake db:migrate
    ~ann/heroku-client/bin/heroku run bin/rails r db/csv2cars.rb
  • I saw ~ann/app25r deployed at

That could be considered an adequate code challenge for a two hour Meetup.

If you have questions, e-me: Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me