Monday, February 23, 2015

update kibana replicas to 0

This kibana 4
Update public/index.js file
line 46098

root@cm-log-manager:/opt/kibana/src# vim ./public/index.js

```
define('components/setup/steps/create_kibana_index',['require','components/setup/_setup_error'],function (require) {
  return function CreateKibanaIndexFn(Private, es, configFile, Notifier) {
    return function createKibanaIndex() {
      var notify = new Notifier({ location: 'Setup: Kibana Index Creation' });
      var complete = notify.lifecycle('kibana index creation');
      var SetupError = Private(require('components/setup/_setup_error'));

      return es.indices.create({
        index: configFile.kibana_index,
        body: {
          settings: {
            number_of_shards : 1,
            number_of_replicas: 0
          }
        }
      })
      .catch(function (err) {
        throw new SetupError('Unable to create Kibana index "<%= configFile.kibana_index %>"', err);
      })
      .then(function () {
        return es.cluster.health({
          waitForStatus: 'yellow',
          index: configFile.kibana_index
        })
        .catch(function (err) {
          throw new SetupError('Waiting for Kibana index "<%= configFile.kibana_index %>" to come online failed', err);
        });
      })
      .then(complete, complete.failure);
    };
  };
});
```

Monday, January 26, 2015

install bd on ubuntu 64

1, download
http://download.bitdefender.com/SMB/Workstation_Security_and_Management/BitDefender_Antivirus_Scanner_for_Unices/Unix/Current/EN_FR_BR_RO/Linux/

wget http://enterprise.bitdefender.com/site/Downloads/dwf/625/

2, install
mv index.html BitDefender-Antivirus-Scanner-7.6-4.linux-gcc4x.amd64.deb.run

chmod +x BitDefender-Antivirus-Scanner-7.6-4.linux-gcc4x.amd64.deb.run
./BitDefender-Antivirus-Scanner-7.6-4.linux-gcc4x.amd64.deb.run

3, update sig
 bdscan --update

Install F-Prot in ubuntu 64

dpkg --add-architecture i386
apt-get update
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386



1 dowload
http://files.f-prot.com/files/unix-trial/fp-Linux.x86.32-ws.tar.gz

2, unzip and mv it to /opt

3, cd /opt/f-prot/

  ./install-f-prot.pl

install AVG to ubuntu 64 bits

There are two ways to do it:
A:
1, Download AVG
  wget http://download.avgfree.com/filedir/inst/avg2013flx-r3118-a6926.i386.deb

2, Install 32 lib
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo dpkg -i avg2013flx-r3118-a6926.i386.deb


B:
1, Download AVG
  wget http://download.avgfree.com/filedir/inst/avg2013flx-r3118-a6926.i386.deb
 
2,  Install 32 lib
apt-get install libc6:i386
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
rm /etc/apt/sources.list.d/ia32-libs-raring.list
apt-get update
apt-get install gcc-multilib

3, Install AVG
dpkg -i avg2013flx-r3118-a6926.i386.deb
/opt/avg/av/bin/avgsetup
avgupdate

Tuesday, January 6, 2015

EW:~/code/nutty/chef$ export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
EW:~/code/nutty/chef$
EW:~/code/nutty/chef$
EW:~/code/nutty/chef$
EW:~/code/nutty/chef$ /usr/bin/sqlplus64

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 6 15:48:14 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter user-name: ^C
chang@ACPNEW:~/code/nutty/chef$ /usr/bin/sqlplus64 meta94@//dev-db.cwxbj.us-west-2.rds.amcom:1521/META

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 6 15:48:44 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production

Sunday, November 9, 2014

linux history with date

1, export HISTTIMEFORMAT='%F %T '

2, history

[ec2-user@ip-10-0-3-22 ~]$ history | grep log | grep rm
  398  2014-11-10 01:16:01  rm python_etl_today_error.log
  426  2014-11-10 01:16:01  rm sqlldr_log_folder
  765  2014-11-10 01:16:01  rm python_etl_dev.log
 1004  2014-11-10 01:25:28  history | grep log | grep rm
 1006  2014-11-10 01:33:03  history | grep log | grep rm

Sunday, September 21, 2014

bash


Bash Round
chang@ACPNEW:~/tmp$ echo "scale = 5; 5+50*3/20 + (19*2)/7" | bc -l | xargs printf "%2.3f\n"
17.929

Avg
chang@ACPNEW:~/tmp$ awk '{s+=$1}END{print "ave:",s/NR}' RS=" "  avg.txt
ave: 54.646

for loop

for i in {1..50}
do
  echo $i
done


chang@ACPNEW:~/tmp$ cat b.txt | tr -s " "


tab seperated
cut -d$'\t' -f2-

chang@ACPNEW:~/tmp$ cut -d$'\t' -f2- b.txt