[Motorola Droid 4] Rick#2:
=========================

RECOVERY MENU REFERENCE

=========================

Select Highlighted Item - Enter or Power

Scroll Up - Volume Up or Left Arrow

**Note: The Left/Right Arrow keys may sound weird but since the menu is displayed in portrait mode, it just feels like you are pushing Up/Down.**

Scroll Down - Volume Down or Right Arrow

Direct Menu Selection - Hit the corresponding number/letter at the beginning of each menu item.

**ie: from the main menu, hit "6" to jump to the advanced menu.**

Go Back / Cancel - Caps Lock

===================

CONSOLE REFERENCE

===================

Keys:

--------------------

Tab - Tab

** Note: The Tab key is your best friend when using bash. It will auto-complete file/directory names for you, or list out the possible choices if you double-tap it after entering a few letters.

SYM - Alt

Shift - Shift

OK - Control

Caps Lock - ESC

OK+Shift - Toggle Caps Lock

OK+SYM - Toggle Alt Lock

** Note: The LED beside the Caps Lock button will illuminate when either Caps Lock or Alt Lock is enabled.

OK+Backspace - Force exit

OK+A - Home

OK+E - End

OK+C - Stop current process, ie: if a program you are running chokes up.

=========================

bash Commands:

--------------------

Here are a few of the more useful bash commands that you will use:

===========

ls, ls -a, ls -l, ll

===========

/ {}$ ls

- "ls" lists the files and directories within the current directory.

- You can also add a path after it to look for certain files or directories.

/ {}$ ls -a

- "ls -a" will list all files and directories, including hidden ones starting with a ".", ie: .bashrc in /cache/.safestrap/home. (The bash startup script).

/ {}$ ls -l

- "ls -l" will do a long listing, showing permissions, file sizes, etc.

Now, instead of using those parameters, I've made aliases within the .bashrc script so you will probably just want to type:

/ {}$ ll

- "ll" is an alias for "ls -a -l", so it will list all files/directories, hidden or not and list their properties.

/ {}$ ll

- By putting a path after "ll", it will single out the file. Add a "*" in there to act as a wildcard to list multiple files with the same first few characters.

- ie: "ll /system/lib/libc*" would display all the files and directories starting with "libc" within /system/lib as well as their properties.

========

cd

========

/ {}$ cd (path)

- Change directory. Pretty self-explanatory. Try doing:

/ {}$ cd ~/

- This takes you to the home folder. Pretty useless here but this is usually pretty handy in other scenarios.

/ {}$ cd ../

- Using "../" as your target will cause you to drop down a single directory in the tree.

**** Don't forget to hit tab to auto-complete directory/file names for you whenever you've already entered the first few characters. More accurate and much less typing. ****

=======

mv

=======

/ {}$ mv (source) (destination)

- "mv" is short for move. The source is the path to the file/directory you want to move, and I don't think i need to tell you what the destination is.

=======

rm

=======

/ {}$ rm (-r -f) (target)

- "rm" is used to delete the targetted files.

- "-r" means to recurse, or go into every inner directory automatically, erasing as it goes.

- You'll use the -r flag a lot, because you can't delete directories without it unless you use "rmdir", which is just more typing.

"-f" means force in case of permission errors, as long as you are root.

========

cp

========

/ {}$ cp (-f -a) (source) (destination)

- Copy the source file or directory to the destination.

- Use "-f" to force the copying, in the event of a potential overwrite.

- Use "-a" to maintain permissions of the original, you'll want to use this whenever you are copying anything important. I just use it all the time, but sometimes it won't work, such as when copying from an /sdcard to either the /system or /data partition.

-This is because the file system of your /sdcard doesn't care about permissions.

=========================

============

[VIM REFERENCE]|

============

Vim deserves, and has, entire websites devoted to it's use. Here are some of the basics.

------------

Using Vim|

------------

From the console, simply type:

/ {}$ vim

Where is obviously replaced by the name of the file you are editing.

Multiple files can be opened at once by just adding them as parameters to vim:

/ {}$ vim file1 file2 file3 file4 filen

---------------

Insert Mode |

---------------

This is the mode you want to be in to make any visible changes to the file you are editing.

- Enter Insert Mode by pushing "i" when vim opens.

- Exit Insert Mode by pushing Capslock.

Keys:

------

Backspace - In insert mode, deletes the previous character.

Capslock - Exits insert mode

---------------

Visual mode |

---------------

By typing in "v" instead of "i", you will enter visual mode; this is Vim's fancy way of saying you will be selecting text.

Keys:

------

