Tuesday, May 12, 2015

Basic markdown

Link

[Link name](www.url.com)

Reference link
[The New York Times][NY Times]
[ny times]: http://www.nytimes.com/ 

Headers

# Header 1
## Header 2

### Header 3

Emphasis
*italicize*
**bold**
_**italicize and bold**_  or __*really strong emphasis*__


List
Unordered list - dash and space
- Item 1
- Item 2
  - Nested item needs 2 spaces
    - 2 spaces for each 'nest'

Order list - only need a number and a period and space
1. Item 1
1. Item 2 
1. Item 3

Code
`inlined code`

Code block may needs new line before and after block.

```java
public void static main(String[] args) {

}
```

Image

![alt text](/path/to/img.jpg "Title")


![](./pic/pic1_50.png =100x20)

Wednesday, March 4, 2015

Install Django for Ubuntu

Assuming you have python installed, you can install Django with this command:
  • sudo apt-get install python-django
You can check that Django is installed by checking its version:
  • python -c "import django; print(django.get_version())"

Monday, March 2, 2015

Ubuntu: Remapping Right Ctrl with Right Alt

Ubuntu uses xkb to handle its keyboard mapping. You can read more about it here:

  • https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

Because I use the CTRL key a lot, I want it to be easier to access. Since I always use the ALT key with my left hand, I decided to switch the right ALT key with the Right CTRL key.

To do this, I opened 10-evdev.conf as an admin:
  • sudo pico /usr/share/X11/xorg.conf.d/10-evdev.conf
and added the following to the file:

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbModel" "pc104"
        Option "XkbOptions" "ctrl:rctrl_ralt,ctrl:ctrl_ralt"
EndSection
Restart your computer to verify your changes.

As you can see, most of the setting is for the keyboard. The most important thing is the second to last line, Option "XkbOptions" "ctrl:rctrl_ralt,ctrl:ctrl_ralt". This states that I want to right CTRL key as right ALT key and vice versa. You see more xkb options in the base file (start on line 692):
  • /usr/share/X11/xkb/rules/base.lst

I haven't tried it, but you can probably switch the caps lock with the control key with ctrl:swapcaps

Resource:

Thursday, February 26, 2015

Ubuntu hangs on boot on Asus U46E

Recently, I installed Ubuntu on my Asus laptop, but it keeps hanging on the start up screen. It seems like Asus laptop has a problem with this. After reading several options, this one works for me:
  1. Go into your BIOS
  2. Select "Advance" using the right arrow button
  3. Select "VT-d" by pressing the down arrow button
  4. Press "Enter"
  5. Select "Disable"
  6. Press "F10" to exit the screen
  7. Select "Yes" to save
Note: You can read on VT-d on Intel blog to see if that's the best option for you.

If that doesn't work, you may find these solutions helpful:
  1. Ubuntu 10.10 [64 Bit] hang on boot 
  2. Ubuntu 12.10 boot hangs on purple screen 
  3. Ubuntu hangs at purple screen

Tuesday, September 2, 2014

Elixir: Phoenix compilation error

I got the following error when I tried to compile master. If you get it too, just delete the _build folder.

==> plug
Compiled lib/plug.ex
Compiled lib/plug/adapters/cowboy.ex

== Compilation error on file lib/plug/conn/adapter.ex ==
** (RuntimeError) cannot compile Plug because the :cowboy application is not available. Please ensure it is listed as a dependency before the plug one.
    lib/plug/conn/adapter.ex:4: (file)
    (elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/3
    (elixir) lib/kernel/parallel_compiler.ex:97: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8

could not compile dependency plug, mix compile failed. You can recompile this dependency with `mix deps.compile plug` or update it with `mix deps.update plug`

--------------------------------------------------------------------------
When you get the error below, remove the deps `rm -r deps` and redownload them again `mix deps.get`

== Compilation error on file lib/postgrex/types.ex ==
** (CompileError) lib/postgrex/types.ex:6: module Decimal is not loaded and could not be found
    (elixir) src/elixir_exp.erl:104: :elixir_exp.expand/2
    (stdlib) lists.erl:1352: :lists.mapfoldl/3
    (stdlib) lists.erl:1353: :lists.mapfoldl/3
    (elixir) src/elixir_exp.erl:49: :elixir_exp.expand/2
    (elixir) src/elixir.erl:206: :elixir.quoted_to_erl/3
    (elixir) src/elixir.erl:175: :elixir.erl_eval/3