Wednesday, December 12, 2012

How to make a table in Wikipedia

— SkyHi @ Wednesday, December 12, 2012
REFERENCES
http://en.wikipedia.org/wiki/Wikipedia:How_to_make_a_table_in_Wikipedia

Sunday, December 9, 2012

How to Delete an Address from the Outlook Auto-Complete List

— SkyHi @ Sunday, December 09, 2012
Outlook remembers every address you have typed in a To:, Cc: or Bcc: field. This is good: when you start keying in a name or address, Outlook automatically suggest the contact in its entirety.
Unfortunately, Outlook remembers the mistyped and old as well as the correct and current — and suggest it indiscriminately. Fortunately, getting rid of entries you no longer want to appear in the auto-complete list is easy.

Delete an Address from the Outlook Auto-Complete List

To remove a name or email address from Outlook's auto-complete list:
  • Create a new email message in Outlook.
  • Start typing the name or address you want to remove.
  • Use the down arrow key to highlight the desired (undesired) entry.
  • Press Del.

Want to Edit the Outlook Auto-Complete List?

For more control over Outlook's email address auto-complete file, try a tool like Ingressor.

Prevent Outlook Address Auto-Completion Altogether

You can also stop Outlook from suggesting email addresses as you type:
  • Select Tools | Options... from the menu.
  • Go to the Preferences tab.
  • Click E-mail Options....
  • Now click Advanced E-mail Options....
  • Make sure Suggest names while completing To, Cc, and Bcc fields is not checked.
  • Click OK.
  • Click OK again.
  • Click OK once more.

If the above doesn't work, you have to go "contacts" folder and modify accordingly.

REFERENCES
http://email.about.com/od/outlooktips/qt/et_del_autocomp.htm

Thursday, December 6, 2012

GNU screen Kill detached screen session

— SkyHi @ Thursday, December 06, 2012

== ISSUE THIS COMMAND
[xxx@devxxx ~]$ screen -ls


== SCREEN RESPONDS
There are screens on:
        23487.pts-0.devxxx      (Detached)
        26727.pts-0.devxxx      (Attached)
2 Sockets in /tmp/uscreens/S-xxx.


== NOW KILL THE ONE YOU DONT WANT
[xxx@devxxx ~]$ screen -X -S 23487.pts-0.devxxx kill
or
[xxx@devxxx ~]$screen -S 23487 -X quit
== WANT PROOF? [xxx@devxxx ~]$ screen -ls There is a screen on: 26727.pts-0.devxxx (Attached) 1 Socket in /tmp/uscreens/S-xxx.

REFERENCES
http://stackoverflow.com/questions/1509677/kill-detached-screen-session

Friday, November 30, 2012

Windows 7: Japanese not displaying in Windows

— SkyHi @ Friday, November 30, 2012
Your problem probably stems from the fact that you're font chache probably is corrupted; delete the fileC:\Windows\system32\FNTCACHE.DAT and restart, your problem should be solved.


Windows XP had a “supplemental language support” section under Regional and Language options. You had to select them and perform the installation (which required the CD and was annoying) if you wanted to work with Asian languages. This was removed with Vista and support for these languages came by default. Windows 7 turns out to be a little different, however.
I usually do not find what Microsoft chooses to hide from the UI very useful. Why do I need to hit the alt key to see the file menu for example? This started with Internet Explorer and seems to be applied to other apps as well, including Windows Explorer. All of a sudden, the menu disappeared… Yes, it provides a little more space on the screen, but that space is not very useful as menu bar is not located at direct eye sight anyway. Does anybody browse the Internet full screen? No.
Lets get back to the Font issue. I launched an html document with Japanese strings in Notepad and was presented with a bunch of boxes! Boxes are how Windows expresses “I don’t know how to display this character”. I went to Format > Font to pick a font which supports Japanese script but none existed! Ah, must be the newest victim of Microsoft hiding team…
Windows 7 hides fonts depending on your language settings. Go to Control panel > Fonts > Font settings and uncheck “Hide fonts based on language settings”
Hiding the fonts is supposed to simplify the font selection in applications. I am not sure which applications are targeted for this but Notepad is definitely not one of them. The font selection dialog has always been and is still far from being user friendly and having 80 fonts instead of 200 doesn’t really provide any improvement.
I picked MS Minco for the font and Japanese for the script and there we go. No more boxes!


REFERENCES
http://superuser.com/questions/372928/windows-7-japanese-not-displaying-in-windows
http://www.emreakkas.com/windows-tips/how-to-enable-hidden-fonts-in-windows-7
http://mangahelpers.com/forum/showthread.php/3709-How-To-Enable-Japanese-Language-Windows

Thursday, November 29, 2012

Find command: Exclude / Ignore Files ( Ignore Hidden .dot Files )

— SkyHi @ Thursday, November 29, 2012


Q. How do I ignore hidden .dot files while searching for files? How do I ignore or exclude certain files while running Linux / UNIX find command?

A. Find command support standard UNIX regex to match or exclude files. You can write complex queries easily with regex.

Find command and logical operators

