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

2011年8月2日 星期二

We love varnish

[PDF] Varnish 

[PDF] Varnish http accelerator

[PDF] Using Varnish VCL for webmasters


Inline C-code
Can be added between, and in functions.
Requires C-clue.
Can do almost anything.

C{
    printf(”Hello World\n”);
}C

All information from phk@freebsd.org

2011年7月18日 星期一

Varnish and Multiple Backend


Multiple Backends

backend default {
  .host = "127.0.0.1";
  .port = "8080";
}
 
backend stylesheets {
  .host = "10.0.0.10";
  .port = "80";
}
 
sub vcl_recv {
  if (req.url ~ "^/stylesheets") {
    # set stylesheets backend
    set req.backend = stylesheets;
    return(lookup);
  }
 
  # set default backend
  set req.backend = default;
  return(pass);
}



Round Robin And Random Multiple Server Backend

2010年12月9日 星期四

CUDA Certification – Exam Scheduling Now Open

CUDA Certification – Exam Scheduling Now Open



NVIDIA CUDA Professional Developer Program Study Guide
As part of the process of achieving the standards expected from an NVIDIA CUDA Professional Developer, all candidates are required to take a series of self-study lectures and exercises.
Please read this entire document before starting your study course.
The foundation of this training is provided by the text book,  Programming Massively Parallel Processors: A Hands-on Approach, authors, David B. Kirk, Wen-mei W. Hwu.
You can also make use of podcasts in mp4 format of the lectures below; the reading assignments will help to make the lecture more productive, so please complete in advance.
  1. Introduction to GPU Computing (60.2 MB)
    1. Assignment please read Chapter 1 of Textbook
  2. CUDA Programming Model (75.3 MB)
    1. Assignment please read Chapter 2 of Textbook
  3. CUDA API (32.4 MB) 
  4. Simple Matrix Multiplication in CUDA (46.0 MB)
    1. Assignment please read Chapter 3 of Textbook 
  5. CUDA Memory Model (109 MB)
    1. Assignment please read Chapter 4 of Textbook 
  6. Shared Memory Matrix Multiplication (81.4 MB) 
  7. Additional CUDA API Features (22.4 MB) 
  8. Useful Information on CUDA Tools (15.7 MB) 
  9. Threading Hardware (140 MB) 
    1. Assignment please read Chapter 5 of Textbook 
  10. Memory Hardware (85.8 MB)
  11. Memory Bank Conflicts (115 MB) 
  12. Parallel Thread Execution (32.6 MB) 
  13. Control Flow (96.6 MB) 
  14. Precision (137 MB)
    1. Assignment please read Chapter 6 of Textbook
    2. Assignment please read Chapter 7 of Textbook
Please download all the documents and files that are relevant to your operating system.
As part of the study process, please ensure you also download and study the following documents:
CUDA C Programming Guide 3.0
CUDA C Best Practices Guide 3.0
CUDA C Online Documentation
Additional CUDA Programming Tools and Compiler Documentation can be found at this link:
http://www.nvidia.com/object/cuda_programming_tools.html
Please download the following additional documents:
CUDA Compiler Driver NVCC 2.0
PTX: Parallel Thread Execution ISA Version 1.2
CUDA Occupancy Calculator
Additional Course Exercises with Solutions (Supports CUDA Basics)
Exercise Instructions
Exercise files for Visual Studio
Exercise files for Mac & Linux
Additional Supporting Materials
NVIDIA is hosting a series of Webinars about the CUDA Architecture.  NVIDIA staff is available during the presentations to answer questions, and the recordings are available for download.
http://developer.nvidia.com/object/gpu_computing_online.html
For technical questions please use the public CUDA developer forums:
http://forums.nvidia.com/index.php?showforum=62

2010年12月5日 星期日

使用 php 產生 /etc/shadow 的 hashed password

/etc/shadow 格式
http://www.linux.org.tw/CLDP/HOWTO/admin/Shadow-Password-HOWTO/Shadow-Password-HOWTO-2.html

<?php
// MD5
echo crypt($_GET['password'], '$1$');

2010年8月14日 星期六

於下次重開機時,自動執行 fsck

方法一:
# touch /forcefsck
# reboot

方法二:
# shutdown -rF now

2010年8月13日 星期五

sed & awk 的用法

http://www.delightpress.com.tw/bookRead/skns00004_read.pdf

windows 要使用 awk, sed 的話,請下載
http://sourceforge.net/projects/unxutils/
可把 \usr\local\wbin 目錄設定到 PATH

2010年4月15日 星期四

Fail2ban

看到 apache.org 的 JIRA 被駭客惡搞的新聞
http://www.ithome.com.tw/itadm/article.php?c=60623

