Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, March 15, 2013

關於MBR與GPT分區管理


http://www.ha97.com/5365.html
目前我們可以接觸到的大部分x86架構的pc和服務器,還在採用上世紀遺傳下來的BIOS+MBR組合。 BIOS,基本輸入輸出系統 (Basic Input-Output System),是軟件與硬件之間的一個接口,可以把它看作一個翻譯在中文與英語之間,雖然兩者完全不同,不過可以讓大家瞭解 BIOS 所處的位置,BIOS 通常被寫入一塊 ROM 芯片連接在主板上,當然也有直接寫入北橋的,不過相當少見。 BIOS 幾乎是完全用彙編語言編寫,很大程度上決定了主板的性能及穩定性。
MBR,主引導記錄 (Master Boot Record),也就是我們常見的分區方法,不過管理員外的最終用戶很少知道它的存在,MBR 分區的標準決定了MBR只支持在2TB以下 (超過2TB的只能管理 2TB) 的硬盤中創建4個分區表項,要獲得更多分區,需要次級結構–擴展分區。擴展分區可以再次被分成一個或多個邏輯磁盤,也就是普通情況下的C盤以外的盤,或說第一個分區以外的部分,有些情況下 Windows 裡的C盤可能會是一個邏輯分區。
EFI,可擴展固件接口 (Extensible Firmware Interface),由英特爾 (Intel) 公司提出的一種替代 BIOS 的升級方案。 EFI 的位置很特殊,它不像是 BIOS 那樣自己即是固件又是接口,EFI 只是一個接口,位於操作系統與平台固件之間。
GPT,全局唯一標識磁盤分區表 (GUID Partition Table),GUID,全局唯一標識符 (Globally Unique Identifier) 。GUID 分區表 (GPT) 是作為 Extensible Firmware Interface (EFI) 計劃的一部分引入的。當然,你也可以在 BIOS 的PC中使用 GPT 分區,雖然 GPT 來自以 EFI 計劃,但並不依賴於 EFI。GPT 相對於以往 PC 普遍使用的主引導記錄 (MBR) 分區方案更加靈活。比如可以超過 MBR 分區表項4個的限制,在 GPT 規範裡對分區的數量幾乎是沒有限制的,大家在網上可以查到的128個實際上是 Windows 系統 (支持 GPT 的 Windows) 做出的限制,Linux下沒這個限制。 GPT 對可管理磁盤大小也超過了 MBR 的2TB (1TB = 1024GB) 而達到了 18EB (1EB = 1024TB) 。在 MBR 分區方案中操作系統的引導是通過放在磁盤最開始 (第一扇區) 裡的 MBR (這裡的 MBR 是指主引導記錄,而不是主引導記錄分區方案,兩者是同名的。我的猜測是為了與 GPT 分區方案區分,使用了主引導記錄引導方式的名字 MBR 來命名此種分區方案,我查不到確切的資料正明我的猜測是否正確,只能大家努力區分一下了。) 。把重要的信息 (如分區信息、目錄等) 放在某個扇區裡是 MBR 分區方案的方法,而 GPT 把這個信息放到了分區裡,Intel的解釋是這樣可以更加明確更加安全。 GPT 分區為了保護自己不受 MBR 方案下磁盤管理軟件的危害,在磁盤的最開始位置 (第一個扇區) 建立了一個保護分區 (Protective MBR),這種分區的類型標識為 0xEE。蘋果系統Mac OS X下這個保護分區大小為 200MB,這個分區在 Window磁盤管理器裡名字叫做 GPT 保護分區。這個分區可以讓不能識別 GPT 的磁盤管理軟件把 GPT 磁盤看成一個未知格式的分區,而不是錯誤地當成一個未分區的磁盤。
常用的 MS-DOS 分區表格式不能在一個大於 2TB 的設備上使用。要支持大於2TB的設備,GPT 分區表格式必須被使用,並且必須使用parted工具程序來創建和管理 GPT 分區。

Saturday, August 18, 2012

Thursday, August 16, 2012

Connecting Linux and Windows Together With a Network Cable

http://www.ehow.com/how_7208875_connect-ubuntu-windows-crossover-cable.html


Windows:

1 Connect the crossover cable to the network port of both the Ubuntu and the Windows computers.

