Roshan Book

My Tech Notebook

Monthly Archives: September 2012

Cancel the invitation to connect on linkedin

Recently I accidentally sent one connection request on linkedin and wanted to withdraw it. Here is what I followed :

1. Go to Linkedin Inbox

2. Search for the contact

3. Below the contact there is a link to the invitaion which looks like this

4. Click on the link and it would open the invitaion message

5. Now there is a button, below the message called “withdraw”

6. Click on withdraw

7.  Now the contact will not get the invitation message

Advertisements

The Principal Programming Paradigm

How I Used a Webcam to Break My Bad Habits and Make Better Decisions

This is an awesome article published on Lifehacker.

Writer Adam Dachis , talked about a very easy but effective way to autosuggest. Using your webcam. Read the article to gain amazing insights on how mind takes pleasure in our vices and what approach writer employed to get rid of bad habits.

My approach was very simple, and it worked like this:

  1. I came up with a list of things I wanted to change, such as biting my nails (which I’d done as long as I could remember), putting more time and effort into exercise, worrying about offending people who aren’t nice and don’t care about me, and quite a bit more.
  2. I added why I wanted to change to each item on that list.
  3. I wrote a short “speech” (about 45 seconds) that I could read into a camera that covered every item on the list.
  4. I ended that “speech” with a reminder that I’m doing this because I care about myself.
  5. I read that speech into a webcam and recorded it every night. Sure, I could’ve gone the traditional route and talked into a mirror, but it’s tough to speak and truly listen at the same time.
  6. I watched each recording after I finished.

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 .

Which Operating System you use

Short course on Aptitude package manager

Source :
install software for your system, with needed dependencies as well:

sudo aptitude install

remove packages as well as orphaned dependencies:

sudo aptitude remove

remove packages and orphaned dependencies, as well as any configuration files left behind:

sudo aptitude purge

search for packages in the local apt package lists:

sudo aptitude search package-name

show details about a package:

sudo aptitude show package-name

update the local packages lists:

sudo aptitude update

upgrade any installed packages that have been updated:

sudo aptitude upgrade

upgrade packages, even if it means uninstalling certain packages:

sudo aptitude dist-upgrade

delete only out-of-date packages, but keep current ones:

sudo aptitude autoclean

delete any downloaded files necessary for installing the software on your system:

sudo aptitude clean

fix a package at it’s current version, and don’t update it:

sudo aptitude hold

%d bloggers like this: