small trick for bash

If you want to remember last working directory you can add this into .bashrc

# cdp() will create or rewrite file ~/.cwd with working path
cdp()
{
  cd "$1"
  echo `pwd` > ~/.cwd
}

# exporting cdp() to shell as a command
export -f cdp

# changing working directory if file exists
if [ -d `cat ~/.cwd` ]; then
  cd `cat ~/.cwd`
fi

english dictionary

I like English dictionary on my mac. It’s very informative and there are no sense to translate words to russian having this. I think this is a good way to remember a word if you can explain it with couple of phrases and synonyms. I’ve bought Collins dictionary and thesaurus for my android. It costs twice cheaper than the paper book and has no weight. So I’m happy having ability to find explanations then I need them.