- Copy or Cut text by hitting "y" or "d" after you've made a selection

- Paste with "p" or "P" (that is, Shift+p). Shift-"p" puts the text before the cursor whereas plain lowercase "p" will paste it after.

- When you're done highlighting what you want to either cut or copy, just hit Capslock to go back to Command Mode.

-------------------

Command Mode |

-------------------

Vim starts out in Command mode. It seems confusing but once you get used to it, you can't help but hate Notepad. :D

Some of the more common commands are listed below.

Keys:

------

u - Undo

Shift+r (Usually denoted as R) - Enter Replace Mode, where you are replacing text instead of inserting it.

[#]yy - Yank (copy) the current line if you just entered "yy", or copy "#" lines if you enter #yy, ie: 5yy to copy 5 lines.

[#]dd - Delete (cut) the current line, or delete # lines if preceded by a #.

p - Pastes after the cursor

Shift+p (usually denoted as P) - Pastes before the cursor

:[#] - (Ignore the square brackets; a colon followed by a number goes to that particular line in the text file you are editing. eg: ":5" goes to line 5. (Obviously, don't type the quotation marks in.)

Note: - If you are in Insert mode, you will have to push Capslock to exit and be allowed to enter Command Mode by entering a ":"

- It's fairly common practice to just hit Capslock twice whenever you're done inserting so that you are sure to be able to hit ":" and proceed to enter another command.

:w - Write (save) the currently open file.

:q - Quit. If you haven't saved since making any changes, it will prompt you to either save your changes or append a "!" after "q" to quit without saving. (See below)

:q! - Force quit without saving.

:wq - Save and then quit.

:e [path to filename] Opens up another file; you can use bash command-line completion to scan the current directory, or otherwise just enter another path.

:next or :prev - Aptly named, move to the next or previous file if you opened vim with two or more files as parameters, ie:

/ {}$ vim file1 file2

:/[text] - Search for "text". ie: ":/search" will find instances of the text "search" in the current file and highlight them.

Note: You need to make sure you are aware of regular expressions/escape characters before using this reliably; it's not broken if you can't seem to search for a quotation mark or other special characters, you need to precede them by a \. ie: to look for a double-quote symbol " you would enter :/\". The \ tells it that the next character is meant to be taken literally and not symbolically.

:/[text]/[moretext]/gc - Replace "text" with "moretext" everywhere in the file and ask confirmation for each change. If you forget to type in the "gc" at the end, it'll just replace everywhere without asking you for confirmation.

That's all I'm going to put here. There are tons of guide out there and I've already preloaded a pretty awesome configuration (.vimrc located at /cache/.safestrap/home) and runtime files. If you want to quickly access the configuration file, you can type ",,e" in Command Mode and it will automatically pop open.

================

COLOR CHANGING

================

1. If you want to change the color scheme, you need to figure out what the RGB code for the color you want is. Here's a website that provides a large table of colors and their corresponding RGB color code:

http://web.njit.edu/~kevin/rgb.txt.html

For example, let's say we like the "SlateGray4" color from the table linked above want to use it for the menus in both Safe and Non-Safe mode. As you can see, in the "R;G;B; Dec" column, the three codes we are interested in are 108, 123 and 139.

2. Now that you know the color codes, in our case 108, 123 and 139, we simply do the following:

a) Push 7 from the main menu, or scroll down and select "console menu".

b) Push 1, or scroll down and select "open console"

(Don't panic if it takes a few seconds to load the console; on the first initialization or after wiping the /cache partition, it will take a few seconds to reconfigure itself.)

c) At the prompt, enter the following:

/ {}$ ns_rgb 108 123 139
/ {}$ s_rgb 108 129 139
/ {}$ cc
/ {}$ exit

Now, it'll take another second or two and when the menu pops back up, you'll see that it is the color we chose from the table. The "ns_rgb" command takes three parameters, each of which correspond to the R, G and B values of the color code, and uses them for the "Non-Safe" (hence the "ns") menu color.

Similarly, the "s_rgb" command, (well technically, it's a bash function but anyways...) takes the same three parameters. It is applied to the "Safe" menu color.

The "cc" command actually sets the color, so don't forget to enter it. Otherwise, you won't notice a change when you exit out from the console.

Feel free to experiment with different colors! If you don't what you've done and just want to reset it back to the way it way, just wipe the cache partition:

a) Push 3, or scroll down to "wipe menu".

b) Push 1, or just hit Enter on "wipe cache".

c) Confirm your selection by pushing 8 or scrolling down and selecting "yes - wipe cache".

=================================================

More to come as I have more time.