Bài đăng

Install java runtime on ubuntu

On Ubuntu 8.04 (Hardy Heron), do one of the following: * On the Gnome desktop (Ubuntu): o In the main desktop menu, choose "Add/Remove ..." o In the "Show" toggle box, select "All Open Source Applications" o Search for "OpenJDK" o Select the "OpenJDK Java Runtime" (openjdk-6-jre) o Confirm the installation of community maintained software o Press the "Apply Changes" button * On the KDE desktop (Kubuntu): o In the main desktop menu, choose "Add/Remove Programs" o In the "Adept Installer" search for "OpenJDK" o Select the "OpenJDK Java Runtime" (openjdk-6-jre) o Press the "Apply Changes" button * On the command line, type: $ sudo apt-get install openjdk-6-jre The openjdk-6-jre package contains just the Java Runtime Environment. If you want to develop Java prog...

Check If a URL is Valid or Not

function is_valid_url ( $url ) $url = @parse_url($url); if ( ! $url) { return false; } $url = array_map('trim', $url); $url['port'] = (!isset($url['port'])) ? 80 : (int)$url['port']; $path = (isset($url['path'])) ? $url['path'] : ''; if ($path == ''){ $path = '/'; } $path .= ( isset ( $url['query'] ) ) ? "?$url[query]" : ''; if ( isset ( $url['host'] ) AND $url['host'] != gethostbyname ( $url['host'] ) ){ if ( PHP_VERSION >= 5 ){ $headers = get_headers("$url[scheme]://$url[host]:$url[port]$path"); }else{ $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30); if ( ! $fp ){ return false; } fputs($fp, "HEAD $path HTTP/1.1\r\nHost: $url[host]\r\n\r\n"); $headers = fread ( $fp, 128 ); fclose ( $fp ); } $headers = ( is_array ( $headers ) ) ? implode ( ...

loading other message for other div in xajax

require_once("xajax_core/xajax.inc.php"); $xajax = new xajax(); // SEE file list below! $xajax-&gtsetFlag("debug", false); function callScript($oRequest) { $response = new xajaxResponse(); $value = "this is a string duoc tra ve"; for($i=0;$i&lt1000;$i++){ for($j=0;$j&lt10000;$j++){} } $response-&gtassign($oRequest, "innerHTML", nl2br(print_r($value."0 - ".$i." - ".$j." - ".$oRequest, true))); return $response; } $xajax-&gtregisterFunction("callScript"); $xajax-&gtprocessRequest(); ?> "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> &lthtml xmlns="http://www.w3.org/1999/xhtml"> &lthead> &lttitle&gtxajax Tests $xajax_files = array(); $xajax_files[] = array("xajax_js/xajax_core.js", "xajax"); // $xajax_files[] = array("xajax_js/xajax_debug.js", ...

different loading messages in xajax framework

Using xajax 0.5 rc1, you can now use the following (callback objects) to accomplish this: loadingPage = xajax.callback.create(300, 10000); loadingSomeSelectOptions = xajax.callback.create(300, 10000); loadingOtherSelectOptions = xajax.callback.create(100, 10000); Then, provide the operations to perform: loadingPage.onResponseDelay = function() { ... show loading message ... } loadingPage.onComplete = function() { ... hide loading message ... } loadingSomeSelectOptions.onRequest = function() { ... show loading message over select box ... } loadingSomeSelectOptions.onComplete = function() { ... hide loading message ... } loadingOtherSelectOptions.onResponseDelay = function() { ... show loading msg over other select box ... } loadingOtherSelectOptions.onComplete = function() { ... hide loading message ... } Then: xajax.call('loadPage', { callback: loadingPage }); xajax.call('loadSomeSelectOptions', { callback: loadingSomeSelectOptions }); etc... As an alternative, you coul...

stop & start GUI on UBUNTU

*GNOME desktop If you are using GNOME: sudo /etc/init.d/gdm stop Again to start GNOME desktop: sudo /etc/init.d/gdm start *KDE desktop sudo /etc/init.d/kdm stop sudo /etc/init.d/kdm start you can use the init command to go immediately into runlevel 1 , which is also known as single user text mode . Open terminal and type the following command: sudo init 1 Again get back to GUI Mode with init 2 command: sudo init 2 note: runlevel 1 was single user, 3 was multi-user and 5 was GUI. sudo telinit 3 more help here->http://theos.in/news/ubuntu-linux-shutdown-the-x-server/

Downloading and Installing webmin on ubuntu

http://www.webmin.com/download.html newest version: http://prdownloads.sourceforge.net/webadmin/webmin_1.430_all.deb login as root: sudo -i wget "gói cần lấy dzìa" dpkg -i "gói mới lấy dzìa" xong rồi thì vào địa chỉ: https://ip:10000 or https://ip:20000

MTU trong Ubuntu

(MTU) Maximum Transmission Unit là kích thước lớn nhất được đo bằng byte mà cho phép truyền dẫn qua mạng. Bất kỳ một lượng thông tin nào truyền qua mạng mà lớn hơn kích thước của MTU thì sẽ chia nhỏ ra trước khi truyền dẫn qua mạng. Đặc biệt khi bạn dùng internet bằng cách quay số, bạn có thể chỉnh lại thông số MTU để có thể truy cấp internet được nhanh hơn. Kích thước mặc định MTU của các mạng: Mạng MTU (bytes) 16 Mbits/Sec Token Ring 17914 4 Mbits/Sec Token Ring 4464 FDDI 4352 Ethernet 1500 IEEE 802.3/802.2 1492 X.25 576 Trên đây là bảng những thông số mẵc định của MTU, bạn có thể điều chỉnh MTU phù hợp theo ý mình. Để điều chỉnh MTU tạm thời trong phiên làm việc hiện tại thì bạn có thể dùng lệnh ifconfig. # ifconfig eth0 mtu 1492 hoặc $ sudo ifconfig eth0 mtu 1492 Ở đây mình thay đổi MTU cho card mạng eth0 từ 1500 bytes xuống 1492 bytes. Nếu bạn muốn thay đổi hoàn toàn MTU mặc định cho card mạng của mình thì có thể chỉnh sửa trong file cấu hình theo 2 cách. Cách 1: Trong Debi...