Default font should be: Arial Size: 9
Change how the original message appears in replies and forwards:
Preference -> Composing -> Indent each line of the original message and Attribution of original message: Custom On [DATE], [NAME] <[ADDRESS]> wrote:
Email account -> Advanced -> Folders -> Don't save a copy of sent messages
6/30/2016
6/27/2016
Commonly used commands to fix Virtualbox (Ubuntu and GPU related issues)
Fixed Virtualbox by running:
sudo apt-get remove --purge nvidia-*
sudo apt-get remove --purge nvidia-*
sudo apt purge ~nvidia
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
=========================
sudo apt-get install gnome-session ubuntu-desktop
sudo apt-get install --reinstall linux-image-$(uname -r)
sudo apt-get --reinstall install libgl1-mesa-glx
# Also check ~/.xsession-errors
# /var/log/Xorg.0.log
# /var/log/lightdm/lightdm.log
# /var/log/lightdm/x-0-greeter.log
# If no menu bar
setsid unity
sudo apt install --reinstall lightdm
sudo apt install --reinstall nvidia-XXX
sudo apt install --reinstall xserver-xorg
sudo apt install --reinstall xserver-xorg-core
sudo apt install --reinstall gnome-session
sudo dpkg-reconfigure xserver-xorg
# Unable to mount the Guest Additsudo mkdir --p /media/cdrom
sudo mount -t auto /dev/cdrom /media/cdrom/
cd /media/cdrom/
sudo sh VBoxLinuxAdditions.run
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
=========================
sudo apt-get install gnome-session ubuntu-desktop
sudo apt-get install --reinstall linux-image-$(uname -r)
sudo apt-get --reinstall install libgl1-mesa-glx
# Also check ~/.xsession-errors
# /var/log/Xorg.0.log
# /var/log/lightdm/lightdm.log
# /var/log/lightdm/x-0-greeter.log
# If no menu bar
setsid unity
sudo apt install --reinstall lightdm
sudo apt install --reinstall nvidia-XXX
sudo apt install --reinstall xserver-xorg
sudo apt install --reinstall xserver-xorg-core
sudo apt install --reinstall gnome-session
sudo dpkg-reconfigure xserver-xorg
# Unable to mount the Guest Additsudo mkdir --p /media/cdrom
sudo mount -t auto /dev/cdrom /media/cdrom/
cd /media/cdrom/
sudo sh VBoxLinuxAdditions.run
How to change gerrit font
Just change your browser's font:
Firefox: Content -> Font & Colors -> San-serif and Monospace
Chrome: San-serif and Monospace
Firefox: Content -> Font & Colors -> San-serif and Monospace
Chrome: San-serif and Monospace
6/20/2016
Background color that I like
Light orange background: #F5E7D1 (RGB: 245, 231, 209)
Light blue background: #DFF5FD (RGB: 223,245,253)
Dark red text color: #A52A2A
Dark green: #006400
Orange: #ff7f00
Dark blue: #2684BE
Light blue background: #DFF5FD (RGB: 223,245,253)
Dark red text color: #A52A2A
Dark green: #006400
Orange: #ff7f00
Dark blue: #2684BE
Nvidia green: #76B900 (RGB: 118, 185, 0)
6/15/2016
EMACS frequently commonly used commands
ctrl-g quit the current operation
ctrl-x ctrl-s: save
ctrl-x ctrl-w: save as
ctrl-x ctrl-c: exit
ctrl-x b: change buffer or type in a name to new a buffer
ctrl-x k: kill buffer
alt-x revert-buffer: reload buffer from file
alt-x goto-line: go to line
ctrl space: copy mode
ctrl-w: cut
alt-w: copy
ctrl-y: paste
ctrl-x u: undo
ctrl-x 3: split window
ctrl-x f: open file
ctrl-s: search
alt-e: to edit the search string
alt-% (alt-shift-3): find/replace
ctrl-v: scroll down
alt-v: scroll up
alt-x customize-face: change the color of the syntax coloring of the current cursor word
alt-x list-faces-display: to change different colors
alt-x linum-mode: show line number
ctrl-c ctrl-c: to comment a block
alt-;: to uncomment a block
ctrl space to select region, then ctrl-x tab: to indent a block. ctrl-x tab again to indent again
ctrl space to select region, then ctrl-u -2 then ctrl-x tab: to unindent a block
alt-x python-mode: to turn on python, text-mode or c++-mode etc
ctrl-u: repeat the following commands 4 times
ctrl-u 2: repeat the following commands 2 times
To give a command a numeric argument of, say, 12, type C-u 12 before typing the command. If you type slowly, you'll see: C-u 1 2-
# Comment a block
alt-x python-mode, select region, then alt-x comment-region
ctrl-j: new line and auto indent
alt-/: auto complete words
alt-d: delete a word forward
alt-delete: delete a word backward
ctrl-k: delete a line
ctrl-shift-backspace: delete the current whole line
alt-f: move a word forward
alt-b: move a word backward
alt-x toggle-truncate-lines: wrap text off
ctrl-x ctrl-+: increase font size
ctrl-x ctrl--: decrease font size
whitespace-mode: toggle whitespace mode
alt-x ediff: diff two files
ctrl-x z: continue once the previous command
alt-x zap-to-char: delete everything up to a specific character
vc-annotate: display the git blame information
# Change split windows size:
C-x } (enlarge-window-horizontally) does likewise, horizontally.
C-x { (shrink-window-horizontally) is also bound by default
Following one of these commands with repeat (C-x z to initiate, and just z for continued repetition).
Navigating Parentheses:
ctrl-alt-n forward-list Move forward over a parenthetical group
ctrl-alt-p backward-list Move backward over a parenthetical group
ctrl-alt-f forward-sexp Move forward over a balanced expression
ctrl-alt-b backward-sexp Move backward over a balanced expression
ctrl-alt-k kill-sexp Kill balanced expression forward
ctrl-alt-SPC mark-sexp Put the mark at the end of the sexp.
Set comment region charactert:
ctrl-x ctrl-s: save
ctrl-x ctrl-w: save as
ctrl-x ctrl-c: exit
ctrl-x b: change buffer or type in a name to new a buffer
ctrl-x k: kill buffer
alt-x revert-buffer: reload buffer from file
alt-x goto-line: go to line
ctrl space: copy mode
ctrl-w: cut
alt-w: copy
ctrl-y: paste
ctrl-x u: undo
ctrl-x 3: split window
ctrl-x f: open file
ctrl-s: search
alt-e: to edit the search string
alt-% (alt-shift-3): find/replace
ctrl-v: scroll down
alt-v: scroll up
alt-x customize-face: change the color of the syntax coloring of the current cursor word
alt-x list-faces-display: to change different colors
alt-x linum-mode: show line number
ctrl-c ctrl-c: to comment a block
alt-;: to uncomment a block
ctrl space to select region, then ctrl-x tab: to indent a block. ctrl-x tab again to indent again
ctrl space to select region, then ctrl-u -2 then ctrl-x tab: to unindent a block
alt-x python-mode: to turn on python, text-mode or c++-mode etc
ctrl-u: repeat the following commands 4 times
ctrl-u 2: repeat the following commands 2 times
To give a command a numeric argument of, say, 12, type C-u 12 before typing the command. If you type slowly, you'll see: C-u 1 2-
# Comment a block
alt-x python-mode, select region, then alt-x comment-region
ctrl-j: new line and auto indent
alt-/: auto complete words
alt-d: delete a word forward
alt-delete: delete a word backward
ctrl-k: delete a line
ctrl-shift-backspace: delete the current whole line
alt-f: move a word forward
alt-b: move a word backward
alt-x toggle-truncate-lines: wrap text off
ctrl-x ctrl-+: increase font size
ctrl-x ctrl--: decrease font size
whitespace-mode: toggle whitespace mode
alt-x ediff: diff two files
ctrl-x z: continue once the previous command
alt-x zap-to-char: delete everything up to a specific character
vc-annotate: display the git blame information
# Change split windows size:
C-x } (enlarge-window-horizontally) does likewise, horizontally.
C-x { (shrink-window-horizontally) is also bound by default
Following one of these commands with repeat (C-x z to initiate, and just z for continued repetition).
Navigating Parentheses:
ctrl-alt-n forward-list Move forward over a parenthetical group
ctrl-alt-p backward-list Move backward over a parenthetical group
ctrl-alt-f forward-sexp Move forward over a balanced expression
ctrl-alt-b backward-sexp Move backward over a balanced expression
ctrl-alt-k kill-sexp Kill balanced expression forward
ctrl-alt-SPC mark-sexp Put the mark at the end of the sexp.
Set comment region charactert:
Alt-: (setq comment-start "#~")
In the directory view mode: (dired)
C: copy file
D: delete file or folder
R: rename file or folder
+: create a folder
q: quit the dir mode
m: mark file
u: unmark file
U: unmark all files
%m: regexp mark files
^: go to parent dir
>: move to the next subdir
<: font="" move="" prev="" subdir="" the="" to="">
In the directory view mode: (dired)
C: copy file
D: delete file or folder
R: rename file or folder
+: create a folder
q: quit the dir mode
m: mark file
u: unmark file
U: unmark all files
%m: regexp mark files
^: go to parent dir
>: move to the next subdir
<: font="" move="" prev="" subdir="" the="" to="">
6/14/2016
Use Jetty to serve static content
ResourceHandler resourceHandler2 = new ResourceHandler();
resourceHandler2.setDirectoriesListed(true);
resourceHandler2.setResourceBase("/path/to/static_files");
ContextHandler staticContextHandler2 = new ContextHandler("/html");
staticContextHandler2.setHandler(resourceHandler2);
...
handlerList handlers = new HandlerList();
handlers.addHandler(servletContextHandler);
handlers.addHandler(staticContextHandler2);
httpServer.setHandler(handlers);
resourceHandler2.setDirectoriesListed(true);
resourceHandler2.setResourceBase("/path/to/static_files");
ContextHandler staticContextHandler2 = new ContextHandler("/html");
staticContextHandler2.setHandler(resourceHandler2);
...
handlerList handlers = new HandlerList();
handlers.addHandler(servletContextHandler);
handlers.addHandler(staticContextHandler2);
httpServer.setHandler(handlers);
Subscribe to:
Posts (Atom)