Essential BlackBerry Keyboard Shortcuts for Fighting RSI

do much more to relieve the dreaded BlackBerry thumb by taking advantage of keyboard shortcuts. Since so many exist, though, you’ll want to get started with learning the basics. Some shortcuts work for both e-mail and messaging, but others are exclusive to individual services.

Messaging instantly

compose messages [press and hold 'C']

reply ['R']

reply all ['L']

forward ['F']

two spaces create a period for a new sentence

Navigation to scroll up [Shift + Space]

to scroll down [space]

go to the top of a message ['T']

go to the bottom of a seemingly endless thread ['B']

proceed to the next date ['N']

go back to the previous date ['P']

go to the next unopened message ['U']

Calendar

If Calendar users adhere to the default ‘Day’ view, though, the options will need to be updated in order for the quick keys to work properly. To change the settings, open the Calendar, press the BlackBerry menu button and select ‘Calendar Options.’ Then, choose ‘General Options,’ scroll down to the ‘Actions’ section and set the ‘Enable Quick Entry’ box to “No.” If users opt for the ‘Agenda,’ ‘Week’ or ‘Month’ views, the settings do not need to be changed. swap to ‘Agenda’ mode ['A'] bring up ‘Day’ ['D'] switch to ‘Week’ ['W] cue the ‘Month’ perspective ['M'] schedule appointments ['C'] move to the next day, week or month ['Space'] depending upon the view scroll back through the previous day, week or month ['Space + Shift'] move the Calendar back to the current date ['T'] jump to a specific, selected date ['J']

via Essential BlackBerry Keyboard Shortcuts for Fighting RSI.

Posted in General | Tagged | Comments Off

Getting information about your Linux system

Getting information about your Linux system

To see which kernel version you are running:

uname -r

To see which version of Ubuntu you are running:

lsb_release -a

To get information about installed hardware:

lspci

To see whether the kernel detected plugging in of an external device:

dmesg | tail

via Linux etc. » Blog Archive » Getting information about your Linux system.

Posted in ubuntu, Unix | Comments Off

Colorful Shells Using ANSI Color Codes

Colorful Shells — Using ANSI Color Codes

ansi colors

Abstract:

In an ANSI compatible terminal (like xterm, rxvt, konsole …) text may be shown in colors different from black/white. This article will demonstrate text in bold or in color.

_________________ _________________ _________________

 

General

In real life every Linux user gets to face the Bash. At first glance that looks very boring, but there are many possibilities to give one’s shell the personal touch. Colored enhancement of the shell prompt make the shell unique as well as better legible.

In my description I will refer to the Bash shell. The escape sequences may differ between terminals, for this text I am using an ANSI terminal.

Configuration of the Shell

Setting of shell colors happens in the personal configuration file of the bash ~/.bashrc or in the global configuration file /etc/bashrc. The appearance of the prompt is being set with the PS1 variable in bashrc.

Generally, the entry should look like this:

~/.bashrc: PS1=”\s-\v\$ ”

\s stands for the name of the shell and -\v for its version. At the end of the prompt we are placing a $. Since this gets a bit boring, the following entry – which is default in most Linux distributions – may be used:

~/.bashrc: PS1=”\u@\h \w \$ ”

This stands for user@ current_directory $, which is the normal shell prompt most Linux users are familiar with.

Escape Sequences

To add a personal touch by coloring the prompt we are using escape sequences. An escape sequence is a control instruction which orders the shell to execute a specific step. An escape sequence usually begins with ESC (thus the name). In the shell chown as ^[. This way of writing needs a bit getting used to, \033 accomplishes the same (ESC is ascii 27 decimal = 33 octal).

To enter an escape sequence directly into the shell we have to precede it with crtl-v: CTRL-v ESC.

Using the Colors of the Shell

I am going to explain the colors of the shell with an example prompt.

~/.bashrc: PS1="\[\033[0;32;40m\u@\h:\w\$ \]”

This displays the complete prompt in green. Like this:

nico@ebrain:~$

\033 starts the escape sequence, with [ we are beginning the color definition. The following 0 specifies default font width. Other possibilities for this I am going to introduce later. The string will be enclosed in \[ and \] to prevent the text of the escape sequence from showing up in the display of the shell and taking too much space.

Next we are choosing the color of the foreground (in this case 32, which is green). The background color 40 stands for black. To prevent the text after the prompt from being green, we are closing the escape sequence with \033[0m, which is the default color of the shell. For the foreground as well as the background 8 colors are available.

Choices: red, green, yellow, blue, magenta, cyan and white. The color codes for this are 30 (black), 31 (red), 32 (green), 33 (yellow), 34 (blue), 35 ( magenta), 36 (cyan), 37 (white).

Setting the background colors follows the same scheme, but instead of the first digit '3' we are using '4', like 40, 41, 42, 43, 44, 45, 46, 47.

Example:

~/.bashrc: PS1="\[\033[0;37;44m\u@\033[0;32;43m\h:\033[0;33;41m\w$\033[0m\]”

This gives us a very colorful prompt:

nico@ ebrain: ~$

To test these settings we are using export PS1=”string”, later we may transfer the setting into .bashrc. My current prompt looks like this:

PS1=”\[\033[1;34;40m[\033[1;31;40m\u@\h:\w\033[1;34;40m]\033[1;37;40m $\033[0;37;0m\] ”

[ nico@ebrain:~ ]

 

Text Properties

As previously mentioned, the ’0′ after the first escape sequence is the default color setting for the text of the shell prompt. For the text properties the following values make sense: 0, 1, 22, 4, 24, 5, 25, 7, 27 with the following meaning: default, bold, not bold, underlined, not underlined, blinking and not blinking, invers, not invers.

With the help of the following short script we can have a look at the color combinations.

#!/bin/sh

############################################################

# Nico Golde <nico(at)ngolde.de> Homepage: http://www.ngolde.de

# Last change: Mon Feb 16 16:24:41 CET 2004

############################################################

for attr in 0 1 4 5 7 ; do

echo “—————————————————————-”

printf “ESC[%s;Foreground;Background – \n” $attr

for fore in 30 31 32 33 34 35 36 37; do

for back in 40 41 42 43 44 45 46 47; do

printf ‘\033[%s;%s;%sm %02s;%02s ‘ $attr $fore $back $fore $back

done

printf ‘\n’

done

printf ‘\033[0m’

done

The script can be downloaded as a tar.gz from: showansicol.tar.gz

Another Application

The ability to set colors in the shell is not only useful to create a more beautiful shell prompt but may also be beneficial for the programming of a program for the console.

For every use of colors the use of libraries such as slang or ncurses would be necessary, this would greatly inflate the size of the binary file. Ncurses has the advantage of being more or less independant from the type of terminal.

via lf335, SystemAdministration: Colorful Shells — Using ANSI Color Codes.

Posted in Scripts, Shell, Unix | Comments Off

Blackberry and Ubuntu

Linux users who also use a BlackBerry ™ now have an option for managing their BlackBerry directly from Linux.

Barry is an Open Source application that will provide synchronization, backup, restore and program management for BlackBerry ™ devices. Barry is primarily developed on Linux, but is intended as a cross platform library and application set, targeting Linux, BSD, 32/64bit, and big/little endian systems.

The Barry project began in October 2005 and has steadily added features and polish to Blackberry usage on Linux ever since. We were the first to reverse engineer the battery charging handshake via USB.

Today, it is possible to:

* charge your Blackberry’s battery from your USB port
* parse the following database records: Address Book, Email, Calendar, Service Book, Memos, Tasks, PIN Messages, Saved Email, Folders, Phone Call Logs, and SMS messages
* build the following database records: Address Book, Calendar, Memos, Tasks
* export Address Book contacts in text or LDAP LDIF format
* make full data backups and restores of your device using a GUI
* synchronize contacts and calendar items using the OpenSync framework
* use the Blackberry as a modem
* install and manage Java applications from the command line
* take screenshots of your device
* set the device time from the command line
* … and more

Install barry in ubuntu 10.10/10.04/9.10

Open terminal and run the following commands

sudo add-apt-repository ppa:doctormo/barry-snapshot
sudo apt-get update
sudo apt-get install barry-util opensync-plugin-barry-4x

Credit goes from here

Binary packages

* opensync-plugin-barry (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* barrybackup-gui-dbg (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* libbarry-dev (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* opensync-plugin-barry-dbg (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* libbarry0 (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* barry-util-dbg (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* barrybackup-gui (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* libbarry0-dbg (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

* barry-util (amd64) (armel) (i386) (ia64) (powerpc) (sparc)

via “barry” source package : Lucid (10.04) : Ubuntu.

Posted in ubuntu | Comments Off

Syncing Tomboy Notes Over SSH | TechnoGeeks

Tomboy notes has a nifty syncing feature that enables us to sync notes over SSH.

1. Create a directory on a server with SSH to host the notesssh tgeek@myserver.examplemkdir tomboy

2. Create an SSH key on each machine that you want to sync with and do necessary prepssh-keygen -t rsassh-copy-id -i /path/to/keys/mynewkey tgeek@myserver.example

3. Download sshfs on each machine that you want to sync withsudo apt-get install sshfs

4. Setup Tomboy to syncImportant: If Tomboy is already running make sure to kill it before attempting these steps. If you had Tomboy running while you installed sshfs then it will not recognize sshfs until you kill all Tomboy processes and start it again.

4.1 In Tomboy, goto Preferences.

4.2 Click on the Add-ins tab and ensure that Synchronization -> SSH Sync Service Add-in is Enabled if it is grayed out then it is disabled.

4.3 Click on the Syncronization tab.

4.4 For Service, choose SSH sshfs FUSE

4.5 Enter the credentials for your server that you setup in step 1.ex. Server: myserver.exampleUsername: tgeekFolder Path: /home/tgeek/tomboy

4.6 Click SaveI have this working in Ubuntu 9.10 and it is beautiful!

via Syncing Tomboy Notes Over SSH | TechnoGeeks.

Posted in ubuntu | Tagged , | Comments Off

UNIX: Remove a file with a name starting with – character

UNIX: Remove a file with a name starting with – characterby Vivek Gite on November 30, 2007 · 4 commentsQ. Accidentally, I had created a file called -foo. Now how do I remove a file with a name starting with ‘-’ under UNIX or Linux operating system?A. Use standard UNIX rm command, as follows:rm commandUse rm command to remove files or directories as followsrm ./-foorm ./-filenamerm — -fooAlternatively, you can also use UNIX / Linux inode number to delete a file with strange names.

via UNIX: Remove a file with a name starting with – character.

Posted in Shell, Unix | Tagged , | Comments Off

KSH Shell Script Template

#!/usr/bin/ksh93
################################################################
function usagemsg_your_function {
print ”
Program: your_function

Place a brief description ( < 255 chars ) of your shell
function here.

Usage: ${1##*/} [-?vV]

Where:
-v = Verbose mode – displays your_function function info
-V = Very Verbose Mode – debug output displayed
-? = Help – display this message

Author: Your Name (YourEmail@address.com)
\”AutoContent\” enabled

}
################################################################
####
#### Description:
####
#### Place a full text description of your shell function here.
####
#### Assumptions:
####
#### Provide a list of assumptions your shell function makes,
#### with a description of each assumption.
####
#### Dependencies:
####
#### Provide a list of dependencies your shell function has,
#### with a description of each dependency.
####
#### Products:
####
#### Provide a list of output your shell function produces,
#### with a description of each product.
####
#### Configured Usage:
####
#### Describe how your shell function should be used.
####
#### Details:
####
#### Place nothing here, the details are your shell function.
####
################################################################
function your_function {
typeset VERSION=”1.0″
typeset TRUE=”1″
typeset FALSE=”0″
typeset VERBOSE=”${FALSE}”
typeset VERYVERB=”${FALSE}”

while getopts “:vV” OPTION
do
case “${OPTION}” in
‘v’) VERBOSE=”${TRUE}”;;
‘V’) VERYVERB=”${TRUE}”;;
‘?’) usagemsg_your_function “${0}” && return 1 ;;
‘:’) usagemsg_your_function “${0}” && return 1 ;;
‘#’) usagemsg_your_function “${0}” && return 1 ;;
esac
done

shift $(( ${OPTIND} – 1 ))

trap “usagemsg_your_function ${0}” EXIT

#### Place any command line option error checking statements
#### here.  If an error is detected, print a message to
#### standard error, and return from this function with a
#### non-zero return code.  The “trap” statement will cause
#### the “usagemsg” to be displayed.

trap “-” EXIT

(( VERYVERB == TRUE )) && set -x
(( VERBOSE  == TRUE )) && print -u 2 “# Version……..: ${VERSION}”

################################################################

####
#### Your shell function should perform it’s specfic work here.
#### All work performed by your shell function should be coded
#### within this section of the function.  This does not mean that
#### your function should be called from here, it means the shell
#### code that performs the work of your function should be
#### incorporated into the body of this function.  This should
#### become your function.
####

return 0
}
################################################################

your_function “${@}”

Posted in Shell | Tagged , , | Comments Off

Bourne/Korn Shell Coding Conventions

This document describes the shell coding style used for all the init.d script changes integrated into Solaris.

All new init.d shell code should conform to this coding standard, which is intended to match our existing C coding standard.

When in doubt, think “what would be the C-Style equivalent?”
Table of contents
1 Basic Format
2 If, For, and While
3 Test Built-in
4 Single-line if-statements
5 Infinite Loops
6 Exit Status and If/While Statements
7 Variable References
8 Variable Naming
9 Quoting
10 Testing for (Non-)Empty Strings
11 Commenting
12 Pathnames
13 Interpreter Magic
14 Use of the C shell

via Bourne/Korn Shell Coding Conventions (Community Group on.shellstyle) – XWiki.

Posted in Shell | Tagged | Comments Off

KSH – Paranoia, and good programming practices

Paranoia, and good programming practices
First, a bit of good programming practice:

Comment your code.

You really should at MINIMUM have some comment about every page (that’s every 24 lines).
Ideally, you should always comment all your functions. One-line functions can probably stand by themselves, but otherwise, a quick single line comment is a good thing to have for small functions.

Continue reading

Posted in Shell | Tagged , | Comments Off

Shell script to find all world-writable files and directories on Linux / UNIX system

Continue reading

Posted in Scripts, Shell | Tagged , | Comments Off