0

Android: Restore contacts and sms data from data.img files

Contacts and sms data store in the path below:

data\com.android.providers.contacts
data\com.android.providers.telephony


But before that you need to extract data.img (Nandroid image):

Use unyaffs.exe in a Windows environment  with the format below:
unyaffs  image_file_name

Then you will get your data.img file extracted. Find your data from the above path and restore them to the same path of your phone system, then reboot to get your data reloaded.

0

Best overall compression program



Position Program #1st pos #2nd pos #3th pos #4th pos #5th pos #6th pos #7th pos #8th pos Points
01PAQ8PX6220000088
02WinRK 3.1.24410100082
03PAQAR 4.50133200049
04NanoZip 0.08a0012123133
05DURILCA 0.50110401032
06SLIM 0.23d0002101218
07STUFFIT 140200000016
08ZPAQ 2.050000121113
09LPAQ80010011112
10PPMonstr J rev.10000030110
11RKC 1.02000100027
12EPM r9000001105
13Ocamyd 1.66test1000000204

- Scoring similar to Formula 1 2003 system:
  1st place, 10 points;  2nd place, 8 points
  3th place, 6 points ;  4th place, 5 points
  5th place, 4 points ;  6th place, 3 points
  7th place, 2 points ;  8th place, 1 point
- Only programs with at least 2 top8 scores will be listed.
- If two programs have the same amount of points the program with the most 1st places (2nd places etc) will be regarded the better program.

0

How to remove saved Credentials (passwords) from Windows

Have you ever tried accessing a network device or resource only to find that last time you accessed that resource, you used a username and password that no longer works, or does not have the proper access.
This usually happens when you use credentials other than yours to access a resource on your network, or to access a resource on someone else's network, and you check the "Remember my password" check box.

Ok, so you want to remove that password, but how. Simple, just follow these simple instructions to see all the passwords you've cached on your machine:

To removed cached credentials

1. Click Start and select Run
2. In the Open field type "rundll32.exe keymgr.dll, KRShowKeyMgr"
3. Once the Stored Usernames and Passwords interface opens you can select any of the entries and select Properties to view the existing information
4. To remove a saved password you can select one of the entries and select Remove. A confirmation screen will appear. Click on OK and the account will be removed
5. You can add additional saved passwords as well by clicking on the Add button and entering the appropriate information
6. Repeat the steps above as needed to add, remove or edit saved passwords
7. When you are done using the interface click the Close button
That's all there is to it. This is a great way to see if, while working on a machine, you've accidentally saved your credentials, as any username/password combinations in this list will survive a reboot, and still be available.



0

How to remove network drive from registry

First and foremost, back up your registry!! Then open regedit and search for Mountpoint key in the \HKEY)CURRENT_USER\Software\Microsoft\windows\CurrentVersion\Explorer folder find the share you need removed and delete it.

The registry key for my share was like this ##server#share and after i deleted and restart i could connect to the share no problem

0

How to install fonts in Linux – Ubuntu, Debian

How to install fonts in Linux – Ubuntu, Debian

Ubuntu Linux searches for fonts in specific locations as listed in the /etc/fonts/fonts.conf file.
A look at the contents of /etc/fonts/fonts.conf file indicates the following directories which are searched by Ubuntu Linux for fonts. They are :
  1. /usr/share/fonts
  2. /usr/share/X11/fonts
  3. /usr/local/share/fonts
  4. ~/.fonts
So if you want to install new fonts in Ubuntu Linux or Debian for that matter, you can copy the fonts to any one of the 4 directories listed above.

The last directory ~/.fonts is a local hidden directory in every user’s  Home folder. If you install the new fonts in this directory, the fonts will be available only for the person logged into that particular user account.

If you want your new fonts to be available system wide, to all users, then you should install them in any one of the first three directories listed above.

Once all your fonts are copied to the specific font directories, you have to make Ubuntu Linux aware of the new fonts so that it can make use of them. This is done by running the following command in the console :

$ sudo fc-cache -f -v
 
Please note that you have to have super user powers to run this command. In Debian Linux, it means you have to be logged in as root user.

What the fc-cache command does is, it reads and caches all the fonts installed in the font directories. You have to run this command each time you install any new fonts in Linux.

0

How to mount an USB drive maually so everyone can read/write to it?

Not only the umask=1000 but also users (plural) for more than one user and rw (read/write).

