trenopic.com

0

The new web app that I developed it is called trenopic.com

Trenopic is a trending topic archive. It saves every hour the top ten trending topics for eleven countries (at the moment)

Comparte:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

How To: UNIX Add A User To A Group

0

Add A New User To A Group

Add a new user called tizon to a group called www-data, enter:

# useradd -G www-data -d /home/tizon -m tizon
# passwd tizon

Where,

  • -G www-data : Add tizon to secondary group called www-data. This group must exists on the system.
  • -d /home/tizon : Path to the tizon’s home directory
  • -m : Create the new user’s home directory if it does not already exist.
  • tizon : Username / login name

UNIX Add Existing User To A Secondary Group

Use usermod command to modify a user’s login definition on the system including group membership. For, example add user tizon to owners group, enter:

# usermod -G owners tizon

Add user gluetip to owners but also keep his existing membership of ftpusers, enter:

# usermod -G ftpusers,owners gluetip

UNIX Add Existing User To A Primary Group

Add tuuth to software primary group and change its existing group membership:

# usermod -g software tuuth
Comparte:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

Script is to check if mysql is currently running properly

0

1. Navigate to /root.

$ cd /root

2. Create a new file

$ vim mysql.sh

3. Insert the following lines to the file

#!/bin/bash
/usr/bin/mysqladmin ping | grep 'mysqld is alive' > /dev/null 2>&1
if [ $? != 0 ]
then
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
echo Starting at `date`
fi

4.  Give execute permission.

$ chmod 755  mysql.sh

5. Set a cron to check it at regular intervals, 5 min in this case

$ crontab -e
*/5 * * * * sh -x mysql.sh

6. Also give the command below to check the logs

$ touch /root/mysql.log
Comparte:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks



Post navigation