среда, 14 января 2015 г.

Forward local emails to external email

Very often when you go to server via ssh you see:

You have mail.

Which you can see into /var/mail/ubuntu. Yep yo can see it on server by mutt.
Other solution is to forward it to another email which you check daily:

1. Instal mailx. To check all is ok:

#echo 'it is test' | mailx -s 'test email' 'my@email.com'

2. https://help.ubuntu.com/community/PostfixBasicSetupHowto#Per_User_.forward_Files
Add your email to the .forward file into home folder:

Per User .forward Files

Users can control their own mail delivery by specifying destinations in a file called .forward in their home directories. The syntax of these files is the same as system aliases, except that the lookup key and colon are not present.
I will illustrate an example here:
Assume that you need to forward all the mails which come to the sysadmin account to an another account. Enter the following commands:
su - sysadmin
touch .forward
Then open the .forward file
vi .forward
Add the following code:
fossedu@example.com
Remember to use email address which exists in this exercise.


Now send a mail to sysadmin and mail should come to fossedu@example.com


пятница, 2 января 2015 г.

Creating New Admin Users into CouchDB

Creating New Admin Users

Let’s do another walk through the API using curl to see how CouchDB behaves when you add admin users.
> HOST="http://127.0.0.1:5984"
> curl -X PUT $HOST/database
{"ok":true}
When starting out fresh, we can add a database. Nothing unexpected. Now let’s create an admin user. We’ll call her anna, and her password is secret. Note the double quotes in the following code; they are needed to denote a string value for the configuration API (as we learned earlier):
curl -X PUT $HOST/_config/admins/anna -d '"secret"'
""

From: http://guide.couchdb.org/draft/security.html