Read the man pages for umask, mount, fstab and this Quick and Dirty Guide to Linux File Permissions

In /etc/fstab:
Code:
/dev/sda1        /mnt/flash       vfat        users,umask=1000,rw,noauto 0   0

Then run:
mount /mnt/flash

0

Useful PostgreSQL Commands

article source: http://www.thegeekstuff.com/2009/05/15-advanced-postgresql-commands-with-examples/

postgreSQL DB
Some of the open source application comes with postgreSQL database. To maintain those application, companies may not hire a fulltime postgreSQL DBA. Instead they may request the existing Oracle DBA, or Linux system administrator, or programmers to maintain the potgreSQL. In this article let discuss about the 15 practical postgresql database commands which will be useful to both DBA and expert psql users.

Also, refer to our previous article about 15 Practical PostgreSQL DBA Commands.

1. How to find the largest table in the postgreSQL database?

$ /usr/local/pgsql/bin/psql test
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# SELECT relname, relpages FROM pg_class ORDER BY relpages DESC;              relname              | relpages
-----------------------------------+----------
 pg_proc                           |       50
 pg_proc_proname_args_nsp_index    |       40
 pg_depend                         |       37
 pg_attribute                      |       30

If you want only the first biggest table in the postgres database then append the above query with limit as:
# SELECT relname, relpages FROM pg_class ORDER BY relpages DESC limit 1; relname | relpages
---------+----------
 pg_proc |       50
(1 row)

  • relname – name of the relation/table.
  • relpages - relation pages ( number of pages, by default a page is 8kb )
  • pg_class – system table, which maintains the details of relations
  • limit 1 – limits the output to display only one row.

2. How to calculate postgreSQL database size in disk ?

pg_database_size is the function which gives the size of mentioned database. It shows the size in bytes.
# SELECT pg_database_size('geekdb');pg_database_size
------------------
         63287944
(1 row)

If you want it to be shown pretty, then use pg_size_pretty function which converts the size in bytes to human understandable format.
# SELECT pg_size_pretty(pg_database_size('geekdb')); pg_size_pretty
----------------
 60 MB
(1 row)

3. How to calculate postgreSQL table size in disk ?

This is the total disk space size used by the mentioned table including index and toasted data. You may be interested in knowing only the size of the table excluding the index then use the following command.
# SELECT pg_size_pretty(pg_total_relation_size('big_table')); pg_size_pretty
----------------
 55 MB
(1 row)

How to find size of the postgreSQL table ( not including index ) ?

Use pg_relation_size instead of pg_total_relation_size as shown below.


# SELECT pg_size_pretty(pg_relation_size('big_table')); pg_size_pretty
----------------
 38 MB
(1 row)

4. How to view the indexes of an existing postgreSQL table ?

Syntax: # \d table_name
As shown in the example below, at the end of the output you will have a section titled as indexes, if you have index in that table. In the example below, table pg_attribute has two btree indexes. By default postgres uses btree index as it good for most common situations.
test=# \d pg_attribute   Table "pg_catalog.pg_attribute"
    Column     |   Type   | Modifiers
---------------+----------+-----------
 attrelid      | oid      | not null
 attname       | name     | not null
 atttypid      | oid      | not null
 attstattarget | integer  | not null
 attlen        | smallint | not null
 attnum        | smallint | not null
 attndims      | integer  | not null
 attcacheoff   | integer  | not null
 atttypmod     | integer  | not null
 attbyval      | boolean  | not null
 attstorage    | "char"   | not null
 attalign      | "char"   | not null
 attnotnull    | boolean  | not null
 atthasdef     | boolean  | not null
 attisdropped  | boolean  | not null
 attislocal    | boolean  | not null
 attinhcount   | integer  | not null
Indexes:
    "pg_attribute_relid_attnam_index" UNIQUE, btree (attrelid, attname)
    "pg_attribute_relid_attnum_index" UNIQUE, btree (attrelid, attnum)

5. How to specify postgreSQL index type while creating a new index on a table ?

By default the indexes are created as btree. You can also specify the type of index during the create index statement as shown below.
Syntax: CREATE INDEX name ON table USING index_type (column);

# CREATE INDEX test_index ON numbers using hash (num);

6. How to work with postgreSQL transactions ?

How to start a transaction ?

# BEGIN -- start the transaction.

How to rollback or commit a postgreSQL transaction ?