2 Go to the "Start" menu and type "netcpl.cpl" in the "Run" or "search programs and files" field and press "Enter."

3 Right-click on "Local Network connection" and select "Properties."

4 Select "TCP/IP V4" and click "Properties."

5 Select "Use the following IP address" and enter 192.168.1.1 in the "IP address" field.

6 Click on the "Subnet mask" field to fill it automatically. Click "OK."

Linux:

7 Press "CTRL + ALT + F1" to open a terminal.

8 Type "sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up" and press "Enter."

9 Type your password and press "Enter."

10 Press "CTRL + ALT + F7" to go back to the graphical interface.

Tuesday, June 12, 2012

Fixing "ECDSA unknown key type" error in OpenSSH

http://blog.slogra.com/post-169.html


If error message "ssh-keygen: generating new host keys: ECDSA unknown key type" appeared after starting sshd, then running the below commands should fix it.


touch /etc/ssh/ssh_host_ecdsa_key
touch /etc/ssh/ssh_host_ecdsa_key.pub

Wednesday, May 30, 2012

Useful Unix Command Line Script

Find Dead Symbolic Links in The Whole System
find / -type l ! -exec test -r {} \; -print

Find And Replace Text Recursively
find . -type f -print0 | xargs -0 -n32 -P6 sed -i 's/AAA/BBB/g'

Search Text Recursively
find . -type f -print0 | xargs -0 -n32 -P6 grep -iH "ttt"

List The Size of Current Directory
du -sk *

Tuesday, March 27, 2012

Thursday, March 22, 2012

Enabling Java in Chrome for CentOS 6.2

http://www.wikihow.com/Enable-Oracle-Java-in-Your-Web-Browsers-on-Ubuntu-Linux
sudo mkdir /opt/google/chrome/plugins
sudo ln -s /usr/java/jre1.7.0_03/lib/amd64/libnpjp2.so /opt/google/chrome/plugins/libnpjp2.so

[FAILED] Building ODIN Under CentOS 6.2


Linux 2.6.32-220.7.1.el6.centos.plus.x86_64 #1 SMP Wed Mar 7 11:06:23 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux


Download the source code (1.8.4) from http://od1n.sourceforge.net/download.html
Extract the files.
CFLAG=-O2 -pipe -march=core2 (default for odin is -O3 -fno-tree-vectorize (O3 enabled it and this disabled it) )
./configure --enable-oilsupport --enable-pngsupport
Install gsl-devel 1.13-1
Install blitz-devel 1.9-13
BUG FIX: sudo ln -s /usr/lib64/blitz/include/blitz/gnu /usr/include/blitz/gnu
Install lapack-devel 3.2.1-4 (+ blas + gcc-gfortran)
Install qt-devel 3.3.8b-30 ( +many dependencies, especially i686 packages)
BUG FIX: sudo ln -s /usr/include/Qt /usr/lib64/qt4/include
BUG FIX: sudo ln -s /usr/lib64/pkgconfig/Qt.pc /usr/lib64/pkgconfig/qt.pc
Install qwt-devel 5.1.1-4 ( + libxi-devel, + qt-devel)
Install liboil-devel 0.3.16-4 (+dcbook-utils, +gtk-doc)
Install libpng-devel 1.2.46-2

QwtPlotPicker function can be found here /usr/include/qwt/qwt_plot_picker.h

ERROR during make:

