2014年4月12日 星期六

OpenSSL heartbeat extension 漏洞 (CVE-2014-0160)

影響範圍:
    OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable
    OpenSSL 1.0.1g is NOT vulnerable
    OpenSSL 1.0.0 branch is NOT vulnerable
    OpenSSL 0.9.8 branch is NOT vulnerable

有可能受影響的系統:
  • Debian Wheezy (stable), OpenSSL 1.0.1e-2+deb7u4
  • Ubuntu 12.04.4 LTS, OpenSSL 1.0.1-4ubuntu5.11
  • CentOS 6.5, OpenSSL 1.0.1e-15
  • Fedora 18, OpenSSL 1.0.1e-4
  • OpenBSD 5.3 (OpenSSL 1.0.1c 10 May 2012) and 5.4 (OpenSSL 1.0.1c 10 May 2012)
  • FreeBSD 10.0 - OpenSSL 1.0.1e 11 Feb 2013
  • NetBSD 5.0.2 (OpenSSL 1.0.1e)
  • OpenSUSE 12.2 (OpenSSL 1.0.1c)
未受影響的系統:
  • Debian Squeeze (oldstable), OpenSSL 0.9.8o-4squeeze14
  • SUSE Linux Enterprise Server
  • FreeBSD 8.4 - OpenSSL 0.9.8y 5 Feb 2013
  • FreeBSD 9.2 - OpenSSL 0.9.8y 5 Feb 2013
  • FreeBSD 10.0p1 - OpenSSL 1.0.1g (At 8 Apr 18:27:46 2014 UTC)
  • FreeBSD Ports - OpenSSL 1.0.1g (At 7 Apr 21:46:40 2014 UTC)

線上測試:
http://filippo.io/Heartbleed/

測試 script:
https://github.com/a0726h77/heartbleed-test




References :
Heartbleed Bug

2014年4月7日 星期一

libpython2.7.so.1.0 => not found

# ln -s /usr/local/lib/libpython2.7.so.1.0 /usr/lib64/




References :
Python executable not finding libpython shared library - Stack Overflow

CentOS compile moswsgi with Python 2.7

# yum install mercurial httpd-devel
$ hg clone https://code.google.com/p/modwsgi/
$ cd modwsgi/mod_wsgi
$ ./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/local/bin/python2.7
$ make
# make install
# vi /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so




References :
Running our Django site with mod_wsgi and virtualenv (part 2) | techno milk

JQuery $.ajax access variables outside the function

Probably because Validate.fail(test) occurs immediately after the asynchronous call. Remember it is ASYNCHRONOUS, meaning it executes parallel to javascript running on your page.

use async: false in $.ajax request




References :
javascript - Use variable outside the success function from an ajax/jquery call - Stack Overflow

2014年4月6日 星期日

Debian install Kivy

# vi /etc/apt/sources.list
deb http://ppa.launchpad.net/kivy-team/kivy-daily/ubuntu oneiric main
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A863D2D6
# apt-get install python-kivy python-kivy-examples




References :
Installation on Linux — Kivy 1.8.1-dev documentation

Bash 快捷鍵 shortcuts

Alt + U 遊標後一個單字都改成英文大寫
Alt + l 遊標後一個單字都改成英文小寫
Alt + C 遊標後一個單字改成英文開頭大寫
Alt + . 插入最後一個 history 中的文字

2014年4月2日 星期三

CentOS 6 install Python 2.7

# Python 2.7.6:
$ wget https://www.python.org/ftp/python/2.7/Python-2.7.tgz
$ tar zxf Python-2.7.tgz
$ cd Python-2.7.6
$ ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
# make && make altinstall
 
# First get the setup script for Setuptools:
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
 
# Then install it for Python 2.7
# python2.7 ez_setup.py
 
# Now install pip using the newly installed setuptools:
# easy_install-2.7 pip
 
 
 
 
References :