All the operations performed after the BEGIN command will be committed to the postgreSQL database only you execute the commit command. Use rollback command to undo all the transactions before it is committed.
# ROLLBACK -- rollbacks the transaction.
# COMMIT -- commits the transaction.

7. How to view execution plan used by the postgreSQL for a SQL query ?

# EXPLAIN query;

8. How to display the plan by executing the query on the server side ?

This executes the query in the server side, thus does not shows the output to the user. But shows the plan in which it got executed.
# EXPLAIN ANALYZE query;

9. How to generate a series of numbers and insert it into a table ?

This inserts 1,2,3 to 1000 as thousand rows in the table numbers.
# INSERT INTO numbers (num) VALUES ( generate_series(1,1000));

10. How to count total number of rows in a postgreSQL table ?

This shows the total number of rows in the table.
# select count(*) from table;

Following example gives the total number of rows with a specific column value is not null.
# select count(col_name) from table;

Following example displays the distinct number of rows for the specified column value.
# select count(distinct col_name) from table;

11. How can I get the second maximum value of a column in the table ?

First maximum value of a column

# select max(col_name) from table;

Second maximum value of a column

# SELECT MAX(num) from number_table where num  < ( select MAX(num) from number_table );

12. How can I get the second minimum value of a column in the table ?

First minimum value of a column

# select min(col_name) from table;

Second minimum value of a column

# SELECT MIN(num) from number_table where num > ( select MIN(num) from number_table );

13. How to view the basic available datatypes in postgreSQL ?

Below is the partial output that displays available basic datatypes and it’s size.
test=# SELECT typname,typlen from pg_type where typtype='b';
    typname     | typlen
----------------+--------
 bool           |      1
 bytea          |     -1
 char           |      1
 name           |     64
 int8           |      8
 int2           |      2
 int2vector     |     -1
  • typname – name of the datatype
  • typlen – length of the datatype

14. How to redirect the output of postgreSQL query to a file?

# \o output_file
# SELECT * FROM pg_class;
The output of the query will be redirected to the “output_file”. After the redirection is enabled, the select command will not display the output in the stdout. To enable the output to the stdout again, execute the \o without any argument as mentioned below.
# \o

As explained in our earlier article, you can also backup and restore postgreSQL database using pg_dump and psql.

15. Storing the password after encryption.

PostgreSQL database can encrypt the data using the crypt command as shown below. This can be used to store your custom application username and password in a custom table.
# SELECT crypt ( 'sathiya', gen_salt('md5') );

PostgreSQL crypt function Issue:

The postgreSQL crypt command may not work on your environment and display the following error message.
ERROR:  function gen_salt("unknown") does not exist
HINT:  No function matches the given name and argument types.
         You may need to add explicit type casts.

PostgreSQL crypt function Solution:

To solve this problem, installl the postgresql-contrib-your-version package and execute the following command in the postgreSQL prompt.
# \i /usr/share/postgresql/8.1/contrib/pgcrypto.sql

1

How to recover postgres database from postgres data folder

If Windows crashed by some reason you can't get into the system, then if you have to reinstall Windows or upgrade to a new hard drive. As long as the Postgres data folder still there then you are lucky to get your database back.

1) install the same version postgres you had on the old system before, say postgres8.3;

2) stop the postgres service from the service form or use the command below:
    net stop pgsql-8.3

3) open a CMD, then type in:
    runas   /user:postgres   cmd
    The above command will open a command window as postgres role, it will ask for the postgres service password to get the access. Please note here that is not postgres user password;

4) cd into postgres folder:
    c:\program files\postgres\

5) delete everything under the data folder;

6) then copy the old data folder(say from U drive) cross, type in the command:
    xcopy /H /E /I U:\program files\postgres\data C:\program files\postgres\data

7) restart postgres services from the service form or use the command below:
    net start pgsql-8.3

After that, you should be able to log in to use your postgres database as before

0

How to setup an email forward Exchange 2007

To setup an email forward for a user within Microsoft Exchange 2007, follow the instructions below:

1) Open Exchange Management Console
2) Expand Recipient Configuration
3) Click Mailbox
4) A list of all mailboxes will be appear in the right hand pane. Right click the mailbox you wish to setup the mail forward on.
5) Click properties
6) Click the mailflow settings tab
7) Double click Delivery Options
8.) Click the check box forward to
9) Browse for the mailbox you wish to forward emails to
10) Click OK to apply settings