Find any file whose name ends with either 'c' or 'asm', enter:
$ find . -type f \( -iname "*.c" -or -iname "*.asm" \)
The parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters. The -type f option force to only search files and not directories. The or operator either find .c or .asm file.

Understanding find command operators

Operators build a complex expression from tests and actions. The operators are, in order of decreasing precedence:
( expr )Force precedence. True if expr is true
expr
-not expr
True if expr is false. In some shells, it is necessary to protect the ‘!’ from shell interpretation by quoting it.
expr1 -and expr2And; expr2 is not evaluated if expr1 is false.
expr1 -or expr2Or; expr2 is not evaluated if expr1 is true.
WARNING! The '-or', '-and', and '-not' operator are not available on all versions of find. Usually GNU find supports all options. Refer your local find command man page for more information.

How do I ignore hidden .dot files while searching for files?

Find *.txt file but ignore hidden .txt file such as .vimrc or .data.txt file:
$ find . -type f \( -iname "*.txt" ! -iname ".*" \)
Find all .dot files but ignore .htaccess file:

REFERENCES
http://www.cyberciti.biz/faq/find-command-exclude-ignore-files/

Find Command Exclude Directories From Search Pattern

— SkyHi @ Thursday, November 29, 2012


How do I exclude certain directories while using the find command under UNIX or Linux operating systems?

You can use the find command as follows to find all directories except tmp directory:
find /path/to/dest -type d \( ! -name tmp \) -print
Find all directories except tmp and cache:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache \) -print
The -prune option make sure that you do not descend into directory:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache -prune \) -print
You can find all *.pl find except in tmp and root directory, enter:
find /  \( ! -name tmp \) -o \( ! -name root -prune \)  -name "*.pl" -print


References
http://www.cyberciti.biz/faq/linux-unix-osx-bsd-find-command-exclude-directories/

Saturday, November 24, 2012

A Tmux Crash Course

— SkyHi @ Saturday, November 24, 2012

I’ve been using Tmux for about six months now and it has become just as essential to my workflow as vim. Pane and window management, copy-mode for navigating output, and session management make it a no-brainer for those who live in the terminal (and especially vim). I’ve compiled a list of tmux commands I use daily to help me work more efficiently.
Tmux Panes
If a tmux command I mention is bound to a keyboard shortcut by default, I’ll note that in parenthesis.

SESSION MANAGEMENT

Sessions are useful for completely separating work environments. I have a ‘Work’ session and a ‘Play’ session; in ‘Work’, I keep everything open that I need during my day-to-day development, while in ‘Play’, I keep open current open-source gems or other work I hack on at home.
tmux new -s session_name
creates a new tmux session named session_name
tmux attach -t session_name
attaches to an existing tmux session named session_name
tmux switch -t session_name
switches to an existing session named session_name
tmux list-sessions
lists existing tmux sessions
tmux detach (prefix + d)
detach the currently attached session

WINDOWS

Tmux has a tabbed interface, but it calls its tabs “Windows”. To stay organized, I rename all the windows I use; if I’m hacking on a gem, I’ll name the window that gem’s name. The same thing goes for client applications. That way, I can recognize windows by context and not what application it’s running.
tmux new-window (prefix + c)
create a new window
tmux select-window -t :0-9 (prefix + 0-9)
move to the window based on index
tmux rename-window (prefix + ,)
rename the current window

PANES

Panes take my development time from bland to awesome. They’re the reason I was able to uninstall MacVim and develop solely in iTerm2. I don’t have to switch applications to switch contexts (editing, reading logs, IRB, etc.) - everything I do, I do in a terminal now. People argue that OS X’s Cmd+Tab is just as fast, but I don’t think so.
tmux split-window (prefix + ")
splits the window into two vertical panes
tmux split-window -h (prefix + %)
splits the window into two horizontal panes
tmux swap-pane -[UDLR] (prefix + { or })
swaps pane with another in the specified direction
tmux select-pane -[UDLR]
selects the next pane in the specified direction
tmux select-pane -t :.+
selects the next pane in numerical order

HELPFUL TMUX COMMANDS

tmux list-keys
lists out every bound key and the tmux command it runs
tmux list-commands
lists out every tmux command and its arguments
tmux info
lists out every session, window, pane, its pid, etc.
tmux source-file ~/.tmux.conf
reloads the current tmux configuration (based on a default tmux config)

MUST-HAVES

These are some of my must-haves in my tmux config:
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf

# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+

WORKFLOW

During the day, I’ll work on one or two Rails apps, work on my dotfiles, run irssi, and maybe run vim in another window to take notes for myself. As I mentioned, I run all of this inside one tmux session (named work) and switch between the different windows throughout the day.
When I’m working on any Ruby work specifically, I’ll have a 75%/25% vertical split for vim and a terminal so I can run tests, interact with git, and code. If I run tests or ‘git diff’ and want to see more output than the 25% allots me, I’ll use tmux to swap the panes and then move into copy mode to see whatever I need to see.
Finally, I run iTerm2 in full-screen mode. Switching between OS X apps for an editor and a terminal is for chumps!



REFERENCES
http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course