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  

Logoff remote desktop sessions via CMD

To List the session in remote server we use quser.exe

Display information about users logged on to the system.

QUSER [username sessionname sessionid] [/SERVER:servername]

username Identifies the username. sessionname Identifies the session named sessionname. sessionid Identifies the session with ID sessionid. /SERVER:servername The server to be queried (default is current).

Example:

C:>quser /server:testserver

USERNAME […]

How To Enable NTFS Support in CentOS 6.3

In this how to I will describe how to enable NTFS support in CentOS 6.3. By default CentOS 6.x doesnt comes with NTFS support to mount NTFS partition either on hard disk or usb drives. Fedora provies EPEL repository for Red Hat Enterprise Linux. EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort […]

Shell script for apache dos protection

#!/bin/bash cur=`date +%H%M%S` becur=`date -d “1 minute ago” +%H%M%S` badip=`tail -n 10000 /var/log/httpd/access_log | egrep -v “\.(gif|jpg|jpeg|png|css|js)” | awk -v a=”$becu r” -v b=”$cur” -F [‘ ‘:] ‘{t=$5$6$7;if (t>=a && t=20) print $2} ‘` if [ ! -z $badip ];then for ip in $badip; do if test -z “`/sbin/iptables -nL | grep $ip`”;then /sbin/iptables -I […]

Shell script to get the user list

#!/bin/bash awk -F: ‘{ print $1 }’ /etc/passwd awk -F: ‘{ print $1,$5 }’ /etc/passwd awk -F: ‘{ print $1,$NF }’ /etc/passwd awk ‘NF >0’ awk -F: -v ‘OFS=—‘ ‘{ print $1,$5 }’ /etc/passwd exit 0

How to install Oracle DB Client

Installing Oracle database Client to access DB Either you can use sqldeveloper as oracle client or you can execute it from the command line using # sqlplus We can access oracle server graphically by using a package called sqldeveloper. sqldeveloper-2.1.1.64.45-1.noarch.rpm

# rpm -ivh sqldeveloper-2.1.1.64.45-1.noarch.rpm

if the front end not getting install the jdk package and […]

Oracle DB startup Scripts

Starting oracle listener

$ lsnrctl start

Start the database

$ dbstart

Starting oracle Enterprise manager $ emctl start dbconsole

Shutting down the database $ dbshut

Stopping the listener $ lsnrctl stop

Stopping oracle Enterprise manager $ emctl stop dbconsole

Starts sqlplus without logging in to a database # su ­ oracle $ sqlplus /nolog

Logging […]

Oracle Schema Creation

A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are logical structures created by users to contain, or reference, their data. Schema objects include structures like tables, views, and indexes.

$ sqlplus /nolog

SQL> connect / as sysdba […]

Mysql DataBase in linux

We can check how to install mysql db in a linux machine All files of mysql including DB are stored in /var/lib/mysql/

 

All configuration files are in /etc/my.cnf

 

Install the package using yum # yum install mysql mysql-server

 

And then start the mysql server # service mysqld start

 

Here no root […]

Mysql source

Executing number of sql queries at a time using “source” command

Make all the queries in a single file, here i opened a file called “ctechz.sql” and saved all sql queries in this file.

# mysql -uroot -pmysql

mysql> use dbname; —– be in that database and then run the “source” command to update the […]

How to take Mysql Dump

We can just check how to back up and restore mysql database and tables

 

if we want the backup of entire mysql db # mysqldump -u root -p -A > /bkp/mysql_full.sql -A —— take all(full)db from /var/lib/mysql -p —— password -u —— user

 

# vim mysql_full.sql shows the complete file db entries in […]