enjoylife's Stuff

Home » enjoylife (4 trails)
enjoylife's Stats (public trails only):
Trails created: 80
Marks created: 1248
Views received: 101,339
Positive ratings: 1
Negative ratings:
Comments received: 3
Comments left: 0
super master (enjoylife)

enjoylife's Trails: command    (view all)

first, make a script, like /root/check_temp.sh:

#!/bin/sh
TEMP_A=`/usr/sbin/smartctl -d ata -A /dev/sda | grep Temperature | cut -d ' ' -f37`
TEMP_B=`/usr/sbin/smartctl -d ata -A /dev/sdb | grep Temperature | cut -d ' ' -f37`
THRESHOLD=65

#In case Temp B doesn't return a reading (You only have one drive)
if [ "$TEMP_B" = "" ] ; then
 TEMP_B=0
fi

#Check to make sure it's not running too hot
if [ $TEMP_A -gt $THRESHOLD ] || [ $TEMP_B -gt $THRESHOLD ] ; then
 logger -s "One of the drives has exceeded the threshold of $THRESHOLD degrees C."
 poweroff
fi

make it executable: chmod 755 check_temp.sh

edit root's crontab (/etc/crontabs/root) to include this script. This one will run the script every fifteen minutes:

# standard crontab format for busybox cron daemon.
# fields may be lists
# min    hour day month wd  command
#  *      *    *   *     *   dosomething

# save the time every 60 minutes use 7 minute past the hour.
7   *    *   *     *   date +%m%d%H%M%Y.%S > /var/lib/now
0,15,30,45 * * * * /root/check_temp.sh

Then, either reboot the box, or restart cron: /etc/init.d/crond.sh stop, etc/init.d/crond.sh start

Tags: smartctl, root, cron, grep, temp, ...
A trail of 2 pages

This page describes how to setup your development environment to compile/deploy AppFuse or StrutsResume from the command line. After setting this up, you might want to checkout HowTo Run Ant in Eclipse. This is how I currently have things setup and what I advise clients to use when we use AppFuse as a baseline for webapp development.

Table of Contents

  • [1] Download - links to download the JDK, J2EE, Tomcat, Ant and MySQL
  • [2] Install - detailed instructions on where to extract/install all of the above packages
  • [3] Configure - how to configure your environment variables
  • [4] Additional Tips - other tools I recommend using

Download [#1]

Tags: strutsresume, ant, install, baseline, jdk, ...
A trail of 46 pages
The C-shell offers a number of special commands known as control codes. Control codes define commands specific to the operating system. To issue a control code, hold down and press the corresponding letter key. The following summarizes some of the most commonly used control codes:
 d Signals the end of a file you are entering from the terminal if typed at the beginning of a line or if typed twice elsewhere in a line.
 c Cancels a command or interrupts a running program.
 z Suspends a process or job but does not terminate it: use fg to restart suspended process or job.
common_alias myscreen '~/bin/screen'
common_alias ls   'ls --color=auto'


common_alias findfile    'find . -follow -type f | grep $*'
common_alias findtext 'find . -not -name "*.d" -not -name "*.o" -not -name "*.a" -follow -type f -print0 | xargs --null grep $*'
#common_alias findcode    "find -follow -type f -name '*.cpp' -o -name '*.h' -o -name '*.java' -o -name '*.const' -print0| xargs --null grep $*"
common_alias findcode 'find . -name "*.cpp" -name "*.h" -name "*.java" -name "*.c" -name "*.hpp" -follow -type f -print0 | xargs --null grep $*'
common_alias findcdb 'find . -name "*.layout" -name "*.def" -name "*.cdb" -follow -type f -print0 | xargs --null grep $*'
common_alias findweb 'find . -name "*.aml" -name "*.xml" -name "*.xsd" -name "*.mdl" -name "*.sml" -follow -type f -print0 | xargs --null grep $*'
common_alias findany 'find . -follow -type f -print0 | xargs --null grep $*'

 

export PS1="\h@\u:\w% "
export DISPLAY=l-sjn-jezhao:0.0
export LS_COLORS='di=01;33'

function cleanup(){
        echo "Removing $1 files..."
        find \. -follow -name "$1" | xargs rm
u Clears the command line.




Tags: grep, alias, xargs, name, findcode, ...
A trail of 44 pages
    How to List my tables in Oracle database

http://www.dba-oracle.com/bk_sqlplus_list_tables_views.htm

SELECT * FROM all_tables; <- all tables you have access to
SELECT * FROM user_tables; <- all tables owned by currently logged in user
SELECT * FROM dba_tables; <- all tables in database


I am glad to know that we have Database forum here.

Just installed Oracle database server under Ubuntu Linux, It did took some time but finally beast is installed.

Now how do I list tables? Mysql has
Code:
SHOW DATABASES;
USE mydb;
SHOW TABLES;
SELECT * FROM mytable;
So far I am able to login into the Oracle using command-line tool called SQL*Plus:
Code:
$ sqlplus scott/tiger
Now how do I list tables?

I am just taking print out of Oracle sql pdf but please give me command so that I know it is working.
Reply With Quote
  #2 (permalink)  
Old 12-19-2006, 02:03 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 848
nixcraft is an unknown quantity at this point
Default

To list all your tables in Oracle server, use the following command:
Code:
SELECT * FROM cat;
First connect to server using Oracle sql plus client:
Code:
sqlplus scott/tiger
Now type at sql> prompt:
Code:
SELECT * FROM cat;
Also don't forget to set the column widths
Code:
COL table_name FORMAT a30;
COL table_type FORMAT a30;
Now to get list of tables in oracle:
Code:
SELECT * FROM cat;
Tags: tables, code, sql, oracle, select, ...
A trail of 3 pages