If you wish for a copy of each email to remain in the users mailbox, click the tick box labelled Deliver message to both forwarding address and mailbox

0

How to remove postgres user from Windows

open CMD by administrator mode, then type in:

net user postgres /delete

If you just want to change user postgres' password to 'postgres', then type in:

net user postgres postgres

0

Upgrade OpenOffice.org 2.4 to 3.0 on Debian


Downloading from OpenOffice.org


The other way is to download and install packages from the OpenOffice.org site.
Go to:
http://download.openoffice.org/other.html

download the "Linux DEB" (should say GNU/Linux ¬¬) package in your language (let's use English on this one), after downloading around 140 MB then a file named: 
OOo_3.0.1_LinuxIntel_install_en-US_deb.tar.gz

should be on your desktop (if using the default configuration from GNU IceCat). Now we prepare a better directory:
$ sudo mkdir /opt/OOo3

then untar it with:
 $ tar xvzf /path/to/tar/file/OOo_3.0.1_LinuxIntel_install_en-US_deb.tar.gz 
i.e. $ tar xvzf /home/your_user_name/Desktop/OOo_3.0.1_LinuxIntel_install_en-US_deb.tar.gz

extracted folder (in the home directory) should be:
OOO300_m15_native_packed-1_en-US.9379

move the extracted folder to the prepared directory:
$ sudo mv /home/your_user_name/OOO300_m15_native_packed-1_en-US.9379 /opt/OOo3/

then we install all the deb files inside the DEBS folder.
 $ cd /opt/OOo3/OOO300_m15_native_packed-1_en-US.9379/DEBS
 $ sudo dpkg -i *.deb

This will install OpenOffice.org 3 on the system. Now for desktop integration, it is necessary to remove the "old" OpenOffice (2.4):
$ sudo apt-get remove openoffice.org-core

then install the desktop integration file:
$ cd desktop-integration
$ sudo dpkg -i openoffice.org3.0-debian-menus_3.0-9376_all.deb
The Office menus will thus be updated.

You may get a conflicting error message when installing the menu package, this is because while it is technically installed, the launchers (a link to the actual program) are not written to the applications menu. Now try to issue the command below:


  $ sudo apt-get --purge remove openoffice.org-common

If that fails you can also go to synaptic package manager search "openoffice.org-common" deselect the box there and click apply. This will remove your previous version's common directory and you should be good to go.

0

teamviewer for Linux

wget http://www.teamviewer.com/download/teamviewer_linux.tar.gz
tar xf teamviewer_linux.tar.gz
cd teamviewer6
./teamviewer

0

Userful Linux tools for windows

ssh & scp for Windows

PuTTY, (and its file transfer utility, pscp), are excellent Windows ssh/scp implementations, and are a piece of cake to get up and running. These programs are not zipped and do not require any installation.

Downloads:
putty: putty.exe
pscp: pscp.exe

nmap for Windows

Nmap ("Network Mapper") is a free and open source utility for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are avalable for Linux, Windows, and Mac OS X.

Downloads
nmap 5.51 self-installer: nmap-5.51-setup.exe
nmap 5.51 command-line: nmap-5.51-win32.zip

rdesktop for Windows


rdesktop is a terminal services client for X windows by Matthew Chapman. This is a native Windows port of rdesktop.

Requirements

Windows 95 OSR2/98/Me/NT 4/2000/XP/2003/2008/Vista/7

Download

rdesktop 1.6

Download: rdesktop-1.6.0-win32.zip

Requirements:
X server for Windows (e.g. Xming or Cygwin X11)
You must have the X server running prior to using rdesktop.

Older versions: Note: this snapshot is not a complete port and requires Cygwin 1.5.12 to run.
Binaries: rdesktop-bin-win32-20041201.zip
Source: rdesktop-src-win32-20041201.tar.bz2

Full native ports of rdesktop 1.2. Cygwin is not required.
Binaries: rdesktop-bin-win32-20030219.zip
Source: rdesktop-src-win32-20030219.tar.bz2
Binaries: rdesktop.zip
Source: rdesktop-src.tar.gz

Compiling rdesktop for Win32

http://www.soren.schimkat.dk/Blog/?p=69

Licence

GNU General Public License
rdesktop © Matthew Chapman 1999-2003 © Christopher January 2002-2003,2004

Related Links

www.rdesktop.org

0

How to set Postgresql money type to use 3 decimal places in Windows

LINUX
=====

Under Linux, type command in postgres database:

set lc_monetary to 'ar_BH.utf8';

ar_BH represents Arabic (Bahrain) locale, the above command change the locale monetary setting on-the-fly in postgresql database, the let do a test:

select 34.888::text::money;

You will get 34.888 with 3 decimal places money type. Tested in Postgresql 8.4.6.

WINDOWS
=======

However the above set command will get an error message under Windows.

FATAL: invalid value for parameter “lc_monetary”

You will need to:

set lc_monetary to "Arabic, Bahrain";

This will set the lc_monetary to arabic locale but only display 2 decimal places by default, it seems everything right of the comma is ignored.

To workaround this, use an '_' in plase of ', ' like:

set lc_monetary to "Arabic_Bahrain";

Tested with Windows XP + PostgreSQL 9.0.3(this solution should work for PostgreSQL 8.3 or later version too)

Thanks Jasen who get this resolved, more information please see his post @ postgresql forum:
http://postgresql.1045698.n5.nabble.com/win-Locales-quot-Arabic-Gum-quot-td3369213.html

0

How to configure public folder in Exchange server 2007

1. Create a pulic folder
open Exchange Management Console
=> Public Folder Management Console
=> Default Public Folder
=> New Public Folder(from right-click menu)

then follow the wizard to create a public folder. Fox example give it a name Test, so the public folder path will be "\Test";

2. Use the Exchange Management Shell to add public folder permissions for a client user
open Exchange Management Shell
=> Run command
"Add-PublicFolderClientPermission -Identity "\Test" -AccessRights Owner -User TestUser"

This will give user "TestUser" the "Owner" accessRights which has full permission of the public folder;

More info please go to:
http://technet.microsoft.com/en-us/library/aa998834.aspx

0

Enable or Disable UAC From Windows Command Line

This should apply to Windows 7 / Vista

Disable UAC

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Enable UAC

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

After you enable or disable UAC, you will have to reboot your computer for the changes to take effect.

Note: After disabling and turning off UAC, a red X shield icon of Windows Security Center will be displayed in the notification area (system tray).

The alert trigger events include the following:

* Disable Windows Firewall.
* Disable antivirus program.
* Do not install or uninstall anti-virus.
* Outdated virus definition and signature.
* Disable Automatic updates.
* Turf off User Account Control.
* Computer requires to restart after applying hotfix or update.

These security concerns is relatively minor and can be safely dismissed, especially if the issue is purposely or intentionally done. In this case, the WSC Alerts icon and message can be turned off so that the system no longer will trigger notification when a problem occurred.

1. If you can see the Security Center shield icon in the notification area, simply double click on the icon to open Windows Security Center. Else, click on Windows Start button, select Control Panel, and then Windows Security Center.
2. Click on “Change the way Security Center alerts me” link in the left pane in Windows Vista. In Windows XP, it’s located under Resources section.
3. In Windows Vista, choose either “Don’t notify me, but display the icon” or “Don’t notify me and don’t display the icon” option, with later as complete disable of all Security Center Alerts.

In Windows XP, a Alert Settings dialog box will appear. Clear the Firewall, Automatic Updates, and/or Virus Protection check boxes to disable the respective component’s alert, and then click OK.

0

Outlook: Folder sharing is not available

We have a user that wishes to share his contact list with other employees in his office.
Everyone receives email via the same Exchange 2007 server.

He did the Permissions for the contacts (Right click, permissions added the user) and when she selects "SHARE CONTACT" she gets the error
"Folder sharing is not available with the following entries because of permission settings on your network."

Possible Soulution
==================

If your user in cached mode? If yes, try to do a Send and Receive, if that fails, disable cached mode, restart outlook, try to share the contact again and then re-enable the cached mode.

Cache Mode Toggle in Outlook 2007:
Tools > Account Settings > Highlight your Exchange server account, and then click Change
To turn Cached Exchange Mode on or off, under "Microsoft Exchange Server:", check or uncheck Cached Exchange Mode. Click Next, and in the window that opens, click OK.
Click Finish. Restart Outlook for the change to take effect.

0

Outlook can't save password

The problem is Outlook ask for the password over and over again.

Solution
========

HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider

Delete the subkey

The user subkey folder resembles the following example:
S-1-5-21-124525095-708259637-1543119021-16701

Restart computer

Start Outlook, enter and save the password.