Monday, January 26, 2015

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




Tuesday, August 19, 2014

wordpress menu get erased

My wordpress menu get erased randomly. And I cannot replicate this issue.

I duplicated my whole site to a testing site, and dump the DB.
One day, I found my menu is gone, and I check the database,

mysql> select post_title, post_name, post_type from wp_posts where post_type='nav_menu_item' ;

It return 0 menu.

I disabled the plugin  Stealth Publish and fixed the issue.

It took me 3 weeks find the solution.