Apache 修正了問題,還很佛心地公開他們的修正方法
https://blogs.apache.org/infra/entry/apache_org_04_09_2010

其中一項是
"Use Fail2Ban to protect web application login failures from brute force attacks"

原來有 Fail2Ban 這種東西,字面上的意思就是,失敗(Fail)就把你給擋掉(Ban)
http://net.nthu.edu.tw/2009/security:fail2ban

主機若有開放 SSH, FTP, Apache 登入 ,都應該裝這個來加強安全性。Fail2Ban 是 monitor log,所以一般的 web 程式應該也可以產生文字 log的方式來 trigger 它的 action,像是擋 Client IP 之類的。

另有 denyhosts 似乎也不錯,但使用這類軟體時,千萬要看清楚設定項目,免得不小心把自己也給擋了...
[FreeBSD] DenyHosts 設定在 hosts.allow 注意事項

安裝在 Debian
apt-get install denyhosts

2010年3月15日 星期一

gccgo Debian Package

gccgo Debian Package
http://www.atoztoa.com/2009/11/gccgo-debian-package.html

What is gccgo ?
http://golang.org/

2010年2月24日 星期三

Wine 小技法

想把 Flash Builder 4 for windows 裝在 Linux 下面 
How to install Flash Builder on Linux


其中提到了 winetricks
http://wiki.winehq.org/winetricks


這程式可以選擇要裝什麼 win32 元件,像是 vc runtime, .net runtime
$ wget http://www.kegel.com/wine/winetricks
$ sh winetricks
 

Anatomy of the Linux slab allocator

2009年12月4日 星期五

在 console 下寄送 email (Linux/Win32)

mailsend
http://www.muquit.com/muquit/software/mailsend/mailsend.html

Linux Kernel 之 Intel CC patch

聽說有的情況可以快 40%,平均也有 8~9%
http://www.linuxdna.com/
http://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler

如果 Linux 死機 : SysRq Key

To recover from a frozen linux system
Press and hold down ALT + SysRq (PrintScn) button and type phrase R E I S U B with 1 second interval between each letter.
Your system will magically recover from the crash and reboot itself.

http://alejandrocuervo.com/reisub/
http://linuxtoy.org/archives/what-to-do-if-linux-crash.html

在 Linux 下查詢 process 開了哪些檔案

lsof
http://ph7spot.com/musings/leveraging-lsof

2009年11月24日 星期二

HAProxy - The Reliable, High Performance TCP/HTTP Load Balancer

朋友在問有關 Load Balance 的問題,找到了 HAProxy
也有人推 nginx (讀作 engine x) http://nginx.org/en/

上線前要預估需要 "未來" 會用到多少硬體資源是相當困難的,特別是 public site
與其瞎子摸象亂買主機,不如弄一個比較容易擴充的架構 (high scalability)
debian lenny 裡面,只要 apt-get 即可安裝





Virtualization - Solaris Zones, Xen, V-Server, KVM, Proxmox VE

X86 伺服器虛擬化的三種技術

朋友想買 SUN 主機玩 Zones,我們對半虛擬化環境做了一些討論
因為需求是要單一主機,安裝大量的 VM 環境,像是 vmware 這種全虛擬化的作法,就暫時不考慮,必竟硬體資源有限。朋友的目標是單一主機 200+ 個獨立環境。

目前看到下面幾種 "半虛擬化" 環境

Solaris Zones
據朋友說,resource (如 memory) 會是共同的,有點像是 SGI 的 global shared memory,用 solaris 的好處之一是可以用 ZFS。據說,OpenSolaris 也支援 Zones 但 Resource Control 未支援 (還要再查資料),有分 Small Zones/Big Zones,Big Zones 跟 chroot 相當神似。
BigAdmin: Solaris Containers (Zones)
Zones - Siwiki
Zones Resource Controls - Siwiki
Zones Best Practices - Siwiki
Xen
半虛擬化,只能跟 host 環境相同,全虛擬化才能裝異質 OS。
[Howto] XEN paravirtualization
鳥哥的 Linux 私房菜 -- 利用 Xen 進行虛擬機器的製作
V-Server
http://linux-vserver.org/Welcome_to_Linux-VServer.org
http://wiki.debian.org.tw/index.php/VServer
需要 patch linux kernel,印象中有些 linux hosting 的廠商有提供 root 權限,估計就是用這個部署的。
KVM
在 Ubuntu 下面很好裝 (待試),官網甚至有說明文件
https://help.ubuntu.com/community/KVM
http://www.vzpedia.com/1974.html
http://thundersha.blogspot.com/2008/07/ubuntu-kvmgui-sector2.html
Proxmox VE
http://pve.proxmox.com/wiki/Main_Page
http://www.pigo.idv.tw/archives/492
OpenVZ
http://wiki.openvz.org/Main_Page


其他