Pages

Saturday, 13 July 2013

Linux - emacs cheat sheet

Basic emacs

C denotes the Ctrl key, so C-x means press Ctrl and x together. M denotes the Alt key in the same way.

Launch emacs:
emacs -nw -Q

Display interactive tutorial:
M-x help-with-tutorial

Full reference card can be found here.

Emacs and the node.JS REPL

Launch emacs:
emacs -nw file.js

C-x 3           Split the window vertically
C-c !            Launch node.js REPL within emacs
M-o             Toggle to the other window
C-c C-j        Send current line of code to REPL and execute it
C-c C-r        Send the marked region of code to REPL and execute it (see reference card for how to mark)

Tuesday, 9 July 2013

Linux - screen cheat sheet

Notes from this tutorial. The tutorial also includes info on sharing screens, which is not here.

Command Description
sudo apt-get install screen Install screen
screen Launch screen
Ctrl-t, then d Detach screen
screen -list Show all available screen sessions
screen -r
screen -r -t name
Reattach to an existing screen session
Reattach to the specific window name
Ctrl-t, then c
screen
screen -t name
Create a new window
The last command will create a window and give it a name
Ctrl-t, then " (double quotation)
Ctrl-t, then 0 to 9
Ctrl-t, then Ctrl-t again
Navigate windows by pressing up and down arrow keys, and enter to choose
Jump to the window number specified
Toggle between current and previous windows
exit
Ctrl-t, then K
Ctrl-t, then Ctrl-\
Kill the current window
Kill the current window
Kill all windows and exit
Ctrl-t, then A Annotate (name) the current window
Make a .screenrc file in home directory, with the following:
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a
Each new window will display a status line, which will include the window's name
Ctrl-t, then ? Help
screen -L

Ctrl-t, then H
Log the output from the current window to a file named ~/screenlog.n, where n is the window number
Toggle logging on and off
Ctrl-t, then C Clear a window

If screen stopped responding:

List screens:
screen -list

Output:
There is a screen on: 
   23536.pts-0.wdzee (10/04/2012 08:40:45 AM) (Detached) 
1 Socket in /var/run/screen/S-root.

Kill screen session:
screen -S 23536 -X quit

Friday, 28 June 2013

Kid's idea: Eco Day game

It's a video game in which you try to spend the day being as eco-friendly as possible.

For example, your dad sees a hornet's nest in the garage. Do you:
a) incourage him to kill the nest
b) beg him to leave the nest alone
c) enter your own idea

As you go through the game, you get presented with similar situations where you need to make eco-friendly decisions or contribute your input to other kids. You earn badges when you accomplish certain tasks in the most eco-friendly way.

You get 5 stars for each level. If you get 2 or less stars on a level you have to restart the level, if you get 3 or more you can move on, if you get 5 you get a bonus level.

Parents can also log what they've done to help the environment, e.g. read books instead of playing video games or turning off the computer for a day.

Granted, all of the above was dictated to me by a 9 year old. But the basic idea is interesting: create a virtual world in which kids and adults alike can practice addressing environmental issues and ultimately grow into more eco-responsible generation.

Thursday, 27 June 2013

First Step Real Estate Helper

There are many resources available online for finding houses based on price, number of bathrooms, bungalow, apartments, & row-houses with fireplaces, pools and AC, but there is no easy way of sourcing out a neighborhood. Next time I look to move I will be interested in a lot of other details that are completely overlooked by most real-estate-board websites (particularly anything available in Canada).

I would like to be able to find houses for sale that are near a library, a school - and not just any school. Perhaps a well-rated school, a French school, a public school or a religious private school. I would like to be within a certain distance of public transit, and a reasonable commute time to work, church and clubs. On a low traffic street that is a short walk from a park, and near a bike trail.

Knowing what areas have houses within my budget, and with the amenities I am looking for is an important first step before I start considering individual houses. Generalized pricing data may be sufficient for an application like this, and available from census data. It would be a fair investment to try and build in all of the functionality of a real-estate boards property listings, but it may not be necessary if you don't try to compete directly. Besides, you may find some data feeds are available to be included into your app at a later date.

Need a place to start?
The Realtor's website in Canada (http://www.realtor.ca/) has some major oversights. You cannot get to a map view if you start in an advanced search. Their recently released Android app is rated 2.3/5, with three times as many "1" votes as it has "5"s. People in Canada need somewhere else to start their search

Bloggers help bloggers

How do I get attention to my blog? This is indeed a hot question for bloggers. You start by writing content that people are interested in. How do you know what people are interested in? If you are a new blogger, you may not. If you are an established blogger, your readers might ask you questions directly. But even established bloggers have difficulty figuring out what to blog about next.

Startup Idea:
Bloggers Help Bloggers or Ask a Blogger. Here is how it works:

  1. Bloggers register their blogs on the site you develop.
  2. Questions get asked either on your site or to the individual bloggers the usual way.
  3. When someone is in the possession of a question they don't want to bother answering, they forward it to your site.
  4. Interested parties grab the question and answer it on their blogs, then refer to their posts on your site.
  5. The person who asked the question gets the answer, and the blogger gets the attention.
Expand:
Use machine learning to match questions to bloggers and answers to people. 

Swap Resources platform

If https://www.parkatmyhouse.com/ and Garden my garden ideas work, then

Startup Idea:
Make a platform to allow people with more of similar ideas to bring them to life. Your startup is a 0-1, which allows others to do the 1-n work.

Garden my garden

This is a similar idea to https://www.parkatmyhouse.com/, so in a way it is not a 0-1 startup. The idea still has potential though.

I am a terrible gardner and I live near apartment buildings. I know some people who love to garden as a hobby. People in apartment buildings or rental properties do not have the opportunity to garden.

Startup idea:
Let people make use of the soil you have available. You get a pretty looking house, someone else gets to design and grow a flower garden. You get vegetables as a payment, the grower gets more vegetables from using your backyard garden.