Roshan Book

My Tech Notebook

Category Archives: Technology

Add complete read write access in Ubuntu

A simple command to add complete read and write access for your Public directory in ubuntu

sudo chmod -R uga+rw Public

 

Advertisements

What is the Remote Posting URL

Windows live writer is a great tool to publish on wordpress/typepad/blogger etc. While configuring windows live writer for my wordpress site manishroshan.com, a point came when they asked for

Remote Posting URL in the format http://<hostname>/<wp_path>/xmlrpc.php

 

Now to get passed that you need to follow two steps

 

Step 1. Go to wordpress cms>>Settings>>Writing and enable Atom publishing protocol and XML-RPC

Step 2. For remote posting url , use following format

http://manishroshan.com/xmlrpc.php

If wordpress is at root. Add folder location after manishroshan.com/ if that wordpress is installed in a folder.

 

Setting up Lisp on Linux (Ubuntu)

I consider Paul Graham as my guru. His book Hackers & Painters has given me my dream. So when he says Lisp is great , I believe him. I have no idea about the concept of “macros”, or “closure” is, but I know one day I will learn Lisp and get that blub paradox.

Installing Lisp

Today I tried to set up lisp environment on my system, and succeed 🙂 . Not a tough job when you have the power of

sudo apt-get install clisp

You can install popular Clisp dialect on ubuntu system by typing above command.

For start using it, well you could just type clisp in your terminal and be greeted with

You are now at the lisp REPL (Read Eval Print Loop).

To get an editor

I was recommended to used Emacs with slime for Lisp. In-fact hardcore vim users also uses emacs for lisp editing

So, the magical command to get this 88mb program installed is

sudo apt-get install emacs slime

Configuring Emacs with Slime

No don’t ask me what they mean. Just go ahead with the following steps to configure Emacs with slime

mkdir ~/.slime

This command will make a directory “.slime” in your home folder

gedit .emacs

This will open a new file by the name of .emacs in gedit (editor), which is to be saved in home directory

;;; Lisp (SLIME) interaction
(setq inferior-lisp-program “clisp”)
(add-to-list ‘load-path “~/.slime”)
(require ‘slime)
(slime-setup)

(global-font-lock-mode t)
(show-paren-mode 1)
(add-hook ‘lisp-mode-hook ‘(lambda ()
(local-set-key (kbd “RET”) ‘newline-and-indent)))

Add above lines to .emacs file

I tried to explain what each command does. Will try to add more, once I get hang of it.

Just for fun

; Lisp
(defun addn (n)
#'(lambda (x)
(+ x n)))

Do you know what this does ?

Yes it takes a number n, and returns a function that adds n to its argument
Do you understand how it does?

No Idea, Bro!

Can you represent something like this in C?

Not possible at all.

That is just one sample, to show power of lisp – self 🙂

Do read about blub paradox, to get little bit of light on this .

%d bloggers like this: