PIXNET Logo登入

wsunccake的隨手記事

跳到主文

歡迎光臨wsunccake在痞客邦的小天地

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 10月 16 週四 201409:40
  • Install Ruby 2.1.3 from srource code in Linux

compile ruby source code:
Linux:~ # wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.3.tar.bz2
Linux:~ # tar jxf ruby-2.1.3.tar.bz2
Linux:~ # cd ruby-2.1.3/
Linux:~/ruby-2.1.3 # ./configure --prefix=/usr/local/ruby
Linux:~/ruby-2.1.3 # make
Linux:~/ruby-2.1.3 # make install
注意, 安裝前先確認已有zlib-devel, opens-devel, readline. 沒有也可以安裝, 只是之後 gem 沒辦法使用
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(6)

  • 個人分類:Linux
▲top
  • 9月 26 週五 201415:15
  • BASH 漏洞

BASH 有 Shell shock (可參考, Bash Shell 漏洞威脅不小於 Heartbleed!Unix-Like 作業系統請儘速更新)
# 測試方法
Linux:~ $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
# 有漏洞時顯示結果
vulnerable
this is a test
# 以修補後顯示結果
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(5)

  • 個人分類:Linux
▲top
  • 8月 17 週日 201414:15
  • RobotFramework (1) - 在Ubuntu 12.04.1 LTS安裝RobotFramework


RobotFramework(有時候簡稱robot, RF), 是一款Python編寫的automation framework(自動化測試軟體框). 具備良好的可擴展性, 支持keyword-driven(關鍵字驅動), 可同時測試多種類型的客戶端或者介面, 進行分布式測試執行. 主要用於重複性的回歸測試以及Acceptance Test-Driven Development(驗收測試驅動開發, ATDD), 同時還支持Behavior-Driven Development(行為驅動開發, BDD).
RF除了可以在Python上執行, 也可用Jypthon(JVM)或IronPython(.Net)執行, 在此主要介紹還是使用Python的方式.
RIDE則是RF常用的IDE一種, RIDE主要使用wxPython開發出來, 所以需安裝wxPython.
OS: Ubuntu 12.04.1 LTS (x86_64)
# install easy_install and pip module
Ubuntu:~ $ sudo apt-get install python-setuptools
Ubuntu:~ $ sudo apt-get install python pip
# install robotframework
Ubuntu:~ $ sudo pip install robotframework
# run robotframework
Ubuntu:~ $ sudo apt-get install git
Ubuntu:~ $ git clone https://bitbucket.org/robotframework/robotdemo.git
Ubuntu:~ $ cd robotdemo
Ubuntu:~/robotdemo $ pybot keyword_driven.txt 
# install ride
Ubuntu:~ $ sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev
Ubuntu:~ $ pip install robotframework-ride
# run ride
Ubuntu:~ $ ride.py
ref:
ROBOTFRAMEWORK
Robot Framework User Guide Version 2.8.5
RobotFrameWork(一)robotframework(python版)及Ride在ubuntu下安装
robotframework
robotframework-ride
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(186)

  • 個人分類:Linux
▲top
  • 8月 17 週日 201403:38
  • MacOSX 安裝 Cisco Packet Tracer

因為 Mac 的 Mac OS X 升級到 10.9 之後, 原本給 Cisco Packet Tracer for MAC 就沒辦法使用.
在網路上查到, 原來是 Mac OS X 在 10.7 之後, 就差很多. 目前看的方式, 使用 Wineskin(Mac下的Windows模擬器)配合Cisco Packet Tracer(這是for windows)就可以使用了
ref:
how to Packet Tracer 6.0.1 in Mac
Wineskin 載點
Cisco Packet Tracer for Windows 載點
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(6,894)

  • 個人分類:MacOS
▲top
  • 2月 11 週二 201408:58
  • PTSIM 安裝

PTSIM (Particle Therapy System simulation framework) 是利用Geant4的粒子束治療模擬程式/框架
在安裝之前, 需要g++ compiler, Geant4 和 Root. 若要使用平行計算, 還需另外安裝MPI 及 G4MPI
Geant4:
Linux:~ # wget http://geant4.web.cern.ch/geant4/support/source/geant4.9.6.p02.tar.gz
Linux:~ # tar zxf geant4.9.6.p02.tar.gz
Linux:~ # mkdir geant4-build
Linux:~ # cd geant4-build
Linux:geant4-build # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4 ../geant4.9.6.p02
Linux:geant4-build # make
Linux:geant4-build # make install
到http://geant4.cern.ch/support/source下載所有Data file, 並解壓縮到/usr/local/share/Geant4-9.6.2/data目錄下
G4MPI:
G4MPI已經收入在Geant4裡, 只要先安裝好Geant4就可以繼續安裝G4MPI
Linux:~ # mkdir g4mpi-build
Linux:~ # cd g4mpi-build
Linux:g4mpi-build # cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpic++ -DGeant4_DIR=/usr/local/geant4/lib64/Geant4-9.6.2 -DCMAKE_INSTALL_PREFIX=/usr/local/geant4 ../geant4.9.6.p02/examples/extended/parallel/MPI/source
Linux:g4mpi-build # make
Linux:g4mpi-build # make install
Root:
Linux:~ # wget ftp://root.cern.ch/root/root_v5.34.14.source.tar.gz
Linux:~ # tar zxf root_v5.34.14.source.tar.gz
Linux:~ # cd root
Linux:root # ./configure linuxx8664gcc --prefix=/usr/local/root --etcdir=/usr/local/root/etc
Linux:root # make
Linux:root # make install
PTSim:
到http://wiki.kek.jp/pages/viewpage.action?pageId=5343876下載
Linux:~ # tar zxf PTSproject-20131125.tar.gz
Linux:~ # cd PTSproject
Linux:PTSproject # ./buildToolkitIAEA.sh -DGeant4_DIR=../geant4/lib64/Geant4-9.6.2
Linux:PTSproject # ./buildDynamicIAEA.sh -DGeant4_DIR=../geant4/lib64/Geant4-9.6.2
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(684)

  • 個人分類:Linux
▲top
  • 1月 10 週五 201410:28
  • 簡易Python unittest範例

import unittest # 載入unittest
class Person: # 要測試的class
    def __init__(self, name):
        self.name = name
        self.age = 10
    def getName(self):
        return self.name
    def setAge(self, age):
        self.age = age
class TestPerson(unittest.TestCase):
    def setUp(self): # 每個測試初始化
        print 'init',
        self.p = Person('John')
    def test_getName(self): #要測試的功能, 名稱需test開頭
        print 'test getNme',
        self.assertEqual(self.p.getName(), 'John' )
    def test_setAge(self):
        print 'test setAge',
        self.assertEqual(self.p.age, 10 )
        self.p.setAge(18)
        self.assertNotEqual(self.p.age, 10 )
    def tearDown(self): # 每個測試結束
        print 'final'
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(1,151)

  • 個人分類:Python
▲top
  • 1月 10 週五 201410:04
  • 在SLC上安裝Root

Root是CERN在HEP(High Energy Physics)使用的c++ 數值函式庫, 主要是處理大量資用. 可到 http://root.cern.ch/drupal/content/downloading-root 下載
System Info:
OS: Scientific Linux CERN SLC release 6.4
Compiler: g++ 4.4.7
SLC:~ $ wget ftp://root.cern.ch/root/root_v5.34.14.source.tar.gz
SLC:~ $ tar zxf root_v5.34.14.source.tar.gz
SLC:~ $ cd root
SLC:~ $ ./configure --prefix=~/rootp --etcdir=~/rootp/etc --disable-x11 # --prefix: 程式安裝路徑, --etcdir: 設定檔安裝路徑(預設為/etc/root, 因為不是root安裝, 所以要改), --disable-x11 不編譯x11相關套件
SLC:~ $ make && make install
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(85)

  • 個人分類:Linux
▲top
  • 1月 07 週一 201320:18
  • Polyrate2010-A RP(Reaction Path)編譯

Compiler: Intel Fortran & Intel C
MPI: OpenMPI
Package: polyrate2010-A.tar.gz
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(19)

  • 個人分類:Linux
▲top
  • 12月 26 週三 201211:32
  • CentOS 6.3安裝GromacsGUI/GroGUI

GromacsGUI(又稱GroGUI), 是Gromacs的圖形界面程式, 方便使用者做Gromacs設定. 使用C++/QT函式開發, 所以在編譯時要安裝g++和qt函式庫, 若需要有分析功能, 還需另外裝qwt函式庫. 在SLES 12安裝不需修改設定檔, 但在RedHat系列要做些小改變. 
下載網址 http://resal.wordpress.com/gromacs-gui
CentOS:~ # tar zxf 47665-grogui052.tar.gz
CentOS:~ # cd grogui052/gui_withplotting #系統需有安裝qwt
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(57)

  • 個人分類:Linux
▲top
  • 12月 18 週日 201120:32
  • Rails3 form_tag的使用範例

step 1. 使用rails script建立project
os:~ $ rails new demo #建立新project,名稱為demo
os:~ $ cd demo
os:~/demo $ rails g controller Say hello #建立controller和view
(繼續閱讀...)
文章標籤

wsunccake 發表在 痞客邦 留言(0) 人氣(73)

  • 個人分類:Ruby
▲top
«1...345»

個人資訊

wsunccake
暱稱:
wsunccake
分類:
不設分類
好友:
累積中
地區:

熱門文章

  • (2,094)PyCharm (1) - 開啟檔案
  • (1,027)第一個wxPython程式
  • (900)RHEL 7.1 安裝 rpcapd
  • (17)MongoDB 的基本操作
  • (6)Install Ruby 2.1.3 from srource code in Linux

文章分類

  • Linux (21)
  • Python (5)
  • MacOS (4)
  • Ruby (2)
  • 未分類文章 (1)

最新文章

  • kernel panic - failed to execute / init
  • CentOS 上安裝 screenfetch
  • CentOS 上安裝 cowsay
  • MongoDB 增加 document
  • MongoDB 備份
  • MongoDB 的基本操作
  • 使用 docker 安裝 MongoDB
  • CentOS 7 安裝 MongoDB
  • Gradle 建立 Java, Groovy application
  • CentOS 以 Selenium RC 方式執行 RobotFramework

最新留言

    動態訂閱

    文章精選

    文章搜尋

    誰來我家

    參觀人氣

    • 本日人氣:
    • 累積人氣: