July 2013
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

Categories

July 2013
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

Recover lost passwords

To recover a password in Oracle, simply connect under command line mode on the server:

#sqlplus /nolog SQL>conn / as sysdba SQL>alter user Username identified by PASSWORD;

To reset your Orable database password:

Your password file should be under <orahome>\database\PWD<SID>.ora.

Delete it and run the Oracle password utility from the command prompt:

c\:Oracle\ora92\database>ORAPWD file=PWD<SID>.ora password={password} […]

zimbra backup.sh

#!/bin/bash # Zimbra Backup Script # This script is intended to run from the crontab as root # Date outputs and su vs sudo corrections by other contributors, thanks, sorry I don’t have names to attribute! # Free to use and free of any warranty! Daniel W. Martin, 5 Dec 2008 # Updated by […]

MySQL Backup

#! /bin/bash

 

# your MySQL server’s name SERVER=test.net

# directory to backup to BACKDIR=~/backups

# date format that is appended to filename DATE=`date +’%m-%d-%Y’`

#———————-MySQL Settings——————–#

# your MySQL server’s location (IP address is best) HOST=localhost

# MySQL username USER=username

# MySQL password PASS=password

# List all of the MySQL databases that you want […]

How to Grant Privileges to Users in MySQL

How to Grant Privileges to Users in MySQL

 

MySQL stores all its username and password data in a special database named mysql. You can add users to this database and specify the databases to which they will have access with the grant command, which has the syntax.

sql> grant all privileges on database.* to […]

ALTER TABLE syntax – MySQL

ALTER TABLE syntax – MySQL

 

You can then import it into a MySQL table by running:

 

#load data local infile ‘file.csv’ into table tablename

fields terminated by ‘,’

enclosed by ‘”‘

lines terminated by ‘\n’

(field1, field2, field3)

Basic MySQL Commands

Basic MySQL Commands

 

To login (from unix shell) use -h only if needed.

#mysql -h hostname -u root -p

Create a database on the sql server.

mysql> create database [databasename];

List all databases on the sql server.

mysql> show databases;

Switch to a database.

mysql> use [db name];

To see all the tables in […]

Setup Mysql Replication Between Linux(master) & Windows XP(Slave)

Step 1 – Configure the Master Server

First we have to edit /etc/mysql/my.cnf. We have to enable networking for MySQL, and MySQL should listen on all IP addresses, therefore we comment out these lines (if existant):

#skip-networking

#bind-address = 127.0.0.1

Furthermore we have to tell MySQL for which database it should write logs (these logs […]

Assign Virtual IPs to your NIC

Edit file /etc/sysconfig/network-scripts/ifcfg-eth0.

DEVICE=eth0

BOOTPROTO=static

BROADCAST=192.168.0.255

HWADDR=00:00:00:00:00:00

IPADDR=192.168.10.2

NETMASK=255.255.255.0

NETWORK=192.168.10.0

ONBOOT=yes

TYPE=Ethernet

GATEWAY=192.168.10.1

 

Make a copy of this in the same directory naming the new file ifcfg-eth0:1

# cp ifcfg-eth0 ifcfg-eth0\:1

 

Modify /etc/sysconfig/network-scripts/ifcfg-eth0:1 file. Modification are in bold

DEVICE=eth0:1

BOOTPROTO=static

BROADCAST=192.168.0.255

HWADDR=00:00:00:00:00:00

IPADDR=192.168.10.101

NETMASK=255.255.255.0

NETWORK=192.168.10.0

ONBOOT=yes

TYPE=Ethernet

GATEWAY=192.168.10.1

# cp ifcfg-eth0\:1 /etc/sysconfig/networking/devices/

[…]

How to take Linux backups powered by Rsync

RSync backups data and does it very clean and well. Rsync only transfers those data that have been modified and changed so that the destination host has an exact replica from the source host. Rysnc is a command line backup tool that handles data transfers in an effective and secure manner like any other known […]

How to Prevent the reuse of old passwords

For RHEL/Fedora distribution

To remember the last 5 passwords, add the line below to the file /etc/pam.d/system-auth file:

password sufficient /lib/security/pam_unix.so use_authtok md5 shadow remember=5

For Debian/ubuntu distribution

To remember the last 5 passwords, add the line below to the file /etc/pam.d/common-password file:

password sufficient /lib/security/pam_unix.so use_authtok md5 shadow remember=5