/bin/sh ../libtool --tag=CXX   --mode=link g++  -DQT_THREAD_SUPPORT  -O3 -fno-tree-vectorize -O2 -pipe -march=core2  -L/usr/lib64/qt-3.3/lib   -o odin odincomp.o odinconf.o odindebugger.o odindialog_progress.o odindialog_process.o odindialog_system.o odindialog_system_moc.o odindialog_debug.o odindialog_debug_moc.o odindialog_idea.o odindialog_idea_moc.o odindialog_pulsar.o odindialog_pulsar_moc.o odindialog_tree.o odindialog_kspace.o odindialog_kspace_moc.o odindialog_new.o odindialog_new_moc.o odinmethod.o odinplot_range.o odinplot_range_moc.o odinplot_vtk.o odinplot.o odinplot_moc.o odinview.o odinview_moc.o odin.o odin_moc.o main.o ../odinseq/libodinseq.la ../odinqt/libodinqt.la ../odinpara/libodinpara.la ../tjutils/libtjutils.la
libtool: link: g++ -DQT_THREAD_SUPPORT -O3 -fno-tree-vectorize -O2 -pipe -march=core2 -o .libs/odin odincomp.o odinconf.o odindebugger.o odindialog_progress.o odindialog_process.o odindialog_system.o odindialog_system_moc.o odindialog_debug.o odindialog_debug_moc.o odindialog_idea.o odindialog_idea_moc.o odindialog_pulsar.o odindialog_pulsar_moc.o odindialog_tree.o odindialog_kspace.o odindialog_kspace_moc.o odindialog_new.o odindialog_new_moc.o odinmethod.o odinplot_range.o odinplot_range_moc.o odinplot_vtk.o odinplot.o odinplot_moc.o odinview.o odinview_moc.o odin.o odin_moc.o main.o  -L/usr/lib64/qt-3.3/lib ../odinseq/.libs/libodinseq.so ../odinqt/.libs/libodinqt.so ../odinpara/.libs/libodinpara.so ../tjutils/.libs/libtjutils.so -Wl,-rpath -Wl,/usr/local/lib
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::qt_property(int, int, QVariant*)'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::staticMetaObject()'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::qt_invoke(int, QUObject*)'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtAbstractScaleDraw::draw(QPainter*, QColorGroup const&) const'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::qt_cast(char const*)'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPicker::accept(QPointArray&) const'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::trackerText(QwtDoublePoint const&) const'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::className() const'
../odinqt/.libs/libodinqt.so: undefined reference to `QwtPlotPicker::qt_emit(int, QUObject*)'
collect2: ld returned 1 exit status

Friday, March 02, 2012

Change the Default Java in CentOS 6


http://chrisschuld.com/2008/10/installing-sun-java-on-centos-5-2/

Step (1) : Visit Oracle's web site to find the laest version of JRE http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step (2) : Download the rpm file for JRE 1.7u3 x64
http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jre-7u3-linux-x64.rpm

Step (3) : Setup the alternatives correctly
[user@www]# alternatives --install /usr/bin/java java /usr/java/jre1.7.0_03/bin/java 2
[user@www]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /opt/jdk1.6.0_07/bin/java

Enter to keep the current selection[+], or type selection number: 2

Step (4) : Check to make sure the install was a success
[user@www]# java -version

Friday, November 25, 2011

File Related to BASH

From http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html and man bash

/bin/bash
The bash executable
/etc/profile
The systemwide initialization file, executed for login shells
~/.bash_profile (read .profile for compatibility with sh, if .bash_profile does not exist)
The personal initialization file, executed for login shells (terminal is a login shell in Mac)
~/.bashrc
The individual per-interactive-shell startup file
~/.bash_logout
The individual login shell cleanup file, executed when a login shell exits
~/.inputrc
Individual readline initialization file

Monday, November 21, 2011

什麼是CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI?


http://www.linuxidc.com/Linux/2011-07/38108.htm
[日期:2011-07-05] 來源:Linux社區  作者:Linux
什麼是CGI
CGI全稱是「公共網關接口」(Common Gateway Interface),HTTP服務器與你的或其它機器上的程序進行「交談」的一種工具,其程序須運行在網絡服務器上。

CGI可以用任何一種語言編寫,只要這種語言具有標準輸入、輸出和環境變量。如php,perl,tcl等
什麼是FastCGI

FastCGI像是一個常駐(long-live)型的CGI,它可以一直執行著,只要激活後,不會每次都要花費時間去fork一次(這是CGI最為人詬病的fork-and-execute 模式)。它還支持分佈式的運算, 即 FastCGI 程序可以在網站服務器以外的主機上執行並且接受來自其它網站服務器來的請求。

FastCGI是語言無關的、可伸縮架構的CGI開放擴展,其主要行為是將CGI解釋器進程保持在內存中並因此獲得較高的性能。眾所周知,CGI解釋器的反覆加載是CGI性能低下的主要原因,如果CGI解釋器保持在內存中並接受FastCGI進程管理器調度,則可以提供良好的性能、伸縮性、Fail- Over特性等等。

FastCGI與CGI特點

1、如CGI,FastCGI也具有語言無關性.

2、如CGI, FastCGI在進程中的應用程序,獨立於核心web服務器運行,提供了一個比API更安全的環境。(APIs把應用程序的代碼與核心的web服務器鏈接在一起,這意味著在一個錯誤的API的應用程序可能會損壞其他應用程序或核心服務器; 惡意的API的應用程序代碼甚至可以竊取另一個應用程序或核心服務器的密鑰。)

3、FastCGI技術目前支持語言有:C/C++、Java、Perl、Tcl、Python、SmallTalk、Ruby等。相關模塊在Apache, ISS, Lighttpd等流行的服務器上也是可用的。

4、如CGI,FastCGI的不依賴於任何Web服務器的內部架構,因此即使服務器技術的變化, FastCGI依然穩定不變。

FastCGI的工作原理

1、Web Server啟動時載入FastCGI進程管理器(IIS ISAPI或Apache Module)

2、FastCGI進程管理器自身初始化,啟動多個CGI解釋器進程(可見多個php-cgi)並等待來自Web Server的連接。

3、當客戶端請求到達Web Server時,FastCGI進程管理器選擇並連接到一個CGI解釋器。Web server將CGI環境變量和標準輸入發送到FastCGI子進程php-cgi。

4、FastCGI子進程完成處理後將標準輸出和錯誤信息從同一連接返回Web Server。當FastCGI子進程關閉連接時,請求便告處理完成。FastCGI子進程接著等待並處理來自FastCGI進程管理器(運行在Web Server中)的下一個連接。 在CGI模式中,php-cgi在此便退出了。

在上述情況中,你可以想像CGI通常有多慢。每一個Web請求PHP都必須重新解析php.ini、重新載入全部擴展並重初始化全部數據結構。使用FastCGI,所有這些都只在進程啟動時發生一次。一個額外的好處是,持續數據庫連接(Persistent database connection)可以工作。

FastCGI的不足

因為是多進程,所以比CGI多線程消耗更多的服務器內存,PHP-CGI解釋器每進程消耗7至25兆內存,將這個數字乘以50或100就是很大的內存數。

Nginx 0.8.46+PHP 5.2.14(FastCGI)服務器在3萬並發連接下,開啟的10個Nginx進程消耗150M內存(15M*10=150M),開啟的64個php-cgi進程消耗1280M內存(20M*64=1280M),加上系統自身消耗的內存,總共消耗不到2GB內存。如果服務器內存較小,完全可以只開啟25個php-cgi進程,這樣php-cgi消耗的總內存數才500M。

什麼是PHP-CGI

PHP-CGI是PHP自帶的FastCGI管理器。

啟動PHP-CGI,使用如下命令:

1
php-cgi -b 127.0.0.1:9000
PHP-CGI的不足

1、php-cgi變更php.ini配置後需重啟php-cgi才能讓新的php-ini生效,不可以平滑重啟

2、直接殺死php-cgi進程,php就不能運行了。(PHP-FPM和Spawn-FCGI就沒有這個問題,守護進程會平滑從新生成新的子進程。)

什麼是PHP-FPM

PHP-FPM是一個PHP FastCGI管理器,是只用於PHP的,可以在 http://php-fpm.org/download下載得到.

PHP-FPM其實是PHP源代碼的一個補丁,旨在將FastCGI進程管理整合進PHP包中。必須將它patch到你的PHP源代碼中,在編譯安裝PHP後才可以使用。

現在我們可以在最新的PHP 5.3.2的源碼樹裡下載得到直接整合了PHP-FPM的分支,據說下個版本會融合進PHP的主分支去。相對Spawn-FCGI,PHP-FPM在CPU和內存方面的控制都更勝一籌,而且前者很容易崩潰,必須用crontab進行監控,而PHP-FPM則沒有這種煩惱。

PHP5.3.3已經集成php-fpm了,不再是第三方的包了。PHP-FPM提供了更好的PHP進程管理方式,可以有效控制內存和進程、可以平滑重載PHP配置,比spawn-fcgi具有更多有點,所以被PHP官方收錄了。在./configure的時候帶 –enable-fpm參數即可開啟PHP-FPM。

使用PHP-FPM來控制PHP-CGI的FastCGI進程

1
2
3
4
5
6
7
8
/usr/local/php/sbin/php-fpm{start|stop|quit|restart|reload|logrotate}

--start 啟動php的fastcgi進程
--stop 強制終止php的fastcgi進程
--quit 平滑終止php的fastcgi進程
--restart 重啟php的fastcgi進程
--reload 重新平滑加載php的php.ini
--logrotate 重新啟用log文件
什麼是Spawn-FCGI

Spawn-FCGI是一個通用的FastCGI管理服務器,它是lighttpd中的一部份,很多人都用Lighttpd的Spawn-FCGI進行FastCGI模式下的管理工作,不過有不少缺點。而PHP-FPM的出現多少緩解了一些問題,但PHP-FPM有個缺點就是要重新編譯,這對於一些已經運行的環境可能有不小的風險(refer),在php 5.3.3中可以直接使用PHP-FPM了。

Spawn-FCGI目前已經獨成為一個項目,更加穩定一些,也給很多Web 站點的配置帶來便利。已經有不少站點將它與nginx搭配來解決動態網頁。

最新的lighttpd也沒有包含這一塊了(http://www.lighttpd.net/search?q=Spawn-FCGI),但可以在以前版本中找到它。在lighttpd-1.4.15版本中就包含了(http://www.lighttpd.net/download/lighttpd-1.4.15.tar.gz)

目前Spawn-FCGI的下載地址是http://redmine.lighttpd.net/projects/spawn-fcgi,最新版本是http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz

註:最新的Spawn-FCGI可以到lighttpd.net網站搜索「Spawn-FCGI」找到它的最新版本發佈地址

下面我們就可以使用Spawn-FCGI來控制php-CGI的FastCGI進程了


1
    /usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php-CGI
參數含義如下:

-f 指定調用FastCGI的進程的執行程序位置,根據系統上所裝的PHP的情況具體設置
-a 綁定到地址addr
-p 綁定到端口port
-s 綁定到unix socket的路徑path
-C 指定產生的FastCGI的進程數,默認為5(僅用於PHP)
-P 指定產生的進程的PID文件路徑
-u和-g FastCGI使用什麼身份(-u 用戶 -g 用戶組)運行,Ubuntu下可以使用www-data,其他的根據情況配置,如nobody、apache等

PHP-FPM與spawn-CGI對比測試

PHP-FPM的使用非常方便,配置都是在PHP-FPM.ini的文件內,而啟動、重啟都可以從php/sbin/PHP-FPM中進行。更方便的是修改php.ini後可以直接使用PHP-FPM reload進行加載,無需殺掉進程就可以完成php.ini的修改加載
結果顯示使用PHP-FPM可以使php有不小的性能提升。PHP-FPM控制的進程cpu回收的速度比較慢,內存分配的很均勻。

Spawn-FCGI控制的進程CPU下降的很快,而內存分配的比較不均勻。有很多進程似乎未分配到,而另外一些卻佔用很高。可能是由於進程任務分配的不均勻導致的.而這也導致了總體響應速度的下降。而PHP-FPM合理的分配,導致總體響應的提到以及任務的平均。

PHP-FPM與Spawn-FCGI功能比較

http://php-fpm.org/about/

PHP-FPM、Spawn-FCGI都是守護php-cgi的進程管理器。

Friday, September 16, 2011

Find the Hardware Spec For Linux


http://www.secguru.com/article/finding_hardware_details_your_linux_machine_without_using_screw_driver

1: Finding Hardware Details with lspci
lspci -v

2: Finding Hardware Details with dmesg
dmesg | grep -i memory

3: Finding Hardware Details from /proc
cat /proc/cpuinfo

4: Getting More Information about your HDD using fdisk
fdisk -l

Tuesday, September 06, 2011

vsFTPd and mount directories


http://radu.cotescu.com/vsftpd-and-symbolic-links/

1. create a directory inside user‘s chroot:
mkdir /tmp/harddisk/ftp_pvt/user/music

2. mount the folder you want user to access using the bind option:
mount --bind /tmp/harddisk/music /tmp/harddisk/ftp_pvt/user/music

Saturday, April 09, 2011

Warning: untrusted X11 forwarding setup failed: xauth key data not generated


http://www.mail-archive.com/cygwin-xfree@cygwin.com/msg17927.html

Which means that ssh is going to use *trusted* X11 forwarding anyway,
because *untrusted* X11 forwarding depends on the Security (aka
XC-Security) extension, which has been disabled by default upstream.

Here's why:

Trusted X11 forwarding means that you trust the server that you wish to
ssh into is not using any keyloggers, screenshot utilities, packet
sniffers, or anything else to hijack your connection, in which case X11
will allow it to do whatever a local client would be able to do.

Untrusted X11 forwarding was meant to be a way to allow logins to
unknown or insecure systems. It generates a cookie with xauth and uses
the Security extension to limit what the remote client is allowed to do.
But this is widely considered to be not useful, because the Security
extension uses an arbitrary and limited access control policy, which
results in a lot of applications not working correctly and what is
really a false sense of security. This is true even today; I rebuilt
XWin with Security enabled and 'ssh -X' into my linux VM, and got
BadAccess errors from *any* GTK2 program. More on this subject:

http://www.openssh.com/faq.html#3.13
http://www.nsa.gov/selinuX/papers/x11/x93.html

Given the limited usefulness of untrusted X11 forwarding, *upstream* has
disabled it by default in favour of other security models, but it has
not yet been removed. So there are two options:

A) Leave things as they are now, with that warning advising people that
untrusted X11 forwarding is not available and that trusted mode is being
used instead. The warning can be silenced by using ssh -Y, since that
is what ssh -X is doing now anyway.

B) Re-enable the Security extension together with the openssh update,
and be swamped by questions that programs aren't running under ssh -X,
and have to tell everyone that ssh -X is generally broken anyway and
they should be using ssh -Y instead.

Unless someone can show me a case where something works correctly with
option (B) where it doesn't in (A), then I may reconsider, but otherwise
everyone now understands that the Security extension is not really
useful, not to be relied upon, and therefore is not available.

Sunday, April 03, 2011

Removing unwanted applications from "Open with Other Applications..." in Linux GNOME

Some of them are stored in /home//.local/share/applications
Most of the duplicate items were created by wine and is a known bug.

Wednesday, October 06, 2010

Tweak Linux TCP/IP

http://kaivanov.blogspot.com/2010/09/linux-tcp-tuning.html
Edit /etc/sysctl.conf

#It still loads the module but unhooks almost all of the calls into the module. net.ipv6.conf.all.disable_ipv6=1

# Allow reuse/recycling of TIME-WAIT sockets for new connections:
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
# Enable TCP timestamps: (Timestamp add 12 bytes to the TCP headers. But, good for Gigabit network)
net.ipv4.tcp_timestamps = 1
# Enable TCP Selective/Forward Acknowledgements:
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
# Enable support for large TCP windows:
net.ipv4.tcp_window_scaling = 1
# Lower FIN timeout (default: 60):
net.ipv4.tcp_fin_timeout = 15
# Wait time between isAlive interval probes (default: 75, recommended: 15-30):
net.ipv4.tcp_keepalive_intvl = 15
# Number of probes before timing out (default: 9, recommended: 5):
net.ipv4.tcp_keepalive_probes = 5
# Maximum TCP Send Window:
net.core.wmem_max = 33554432
# Maximum TCP Receive Window:
net.core.rmem_max = 33554432
# Memory reserved for TCP rcv buffers (default: 4Kb 85Kb 4Mb):
net.ipv4.tcp_rmem = 4096 87380 33554432
# Memory reserved for TCP snd buffers (default: 4Kb 16Kb 4Mb):
net.ipv4.tcp_wmem = 4096 65536 33554432
# Explicit Congestion Notification
net.ipv4.tcp_ecn=1

# Not to cache ssthresh from previous connection
net.ipv4.tcp_no_metrics_save = 1
# To increase this for 10G NICS
net.core.netdev_max_backlog = 30000
# Use TCP VEGAS. Do modprobe tcp_vegas first!
net.ipv4.tcp_congestion_control = vegas

Wednesday, June 30, 2010

Folder Sharing via SMB Using Nautilus

Install nautilus-share

Edit /etc/samba/smb.conf
add "usershare owner only = False" under [global]

This also remove the error msg below
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: usershares are currently disabled

Thursday, April 15, 2010

Friday, April 02, 2010

Replacing metacity with xfwm in gnome under Arch Linux

Install xfwm
packer -S xfwm4

Create /usr/share/applications/xfwm4.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Xfwm4
Exec=xfwm4
NoDisplay=true
X-GNOME-WMName=Xfwm4

Change in gconf-editor
/desktop/gnome/session/required_components/windowmanager = xfwm4