Search Results

Search found 28 results on 2 pages for 'shantanuo'.

Page 1/2 | 1 2  | Next Page >

  • export command within shell script

    - by shantanuo
    When I use export command at command prompt, it works as expected. But it does not work from shell script. [root@server shantanu]# export myip=10 [root@server shantanu]# echo $myip 10 [root@server shantanu]# vi myip.sh #!/bin/sh export myipadd=10 [root@server shantanu]# sh -xv myip.sh #!/bin/sh export myipadd=10 + export myipadd=10 + myipadd=10 [root@server shantanu]# echo $myipadd I want to make the variable available to the same script next time when it runs. In other words I am looking for some way to memorize the variable value.

    Read the article

  • define software path

    - by shantanuo
    I have an older version already installed. I have upraded the package using setup.py install command. But the path is not correctly set. When I type "s3cmd" is shows the older version of software. # s3cmd s3cmd [options] <command> [arg(s)] version 1.2.6 --help -h --verbose -v --dryrun -n # which s3cmd /usr/local/bin/s3cmd The correct version is in different folder and I will like that to be used whenever I type the command. # /usr/bin/s3cmd Consider using --configure parameter to create one. How do I set path? I have added path to .bash_profile file but it does not work. PATH=$PATH:/usr/bin/s3cmd

    Read the article

  • avoid check of list of known hosts

    - by shantanuo
    I get the following prompt everytime I try to connect a server using SSH. I type "yes", but is there a way to aovid this? The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established. RSA key fingerprint is f3:cf:58:ae:71:0b:c8:04:6f:34:a3:b2:e4:1e:0c:8b. Are you sure you want to continue connecting (yes/no)?

    Read the article

  • How can I avoid SSH's host verification for known hosts?

    - by shantanuo
    I get the following prompt everytime I try to connect a server using SSH. I type "yes", but is there a way to aovid this? The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established. RSA key fingerprint is f3:cf:58:ae:71:0b:c8:04:6f:34:a3:b2:e4:1e:0c:8b. Are you sure you want to continue connecting (yes/no)?

    Read the article

  • quick check of open port

    - by shantanuo
    The following is working as expected. (do not want to use nmap) I need to use nc (or any other built-in centOS) command in shell script to check the port 6379 of a remote server. I want the script to exit quickly if no response received in less than 1 second. But it seems that nc will wait for too long before quitting with exit code of 1 How do I "quickly" check if the port is listening? # time nc -z 1.2.3.4 1234 real 0m21.001s user 0m0.000s sys 0m0.000s # echo $? 1 # time nc -z 1.2.3.4 6379 Connection to 1.2.3.4 6379 port [tcp/*] succeeded! real 0m0.272s user 0m0.000s sys 0m0.008s # echo $? 0

    Read the article

  • mail refused by port 25

    - by shantanuo
    When I try to send a mail from my Linux (CentOS) server, the exit status is 0, but the mail never reaches it's destination. The /var/log/maillog file has an entry something like this... Mar 18 06:33:01 app11 postfix/qmgr[22454]: F18FD9F6074: to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to alt4.gmail-smtp-in.l.google.com[74.125.45.27]: Connection refused) Am I blocked by google? I tried to send a mail to some other mail server and got the similar result. Mar 18 06:33:01 app1 postfix/smtp[15460]: connect to acsinet11.xxx.com[111.222.333.444]: Connection refused (port 25) How do I correct this problem?

    Read the article

  • Changing path to basedir of mysql

    - by shantanuo
    When-ever I need to start mysql from command line, I need to cd to the base directory and then use mysql command as shown below: # cd /home/ec2-user/percona-5.5.30-tokudb-7.0.1-fedora-x86_64/ # ./bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 mysql> How do I start mysql simply by typing "mysql" at command prompt? I tried to export the path but it did not work. export path=$PATH:/home/ec2-user/percona-5.5.30-tokudb-7.0.1-fedora-x86_64/bin/

    Read the article

  • Combine two or more compressed files

    - by shantanuo
    I have 2 gz files those I need to merge into one. time join <(zcat r_TR2_2012-05-28-08-10-00.gz) <(zcat r_TR1_2012-05-28-08-10-00.gz) The above statement is not working as expected. I am using 3 commands to do the needful. gunzip r_TR2_2012-05-28-08-10-00.gz gunzip r_TR1_2012-05-28-08-10-00.gz tar -zcvf combined.tar.gz r_TR1_2012-05-28-08-10-00 r_TR2_2012-05-28-08-10-00 Is there any way to do it in 1 statement?

    Read the article

  • extracting files from tar

    - by shantanuo
    tar -xvf company_raw_2012-03-16.tgz --directory=/root/test --strip-components=4 I am using the following tar option to remove the leading directories and it is working as expected. --strip-components NUMBER strip NUMBER of leading components from file names before extraction It works only when I know that there are going to be 4 sub-directories. I have tar files and I do not know if there will be 2, 3 or 4 folders inside. How do I strip the entire path and extract files in the given "directory" path.

    Read the article

  • Disable MySQL general logging without restarting?

    - by shantanuo
    Can I disable general logging completely without restarting the server? Because, per the documentation: SET sql_log_bin = {0|1} Disables or enables binary logging for the current connection (sql_log_bin is a session variable) if the client has the SUPER privilege. The statement is refused with an error if the client does not have that privilege. Can I enable/disable general log without restarting MySQL?

    Read the article

  • global scope of variable

    - by shantanuo
    The following shell scrip will check the disk space and change the variable "diskfull" to 1 if the usage is more than 10% The last echo always shows 0 I tried the global diskfull=1 in the if clause but it did not work. How do I change the variable to 1 if the disk consumed is more than 10% #!/bin/sh diskfull=0 ALERT=10 df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do #echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge $ALERT ]; then diskfull=1 exit fi done echo $diskfull

    Read the article

  • sort the "rollup" in group by

    - by shantanuo
    I found that the "with rollup" option used with group by is very useful. But it does not behave with "order by" clause. Is there any way to order by the way I want as well as calculate the sub-totals? CREATE TABLE `mygroup` ( `id` int(11) default NULL, `country` varchar(100) default NULL ) ENGINE=MyISAM ; INSERT INTO `mygroup` VALUES (1,'India'),(5,'India'),(8,'India'),(18,'China'),(28,'China'),(28,'China'); mysql>select country, sum(id) from mygroup group by country with rollup; +---------+---------+ | country | sum(id) | +---------+---------+ | China | 74 | | India | 14 | | NULL | 88 | +---------+---------+ 3 rows in set (0.00 sec) mysql>select country, sum(id) as cnt from mygroup group by country order by cnt ; +---------+------+ | country | cnt | +---------+------+ | India | 14 | | China | 74 | +---------+------+ 2 rows in set (0.00 sec) mysql>select country, sum(id) as cnt from mygroup group by country with rollup order by cnt; ERROR 1221 (HY000): Incorrect usage of CUBE/ROLLUP and ORDER BY Expected Result: +---------+------+ | country | cnt | +---------+------+ | India | 14 | | China | 74 | | NULL | 88 | +---------+---------+ 3 rows in set (0.00 sec)

    Read the article

  • Creation time of Innodb tables

    - by shantanuo
    CRETAE_TIME column of "TABLES" table from INFORMATION_SCHEMA shows the same CREATE_TIME for all my innodb tables. It means all these tables were created between 2010-03-26 06:52:00 and 2010-03-26 06:53:00 while actually they were created a few months ago. Does the CREATE_TABLE field change automatically for Innodb tables?

    Read the article

  • replace a text string

    - by shantanuo
    I want to replace the date found at the end of the "datadir" line with the current date. For e.g. my my.cnf file looks like this... # head /etc/my.cnf [mysqld] #mount -t tmpfs -o size=102m tmpfs /mnt #datadir=/mnt read-only datadir=/mysqlApr5 #datadir=/mysqlApr2 #datadir=/mysqlMar16 #datadir=/mysqlFeb25a Most of the lines are commented. I need to find the datadir line that is not commented and then replace the /mysqlApr4 with /mysqlApr20 datadir=/mysqlApr20 If it is possible I will like to comment the older datadir path. #datadir=/mysqlApr5 I can output the current date as: date '+%b%d' But I want to concat it with the word "/mysql" and replace or comment the current datadir line.

    Read the article

  • Compare 2 database

    - by shantanuo
    I have 2 identical databases. abc15 and abc18. But one of the database has one extra table and I need to find that. I thought the following query should return it, but is it not showing the record that I expect. select * from information_schema.tables as a left join information_schema.tables as b on a.TABLE_SCHEMA=b.TABLE_SCHEMA AND a.TABLE_NAME=b.TABLE_NAME where a.TABLE_SCHEMA = 'abc15' AND b.TABLE_SCHEMA='abc18' and b.TABLE_NAME IS NULL

    Read the article

  • deadlocks in the innodb status

    - by shantanuo
    Mysql sever has suddenly become very slow. There are no queries in the slow query log but the innodb status shows something like the following. Does it mean that it is due to innodb deadlock? if Yes, what is the way out? *************************** 1. row *************************** Status: ===================================== 100315 12:55:29 INNODB MONITOR OUTPUT ===================================== Per second averages calculated from the last 5 seconds ---------- SEMAPHORES ---------- OS WAIT ARRAY INFO: reservation count 187532, signal count 188120 Mutex spin waits 0, rounds 61908654, OS waits 33052 RW-shared spins 89241, OS waits 41948; RW-excl spins 5857, OS waits 1557 ------------------------ LATEST DETECTED DEADLOCK ------------------------ 100315 12:43:02 *** (1) TRANSACTION: TRANSACTION 0 56996536, ACTIVE 0 sec, process no 5000, OS thread id 3031395216 starting index read mysql tables in use 1, locked 1 LOCK WAIT 6 lock struct(s), heap size 1024, undo log entries 6 MySQL thread id 994, query id 7699751 localhost application Searching rows for update UPDATE QUERY *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 4073 n bits 296 index `PRIMARY` of table `dbII/tbl_ticket_block_master` trx id 0 56996536 lock_mode X locks r ec but not gap waiting Record lock, heap no 141 PHYSICAL RECORD: n_fields 23; compact format; info bits 0 0: len 7; hex 33353837393936; asc 3587996;; 1: len 4; hex 800001f4; asc ;; 2: len 1; hex 47; asc G;; 3: len 2; hex 6f6b; asc ok;; 4: le n 6; hex 0000035957fe; asc YW ;; 5: len 7; hex 000000401737c0; asc @ 7 ;; 6: SQL NULL; 7: SQL NULL; 8: SQL NULL; 9: len 3; hex 8fb46e; asc n;; 10: SQL NULL; 11: len 1; hex 30; asc 0;; 12: len 0; hex ; asc ;; 13: SQL NULL; 14: len 1; hex 33; asc 3;; 15: len 4; hex 4b9ceebe ; asc K ;; 16: len 1; hex 30; asc 0;; 17: len 4; hex 80006ae8; asc j ;; 18: len 0; hex ; asc ;; 19: len 0; hex ; asc ;; 20: len 0; hex ; asc ;; 21: len 0; hex ; asc ;; 22: len 0; hex ; asc ;; *** (2) TRANSACTION: TRANSACTION 0 56996527, ACTIVE 0 sec, process no 5000, OS thread id 2961476496 fetching rows, thread declared inside InnoDB 237 mysql tables in use 3, locked 3 121 lock struct(s), heap size 11584, undo log entries 16 MySQL thread id 995, query id 7699729 localhost application Searching rows for update UPDATE QUERY *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 0 page no 4073 n bits 296 index `PRIMARY` of table `DBII/tbl_ticket_block_master` trx id 0 56996527 lock_mode X Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum;; Record lock, heap no 2 PHYSICAL RECORD: n_fields 23; compact format; info bits 0 0: len 7; hex 33353837343631; asc 3587461;; 1: len 4; hex 800001f4; asc ;; 2: len 1; hex 47; asc G;; 3: len 6; hex 497373756564; asc Is sued;; 4: len 6; hex 000003425295; asc BR ;; 5: len 7; hex 8000000464012c; asc d ,;; 6: SQL NULL; 7: len 4; hex 80000058; asc X;; 8: len 1; hex 43; asc C;; 9: len 3; hex 8fb465; asc e;; 10: len 3; hex 8fb46d; asc m;; 11: len 1; hex 30; asc 0;; 12: len 0; hex ; asc ; ; 13: SQL NULL; 14: len 1; hex 33; asc 3;; 15: len 4; hex 4b9b33a2; asc K 3 ;; 16: len 3; hex 756d67; asc umg;; 17: len 4; hex 80006744; asc gD;; 18: len 0; hex ; asc ;; 19: len 0; hex ; asc ;; 20: len 0; hex ; asc ;; 21: len 0; hex ; asc ;; 22: len 0; hex ; asc ;;

    Read the article

  • replace the line to add some text

    - by shantanuo
    The MySQL dump backup file has the following line... # head -40 backup20-Apr-2010-07-32.sql | grep 'CHANGE MASTER TO ' -- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000068', MASTER_LOG_POS=176357756; a) I need to complete the statement with the parameters like Master host, user and password. b) I do also need to remove the comment "--" The line should look something like this... CHANGE MASTER TO MASTER_HOST='111.222.333.444', MASTER_USER='slave_user', MASTER_PASSWORD='slave_user', MASTER_LOG_FILE='mysql-bin.000068', MASTER_LOG_POS=176357756;

    Read the article

  • declaring constraint to consider prog logic

    - by shantanuo
    I can open a trip only once but can close it multiple times. I can not declare the Trip_no + status as primary key since there can be multiple entries while closing the trip. Is there any way that will assure me that a trip number is opened only once? For e.g. there should not be the second row with "Open" status for trip No. 3 since it is already there in the following table. Trip No | Status 1 Open 1 Close 1 Close 2 Open 2 Close 3 Open 3 Close 3 Close 3 Close 3 Close

    Read the article

  • innodb lock wait timeout

    - by shantanuo
    As per the documentation link given below: When a lock wait timeout occurs, the current statement is not executed. The current transaction is not rolled back. (Until MySQL 5.0.13 InnoDB rolled back the entire transaction if a lock wait timeout happened. You can restore this behavior by starting the server with the --innodb_rollback_on_timeout option, available as of MySQL 5.0.32. http://dev.mysql.com/doc/refman/5.0/en/innodb-parameters.html#sysvar_innodb_lock_wait_timeout Does it mean that when a lock wait timeout occurs, it compromises the transactional integrity? "roollback on timeout" was the default behaviour till 5.0.13 and I guess that was the correct way to handle such situations. Does anyone think that this should be the default behaviour and the user should not be asked to add a parameter for a functionality that is taken for granted?

    Read the article

  • finding last snapshot using boto

    - by shantanuo
    I have read the explanation about "describe_cluster_snapshots" from ... http://docs.pythonboto.org/en/latest/ref/redshift.html#boto.redshift.layer1.RedshiftConnection.create_cluster It has an option start_time and end_time but there is no way to sort it. How do I get the id of the latest snapshot using boto? Here is what I have tried but it does not seem to return the last snapshot. mysnap=conn.describe_cluster_snapshots() mysnapidentifier=mysnap['DescribeClusterSnapshotsResponse']['DescribeClusterSnapshotsResult']['Snapshots'][-1]['SnapshotIdentifier']

    Read the article

  • Mysql for update

    - by shantanuo
    MySQL supports "for update" keyword. Here is how I tested that it is working as expected. I opened 2 browser tabs and executed the following commands in one window. mysql> start transaction; Query OK, 0 rows affected (0.00 sec) mysql> select * from myxml where id = 2 for update; .... mysql> update myxml set id = 3 where id = 2 limit 1; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> commit; Query OK, 0 rows affected (0.08 sec) In another window, I started the transaction and tried to take an update lock on the same record. mysql> start transaction; Query OK, 0 rows affected (0.00 sec) mysql> select * from myxml where id = 2 for update; Empty set (43.81 sec) As you can see from the above example, I could not select the record for 43 seconds as the transaction was being processed by another application in the Window No 1. Once the transaction was over, I got to select the record, but since the id 2 was changed to id 3 by the transaction that was executed first, no record was returned. My question is what are the disadvantages of using "for update" syntax? If I do not commit the transaction that is running in window 1 will the record be locked for-ever?

    Read the article

  • self join to select consecutive numbers

    - by shantanuo
    CREATE TABLE `mybug` ( `SEAT_NO` decimal(2,0) NOT NULL, `ROW_NO` decimal(2,0) NOT NULL, `COL_NO` decimal(2,0) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `mybug` VALUES ('1','1','1'),('26','7','2'),('31','8','2'),('32','8','1'),('33','9','1'),('34','9','2'),('35','9','5'),('36','9','6'),('37','10','6'),('38','10','5'),('39','10','2'),('40','10','1'),('41','11','1'),('42','11','2'),('43','11','4'),('44','11','5'); +---------+--------+--------+ | SEAT_NO | ROW_NO | COL_NO | +---------+--------+--------+ | 1 | 1 | 1 | | 26 | 7 | 2 | | 31 | 8 | 2 | | 32 | 8 | 1 | | 33 | 9 | 1 | | 34 | 9 | 2 | | 35 | 9 | 5 | | 36 | 9 | 6 | | 37 | 10 | 6 | | 38 | 10 | 5 | | 39 | 10 | 2 | | 40 | 10 | 1 | | 41 | 11 | 1 | | 42 | 11 | 2 | | 43 | 11 | 4 | | 44 | 11 | 5 | +---------+--------+--------+ 16 rows in set (0.00 sec) In the above chart, I need to select 2 seats those are in the same row AND column numbers are next to each other. For e.g. Seat Numbers 38 & 39 can not be issued even if both the seats are from the same row because the column numbers 2 & 5 are not adjacent. The expected results are as follows: 31 33 35 37 39 41 43 These are the starting numbers and the next seat will be automatically booked as well. for e.g. 31 & 32

    Read the article

1 2  | Next Page >