顯示具有 linux 標籤的文章。 顯示所有文章
顯示具有 linux 標籤的文章。 顯示所有文章

2014年9月23日 星期二

Linux 圖片轉檔指令

convert beach.gif beach.pnm


NAME
convert - convert an image or sequence of images

SYNOPSIS
convert [ options ... ] input_file output_file

DESCRIPTION
Convert converts an input file using one image format to an output file with a differing image format. In addition, various types of image processing can be performed on the converted image during the conversion process. Convert recognizes the image formats listed in ImageMagick.

2014年9月18日 星期四

Install Flask on CentOS 7.0

1. Install pip on CentOS 7.0

## First install the EPEL repo as per your Operating system version and architecture.
rpm -ivh http://mirror01.idc.hinet.net/EPEL/7/x86_64/e/epel-release-7-1.noarch.rpm
yum install -y python-pip

2. Install Flask

pip install Flask

## Test
vi hello.py

from flask import Flaskapp = Flask(__name__)
@app.route("/")def hello():    return "Hello World!"
if __name__ == "__main__":    app.run()

## Verify
python hello.py

* Running on http://0.0.0.0:80/

2014年1月17日 星期五

GnuPlot references

地圖/統計圖/3d 函數圖/實驗報告圖 -- Gnuplot 純畫圖 (作者: 洪朝貴老師)
http://user.frdm.info/ckhung/b/ma/gnuplot.php

Gnuplot 入門教學
http://randle.wordpress.com/2007/06/12/gnuplot-induction/

2013年12月20日 星期五

Upgrade to CentOS 6.5 from CentOS 6.4

yum clean all
yum update glibc* yum* rpm* python*
yum update

reboot

cat /etc/redhat-release
## Output ##
CentOS release 6.5 (Final)

lsb_release -a
## Output ##
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:        6.5
Codename:       Final


references:
http://www.if-not-true-then-false.com/2011/upgrade-centos-6/

2013年7月30日 星期二

GDB: Missing separate debuginfos

Fixed GDB: Missing separate debuginfos

1. 修改 /etc/yum.repos.d/CentOS-Debuginfo.repo, set enabled=1
2. yum install yum-utils
3. debuginfo-install glibc

如果還是不行更新 gdb and glibc

2012年5月28日 星期一

安裝 wxPython


[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1


yum install wxPython.x86_64 wxPython-devel.x86_64

Dependencies Resolved

==================================================================================================================================================
 Package                                Arch                           Version                                  Repository                   Size
==================================================================================================================================================
Installing:
 wxPython                               x86_64                         2.8.9.1-1.el5.rf                         dag                          22 M
 wxPython-devel                         x86_64                         2.8.9.1-1.el5.rf                         dag                         479 k
Installing for dependencies:
 wxGTK                                  x86_64                         2.8.10-1.el5.rf                          dag                          27 M
 wxGTK-devel                            x86_64                         2.8.10-1.el5.rf                          dag                         1.1 M


2012年3月29日 星期四

Identify the speed of memory



dmidecode  is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format.


dmidecode

# dmidecode 2.11
SMBIOS 2.5 present.
30 structures occupying 1372 bytes.
Table at 0x0009D800.

2012年3月5日 星期一

vm.swappiness



vm.swappiness is a tunable kernel parameter that controls how much the kernel favors swap over RAM. At the source code level, it’s also defined as the tendency to steal mapped memory. A high swappiness value means that the kernel will be more apt to unmap mapped pages. A low swappiness value means the opposite, the kernel will be less apt to unmap mapped pages. In other words, the higher the vm.swappiness value, the more the system will swap.

The default value I’ve seen on both enterprise level Red Hat and SLES servers is 60.

step of modify:
sysctl -w vm.swappiness=0 (default: 60)
swapoff -a
swapon -a

ADD  vm.swappiness=0  to  /etc/sysctl.conf

References:
What Is the Linux Kernel Parameter vm.swappiness?
http://overinfinityresearch.blogspot.com/2008/09/ubuntu804.html

2011年12月1日 星期四

Usage of nvidia-smi

## show GPU short messages
nvidia-smi -L

## Display GPU detail info
nvidia-smi -q

## Disable GPU ECC memory
nvidia-smi --ecc-config=0
Reboot required.

## Set MODE for compute applications
##  0/DEFAULT
##  1/EXCLUSIVE_THREAD
##  2/PROHIBITED
##  3/EXCLUSIVE_PROCESS
nvidia-smi --compute-mode=3

2011年7月29日 星期五

CentOS 6 Releases

July 10th 2011

The CentOS team is pleased to announce the immediate availability of CentOS-6.0 for i386 and x86_64 Architectures.

CentOS-6.0 is based on the upstream release EL 6.0 and includes
packages from all variants. All upstream repositories have been combined into one, to make it easier for end users to work with.

http://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.0

How to get the CPU core number

Use sched_getcpu to determine the CPU on which the calling thread is running. See man getcpu (the system call) and man sched_getcpu (a library wrapper).

example:

#include <stdio.h>
#include <utmpx.h>
int main()
{
int c, s;
int cpu;
cpu = sched_getcpu();
printf("id=%d\n", cpu);
return 0;
}

Ps. linux version > 2.6.19

references:
How can I get the CPU core number from within a user-space app (Linux, C)?
INTEL DOC

2011年5月18日 星期三

HPCC notes

修改CCFLAGS,如果用mpich,是$(HPL_DEFS) -fomit-frame-pointer -03-funroll-loops -W –Wall,

用openmpi就要修改成 $(HPL_DEFS) -03


HPL 產生器
http://www.advancedclustering.com/faq/how-do-i-tune-my-hpldat-file.html


HPCC inf 說明
http://onetfbao.spaces.live.com/blog/cns!393E9866CAB6E396!367.entry 
http://www.orientsky.com.cn/_new/Printpage.asp?ID=1496
http://onemansjourneyintolinux.blogspot.com/2009/01/hpl-tuning.html

如何做Linpack测试及性能优化
曹振南
http://www.netlib.org/benchmark/hpl/faqs.html

2011年4月21日 星期四

Upgrade CentOS 5.5 to 5.6


yum clean all
yum update glibc\*
yum update yum\* rpm\* pyth\*
yum clean all
yum update mkinitrd nash
yum update selinux\*
yum update
shutdown -r now

Reference:
[] http://wiki.centos.org/zh-tw/Manuals/ReleaseNotes/CentOS5.6

2011年1月31日 星期一

Upgrade CentOS 5.4 to 5.5

方法一:

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update
reboot

方法二:

Clean All Packages
# yum clean all

The following command will get a list of packages that are going to be updated.
# yum list updates

Lets begin upgrading CentOS 5.4 to 5.5
# yum update

Finally reboot the server for Kernel changes to take effect
# reboot

檢查版本
lsb_release  -a




[references]
http://www.how2centos.com/upgrading-centos-5-4-to-5-5/
http://www.unixmen.com/news-today/999-centos-55-is-out-upgrade-now-from-centos-54-to-55

2010年11月12日 星期五

RHEL6 announce

Red Hat Sets a New Standard for the Next Generation of Operating Systems (2010.11.10)

With support from industry-leading partners, Red Hat Enterprise Linux 6 enters the market; offers Enterprise IT a firm foundation for a virtualized and cloud-focused future.

期待 CentOS 6 趕快釋出

http://www.redhat.com/about/news/prarchive/2010/new-standard.html

2010年10月13日 星期三

CentOS VNC server configure

#修改 /etc/sysconfig/vncserver
#修改 ~/.vnc/xstartup

tighvnc 連線時 IP:terminal:port number

terminal 設為1 表示原root terminal使用, 不設定為由2 開始

附註, Centos6 之後是預設vino 需登入後才能remote loging.

XRDP 設定
http://hpclab.cs.pu.edu.tw/wiki/index.php/Xrdp
http://pulipuli.blogspot.tw/2008/08/windowslinuxxrdpvnc-server.html

references:
http://lerax.sytes.net/LERAX/index.php?pl=593&sid=9695925f
http://blog.weithenn.org/2009/04/centosvnc-vnc-server.html

last update: 2012/07/11

2010年10月6日 星期三

Clean linux ARP cache

一、這樣可以清除單一IP的ARP緩存
arp -d IP

二、清除192.168.0.0網段的所有暫存

for((ip=2;ip<255;ip++));do \ arp -d 192.168.0.$ip &>/dev/null; \
done

三、清除所有ARP

arp -n|awk '/^[1-9]/ {print "arp -d "$1}' | sh


Reference:
http://www.linuxzh.org/Linux/arp-clean.html

2010年9月21日 星期二

Version Control: Subversion

## require packages
yum install mod_dav_svn subversion

svnadmin create --fs-type fsfs /usr/local/svn/test
chown -R apache:apache /usr/local/svn/test
svn import Testproj http://localhost/svn/test
svn co http://localhost/svn/test

svn add xxx
svn commit xxx

# Apache subversion configure

   DAV svn
   SVNParentPath /usr/local/svn

   # Limit write permission to list of valid users.
   #
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Subversion Repository"
      AuthUserFile /usr/local/svn/passwd
      Require valid-user
   #



#create password file
htpasswd -c /usr/local/svn/passwd test