Dec 23, 2008

读书——弗兰西斯·培根

读史使人明智,读诗使人聪慧,演算使人精密,哲理使人深刻,伦理学使人有修养,逻辑修辞使人善辩
Histories make men wise, poets witty, the mathematics subtle, natural philosophy deep, moral grave, logic and rhetoric able to contend

圣经——关于爱


<< 1 Corinthians 13 >>
King James Bible

1 Though I speak with the tongues of men and of angels, and have not charity, I am become as sounding brass, or a tinkling cymbal. 2 And though I have the gift of prophecy, and understand all mysteries, and all knowledge; and though I have all faith, so that I could remove mountains, and have not charity, I am nothing. 3 And though I bestow all my goods to feed the poor, and though I give my body to be burned, and have not charity, it profiteth me nothing. 4 Charity suffereth long, and is kind; charity envieth not; charity vaunteth not itself, is not puffed up, 5 Doth not behave itself unseemly, seeketh not her own, is not easily provoked, thinketh no evil; 6 Rejoiceth not in iniquity, but rejoiceth in the truth; 7 Beareth all things, believeth all things, hopeth all things, endureth all things.
8 Charity never faileth: but whether there be prophecies, they shall fail; whether there be tongues, they shall cease; whether there be knowledge, it shall vanish away. 9 For we know in part, and we prophesy in part. 10 But when that which is perfect is come, then that which is in part shall be done away. 11 When I was a child, I spake as a child, I understood as a child, I thought as a child: but when I became a man, I put away childish things. 12 For now we see through a glass, darkly; but then face to face: now I know in part; but then shall I know even as also I am known. 13 And now abideth faith, hope, charity, these three; but the greatest of these is charity.

<< 歌 林 多 前 书 13 >>
中文版

1 我 若 能 说 万 人 的 方 言 , 并 天 使 的 话 语 , 却 没 有 爱 , 我 就 成 了 鸣 的 锣 , 响 的 钹 一 般 。 2 我 若 有 先 知 讲 道 之 能 , 也 明 白 各 样 的 奥 祕 , 各 样 的 知 识 , 而 且 有 全 备 的 信 , 叫 我 能 够 移 山 , 却 没 有 爱 , 我 就 算 不 得 甚 么 。 3 我 若 将 所 有 的 赒 济 穷 人 , 又 舍 己 身 叫 人 焚 烧 , 却 没 有 爱 , 仍 然 与 我 无 益 。 4 爱 是 恒 久 忍 耐 , 又 有 恩 慈 ; 爱 是 不 嫉 妒 ; 爱 是 不 自 夸 , 不 张 狂 , 5 不 做 害 羞 的 事 , 不 求 自 己 的 益 处 , 不 轻 易 发 怒 , 不 计 算 人 的 恶 , 6 不 喜 欢 不 义 , 只 喜 欢 真 理 ; 7 凡 事 包 容 , 凡 事 相 信 , 凡 事 盼 望 , 凡 事 忍 耐 。
8 爱 是 永 不 止 息 。 先 知 讲 道 之 能 终 必 归 于 无 有 ; 说 方 言 之 能 终 必 停 止 ; 知 识 也 终 必 归 于 无 有 。 9 我 们 现 在 所 知 道 的 有 限 , 先 知 所 讲 的 也 有 限 , 10 等 那 完 全 的 来 到 , 这 有 限 的 必 归 于 无 有 了 。 11 我 作 孩 子 的 时 候 , 话 语 像 孩 子 , 心 思 像 孩 子 , 意 念 像 孩 子 , 既 成 了 人 , 就 把 孩 子 的 事 丢 弃 了 。 12 我 们 如 今 彷 佛 对 着 镜 子 观 看 , 糢 糊 不 清 ( 原 文 作 : 如 同 猜 谜 ) ; 到 那 时 就 要 面 对 面 了 。 我 如 今 所 知 道 的 有 限 , 到 那 时 就 全 知 道 , 如 同 主 知 道 我 一 样 。 13 如 今 常 存 的 有 信 , 有 望 , 有 爱 这 三 样 , 其 中 最 大 的 是 爱 。

Dec 16, 2008

发几个字体

现有字体如下
  1. adobe宋体
  2. adobe仿宋
  3. adobe楷体
  4. adobe黑体
  5. 微软雅黑
  6. YaHeiConsole
下载字体

Dec 8, 2008

Lyx 使用XeLatex编译中文Tex

  • 在documents/setting里面设置如下


这个packages是自己设的,你只需把XeTex要用到的自己写个packages就好了
  • 修改 C:\Program Files\LyX16\Resources\lyxrc.dist 文件,在最后面加入下边两行
  • \format "pdf4" "pdf" "PDF (xelatex)" "" "" "" "document,vector"
    \converter "pdflatex" "pdf4" "xelatex $$i" "latex"
  • 在工具栏中也添加xelatex的预览和更新可以在\LyX16\Resources\ui\stdtoolbars.inc 文件,在 Toolbar "view/update" "View/Update" 这部分后面添加下边三行
  • Separator
    Item "View PDF (xelatex)" "buffer-view pdf4"
    Item "Update PDF (xelatex)" "buffer-update pdf4"

Dec 3, 2008

Arch Linux 硬盘网络安装——通过代理

安装前的准备
  1. 下载arch的2008-03的ftp的iso
  2. 解压得到vmlinuz和initrd
  3. 用grub引导
  4. 准备arch的2008-06的setup文件,可以通过虚拟机拷出来 可以在这里下载
  5. 所有文件可以这里下载 。
安装过程
  1. 引导进去以后,首先用06的setup来替换掉原来的。
  2. 通过代理来网络更新,需要设置代理。首先网络安装时不是通过pacman来下载的,也不是通过wget来下载。因此设置wget代理没有用。可以通过设置环境变量来下载:export http_proxy="http://proxyusername:proxypassword@192.111.111.1:8080"。ftp代理类似
  3. 可以先编辑mirrorlist文件,这样在选择源时不需要再输入特定的源了。
  4. 注意最好一次成功,不然网络如果搞得不对的话,会不能下载的,即使修改后还是有问题。此时可以考虑重新引导,或者删掉/tmp里面的相关文件

Nov 21, 2008

中英文sp3的MSDN免激活版Key

英文版
RFYPJ-BKXH2-26FWP-WB6MT-CYH2Y
文件名:en_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73974.iso
SHA1:66ac289ae27724c5ae17139227cbe78c01eefe40
ISO/CRC:n/a
中文版
PJVCV-XCPPF-6GTKK-QXRPY-FBKGJ
文件名:zh-hans_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-74070.iso
SHA1:d142469d0c3953d8e4a6a490a58052ef52837f0f
ISO/CRC:n/a
再贴个地址,可以查询sha1

补充:貌似这个已经不能通过正版验证了,现在导入个注册表即可通过点我下载

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents]
"OOBETimer"=hex:ff,d5,71,d6,8b,6a,8d,6f,d5,33,93,fd
"LastWPAEventLogged"=hex:d5,07,05,00,06,00,07,00,0f,00,38,00,24,00,fd,02

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"CurrentBuild"="1.511.1 () (Obsolete data - do not use)"
"InstallDate"=dword:427cdd95
"ProductId"="69831-640-1780577-45389"
"DigitalProductId"=hex:a4,00,00,00,03,00,00,00,36,39,38,33,31,2d,36,34,30,2d,\
  31,37,38,30,35,37,37,2d,34,35,33,38,39,00,5a,00,00,00,41,32,32,2d,30,30,30,\
  30,31,00,00,00,00,00,00,00,00,0d,04,89,b2,15,1b,c4,ee,62,4f,e6,64,6f,01,00,\
  00,00,00,00,27,ed,85,43,a2,20,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,31,34,35,30,34,00,00,00,00,00,00,00,ce,0e,\
  00,00,12,42,15,a0,00,08,00,00,87,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,94,a2,b3,ac
"LicenseInfo"=hex:9e,bf,09,d0,3a,76,a5,27,bb,f2,da,88,58,ce,58,e9,05,6b,0b,82,\
  c3,74,ab,42,0d,fb,ee,c3,ea,57,d0,9d,67,a5,3d,6e,42,0d,60,c0,1a,70,24,46,16,\
  0a,0a,ce,0d,b8,27,4a,46,53,f3,17

Gmail 推出了Themes功能

有30个主题,有的还会根据天气地点来变化的

Nov 14, 2008

感觉自己中了google的毒了

每天一定用google search
每天一定用google calendar
几乎每天都要用gmail
几乎每天都要用google reader
几乎每天都要用Blogger
每周都要用google documents
每周都要用picasa
每周都要用google sites

哪天没有了google该怎么办呢?

FreelanuchBar

A free lanuchbar for windows!
I use it with google chrome apps.That's so great.

Nov 4, 2008

ubuntu8.10硬盘安装

看到一个新的的方法:
menu.lst里面写
title Install Ubuntu 8.10 LiveCD
find --set-root /ubuntu-8.10-desktop-i386.iso
kernel casper/vmlinuz boot=casper iso-scan/filename=/kubuntu-8.10-desktop-i386.iso ro partman/filter_mounted=false ubiquity/partman-skip-umount=trueubiquity/partman-skip-umount=true
initrd /casper/initrd.gz

把initrd.gz和vmlinuz文件拷到casper目录下。

Oct 31, 2008

Arch下安装ati显卡驱动

我的是X1150集成显卡驱动。直接一个命令
pacman -S catalyst
然后
aticonfig --initial
就差不多了。但是这样经常卡机

不过有个问题就是glxinfo | grep direct总是提示为no,执行
sudo LIBGL_DEBUG=verbose glxinfo> /dev/null
提示说没有/usr/X11R6/lib/modules/dri/fglrx_dri.so这个文件,只好sudo updatedb,然后locate fglrx_dri.so这个文件,找到后,把上面的文件夹建立起里,拷贝进去就可以了。
重启即可。
sudo LIBGL_DEBUG=verbose glxinfo> /dev/null的结果其他情况wiki上可能有

Oct 25, 2008

我的Blogger居然出问题了

有些html/script代码,居然被清空了。搞得我的ajax搜索,访问统计都挂了。
郁闷,别的Blogger好像没什么问题。

Oct 15, 2008

Google Site容量突破

有时候想多存点东西放在google site上面,但发现只有100m的空间,怎么办呢?
方法有两个:
1.多申请几个就好了
2.利用版本控制。上传同样名字不同东西的文件,都可以下到,而且也能分享。

Oct 3, 2008

ubuntu 8.10 beta试装

安装方法见ubuntu 硬盘安装

试了了一下,不咋地,没有装。

升级之痛

前段时间由于显卡驱动升级了,导致我的Arch挂了。重装之后,依旧很卡,遂放弃。有些东西很好使了之后,还是要珍惜,不能一味追求新。

生活也是如此,有些东西舍去了是不能回来的。

过一段时间,再看看有没有新的好使的驱动吧。

Oct 2, 2008

Flickr

This is a test post from flickr, a fancy photo sharing thing.

Sep 29, 2008

物理实验模板——XeTeX

这个需要有雅黑字体!和一张名叫36.jpg的图片 PDF下载
% # -*- coding: utf-8 -*-
\documentclass{article}
\usepackage{fontspec,fancyhdr,float,picinpar,xeCJK,xltxtra,graphicx}
\usepackage[a4paper, includeheadfoot,top=1.5cm, right=2.8cm]{geometry}
\usepackage[xetex,
        % pagebackref=true,
        bookmarks,
        % bookmarksnumbered=true,
        bookmarksopen=true, %Collapse all bookmarks at pdf start view
        pdfauthor={风中林立},
        pdftitle={物理实验},
        pdfsubject={近代物理实验},
        pdfkeywords={物理,实验},
        pdfcreator={XeLaTex with hyperref package using SciTE as editor by sun},
        colorlinks,
        linkcolor=red,
        % hyperindex,
        % plainpages=false,
        % pdfstartview=FitH,
                pdfborder={0 0 0}%remove the hyperrefns border.
      ]{hyperref}
%%%%%%%%%%%%%
\usepackage{verbatim,makeidx,xcolor}
\usepackage{amsmath,amsfonts,amsthm}
%%%%%%%%%%%%%%

%  \setmainfont{Tahoma}% 英文字体 会导致斜体不能用
%  \setsansfont{Times New Roman}
\setCJKmainfont[BoldFont={SimHei}]{YaHei Consolas Hybrid}
\setCJKfamilyfont{yahei}{Microsoft YaHei}

\renewcommand\contentsname{目录}
\renewcommand\listfigurename{图片}
\renewcommand\figurename{}
\renewcommand\tablename{}
\renewcommand\figureautorefname{}
\renewcommand\tableautorefname{}


% begin demo
%Code demo
\makeatletter
\newenvironment{mycode}{
    \noindent
    \newsavebox{\mybox}
    \begin{lrbox}{\mybox}
    \begin{minipage}[c]{.945\textwidth}
    \begin{verbatim}
}{
    \end{verbatim}
    \end{minipage}
    \end{lrbox}%
    \setlength{\fboxsep}{8pt}
    \colorbox{demo@bgcolor}{\usebox{\mybox}}
    \setlength{\fboxsep}{\oldfboxsep}
}

\newenvironment{myoutput}{
    \noindent
    \begin{lrbox}{\@tempboxa}
    \begin{minipage}[c]{.945\textwidth}
}{
    \end{minipage}
    \end{lrbox}%
    \setlength{\fboxsep}{8pt}
    \fbox{\usebox{\@tempboxa}}
    \setlength{\fboxsep}{\oldfboxsep}
}
\makeatother


\definecolor{demo@bgcolor}{gray}{.8}
\let\oldfboxsep\fboxsep
\newwrite\file
\newsavebox{\mybox}

\makeatletter
\def\demo@start{
    \begingroup% Lets Keep the Changes Local
    \@bsphack
    \immediate\openout \file \jobname.exa
    \let\do\@makeother\dospecials
    \catcode`\^^M\active
    \def\verbatim@processline{
        \immediate\write\file{\the\verbatim@line}
    }
    \verbatim@start
}

\def\demo@end{\immediate\closeout\file\@esphack\endgroup}

\def\demo@code#1#2{%
    \setlength{\fboxsep}{8pt}%
    \colorbox{#1}{%
    \begin{minipage}[c]{#2}
        \setlength{\fboxsep}{\oldfboxsep}
        \small\verbatiminput{\jobname.exa}
    \end{minipage}%
    }%
}

\def\demo@out#1{%
    \setlength{\fboxsep}{8pt}%
    \fbox{%
    \begin{minipage}[c]{#1}
        \setlength{\fboxsep}{\oldfboxsep}
        \small\input{\jobname.exa}
    \end{minipage}%
    }%
}

\newenvironment{code}{
    \demo@start
}{
    \demo@end
    \list{}{\itemindent-\leftmargin}
    \item
    \demo@code{demo@bgcolor}{.95\textwidth}
    \endlist
}

\newenvironment{halfcode}{
    \demo@start
}{
    \demo@end
    \list{}{\itemindent-\leftmargin}
    \item
    \demo@code{demo@bgcolor}{.52\textwidth}
    \endlist
}

\newenvironment{out}{
    \demo@start
}{
    \demo@end
    \list{}{\itemindent-\leftmargin}
    \item
    \demo@out{.95\textwidth}
    \endlist
}

\newenvironment{demo}{
    \demo@start
}{
    \demo@end
    \list{}{\itemindent-\leftmargin}
    \item
    \makebox[\textwidth][c]{%
        \demo@code{demo@bgcolor}{.52\textwidth}%
        \hspace{10pt}%
        \demo@out{.36\textwidth}%
    }
    \endlist
}

\newenvironment{fdemo}[1]{
    \begin{lrbox}{\mybox}%
    \setlength{\fboxsep}{8pt}%
    \fbox{%
    \begin{minipage}[c]{.36\textwidth}
        \setlength{\fboxsep}{\oldfboxsep}
        \small{#1}
    \end{minipage}%
    }%
    \end{lrbox}
    \demo@start
}{
    \demo@end
    \list{}{\itemindent-\leftmargin}
    \item
    \makebox[\textwidth][c]{%
        \demo@code{demo@bgcolor}{0.52\textwidth}%
        \hspace{10pt}%
        \usebox{\mybox}%
    }
    \endlist
}
\makeatother

\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
  \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
\def\XeTeX{\leavevmode
  \setbox0=\hbox{X\lower.5ex\hbox{\kern-.15em\reflect{E}}\kern-.1667em \TeX}%
  \dp0=0pt\ht0=0pt\box0 }

% end demo



\pagenumbering{arabic}
    \pagestyle{fancy}%
    \fancyhead[L]{\thepage}%
  \chead{量子效应}
    %~ \renewcommand{\sectionmark}[1]{\markboth{#1}{}}
    \fancyfoot{}
% \newpage

\setlength{\parindent}{2em}

\title{量子效应}
\author{熊猫}
\date

\begin{document}

\maketitle
% \tableofcontents
% \listoffigures
% \newpage

\section{预备知识}
微波是波长最短的无 \textcolor{blue}{anna}} \autoref{fig:anna} 线电波。无线电波可按其波长范围或频率范围进行分类,波长范围约1米~1毫米,即频率为300兆赫~300千兆赫的无线电波称为微波。
微波技术是第二次世界大战期间,由于雷达的需要而发展起来的一门电子技术。它已在通讯、原子能技术、空间技术、量子电子学以及工农业生产等许多部门都得到了广泛的应用,并深入到医疗卫生和日常生活。如家用微波炉已进入了人们的家庭,成为烹调的得力工具。

\section{引言}
\begin{figwindow}[1,r,{\mbox{%r表示右侧,c中央,l左侧 详见插图指南
\includegraphics[width=4cm]{36}}},{girls}]

实用温度计又称电温度计,因为这一类温度计主要利用某些材料的电性质的温度关系来测量温度。确定这些温度关系即是所谓“温度标定”。由于人们对纯金属、某些合金及半导体材料的电阻率-温度关系展开了深入的研究,建立在这些研究基础上的电阻温度计已经成为最重要的低温实用温度计。而随着热电现象的研究和热电材料研制的进展,以温差电动势为基本测量的各种热电偶温度计也得到了广泛的应用。近十多年来,以锗、硅和砷化镓制成的二极管低温温度计受到了重视,因为它们在低温下较宽范围内接近线性的特性使得温度的数字显示较易实现。本实验利用铂电阻温度计对热电偶温度计及二极管温度计,在氮的三相点以上至120k左右的温度范围进行温度标定。通过这一实验可以掌握低温实验的测温控温及电测量技术,学会对标定的温度计进行准确度、测量精度以及灵敏度的分析,这一实验技术亦适用于低温物性测量。
\end{figwindow}

\section{9-18}
1931年9月18日晚,日本驻中国的侵略军——关东军,自行炸毁沈阳北郊柳条湖附近南满铁路的一段路轨,反诬中国军队破坏铁路,并借此悍然突袭东北军驻地北大营和沈阳城。由于国民党政府的不抵抗,日军随即在几天内侵占20多座城市及其周围的广大地区。这就是震惊中外的“九·一八”事变。到1932年 ..

\begin{figure}[H]%如果当前页不能满足放置,则下页顶部放置位置图片,需要float宏包
\centering
\includegraphics[width=4cm]{36}}
\caption{Small girls}
\end{figure}
\begin{figure}[H]%如果当前页不能满足放置,则下页顶部放置位置图片,需要float宏包
\centering
\includegraphics[scale=0.3]{36}
\caption{10个月大的Anna}
\label{fig:anna}
\end{figure}

\begin{table}[H]
  \centering
\begin{tabular}{|l|c|r|}
\hline
操作系统& 发行版& 编辑器\\
\hline
Windows & MikTeX & TeXnicCenter \\
\hline
Unix/Linux & TeX Live & Emacs \\
\hline
Mac OS & MacTeX & TeXShop \\
\hline
\end{tabular}
\caption{操作系统}

\begin{tabular}[H]{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
\caption{numbers}
\end{table}

有许多问题都是很奇怪的 \\

\def\pangram{The five boxing wizards jump quickly.\\}
{\noindent \itshape \pangram}
{\textit \pangram}
{\scshape \pangram}
{\scshape \itshape \pangram}
\bfseries \pangram
{\itshape \pangram}
{\scshape \pangram}
{\scshape \itshape \pangram}

\autoref{fig:anna}

\begin{code}
  \XeLaTeX
\end{code}

\begin{demo}
  \alpha \times \beta = \kappa
\end{demo}


\begin{demo}
   \begin{figure}[H]
      \begin{center}
        \includegraphics[scale=0.14]{36}
      \end{center}
      \caption{mm}
      \label{fig:YIyi}
    \end{figure}
\end{demo}

\end{document}

Sep 27, 2008

无奈中的世界——中国手机WIFI何时解禁

不明白中国相关部门为何一直卡着这道门槛不放。我们知道一流企业定标准,当然定标准得到的利益一般也是最大的。中国信息产业部为保护WAPI有必要如此排斥WIFI吗?
  1. 首先,国内企业有没有这样定标准的能力,这是一个问题!没有这个能力,死抱着不放蛮不讲理。
  2. 其次,WAPI既然不能被国际接受,成为不了国际标准,为何还死死不放?你大可以一边放行WIFI,一边提升自己的国际标准竞争力,待到你是老大的时候,你还怕别人不听?软弱者就是比不过别人,也不让别人好过。
  3. 再者,国内手机不能WIFI自然离不开金钱利益关系的原因。WIFI多了,移动收入就少了,移动收入少了,是不是某些人的压岁钱就少了呢?本来WIFI的出现,受益最大的是群众,国家本来就是为自己国家的公民争取最大的利益,可我们国家呢?。
无语中,心痛中...

Sep 25, 2008

Viki在windows下安装

发现用Blogspot发布,样式全变了

0.1 简述

本文介绍如何在windows下安装带代码高亮的viki

0.2 准备

0.2.1 Ruby For Win

直接下载一个one-Click install安装即可

0.2.2 deplate

下载deplate.gem然后用ruby的gem安装

gem install deplate.gem

0.2.3 hpricot

这是代码高亮要用的

gem install hpricot --source http://code.whytheluckystiff.net

0.2.4 安装viki插件

官网上搜索下载,需要注意的是还需要安装另一个依赖包。

0.2.5 添加下列语句到_vimrc

:map <F8> <esc><C-S> :!deplate -t bright.html --css bright -m code-gvim71 -d D:\viki\html -X % <CR>
:imap <F8> <esc><C-S> :!deplate -t bright.html --css bright -m code-gvim71 -d D:\viki\html -X % <CR>
:map <f9> :!del d:\viki\html\*ode_*

这样以后只需按一下F8即可

0.2.6 设置环境变量

由于我的是绿色版,所以需要添加环境变量


0.2.7 注销

不然很有可能环境变量未生效

Google Docs原文

Sep 24, 2008

手动为vim中的html添加结束标签支持

在你的vimrc里面加入下列代码
:imap <C-K> <space><esc>dbi<<esc>pa><cr></<esc>pa><esc>ko
:imap <C-L> <space><esc>dbi<<esc>pa></<esc>pa><esc>bba
:imap <C-J> <esc>o


Ctrl-K实现标签换行关闭。Ctrl-L实现同一行关闭。Ctrl-J实现在编辑模式下开始新的一行。

Sep 14, 2008

中秋快乐!

在八八六十四帖之际,祝大家中秋快乐!希望大家能够与家人团圆!

Sep 12, 2008

今天保研面试完了

可以休息一段时间,等待通知中。

Sep 6, 2008

Ajax search in blogger

经过一段时间的摸索,终于搞好了google站内ajax搜索!
可以在侧边栏试试效果!
但是貌似google blog搜索api有点问题,以至于会出现<font color="#cc0033">fine</font>不知道何时能好!

Sep 5, 2008

精品软件介绍(2)

我用过的精品软件介绍——小于10m
 
  1. Broken X Disk Manager
  2. 是不是有很多光盘,或者移动硬盘,U盘什么的。如果想看看某个东西在哪张盘里面,那就用这个吧。可以把你的整个硬盘,光盘都做一个文件数据库,打开这个数据库后,就如同在浏览器里面一样。这样再多的光盘也不用担心管理了,当然硬盘也成(这是比其他优秀的地方之一)。
  3. Picasa
  4. 一个管理图片的,Google出品的软件。现在已经出到Picasa 3 beta,加入了人脸识别功能。Picasa可以很好的把图片传到Picasa网络相册,Blogger。当然更为优秀的是它的强大管理功能,能够方便的把图片制作成电影,把多张图片制作成海报等等,加上Google的强大搜索功能,相信一定能够帮你管好图片的。
  5. Bulk Rename Utility
  6. 非常强大的批量重命名工具。可以批量添加数字,等等。直接上图,自己看看能做什么吧。

先介绍到这里吧。

Sep 4, 2008

The Original picture

Just For Somebody

This is just for you!

精品软件介绍(1)

我用过的精品软件介绍——小于500k

  1. HotKeyP
  2. 这个也是我觉得最棒的一个。利用HotKeyP,可以一键启动任意程序,并能加参数启动,可以调节音量大小,可以方便的移除U盘,可以设置窗口透明度,等等。而且大小只有50k左右,内存占用也不大,几兆而已。
  3. Hamsin Clipboard
  4. 一个剪贴板增强工具,可以设置快捷键来直接粘帖不同内容,支持图片文件。比如可以用WIN+1来粘帖一个文本,用WIN+2粘帖一张图片...最多支持10个。还有收藏某个粘帖的功能。
  5. Unlocker
  6. 解锁文件,以便删除。
  7. Atnotes
  8. 一个桌面便签的软件,可以在桌面显示你的便签。
  9. ToYcon
  10. png转到icon格式的软件,记得jpg格式的也可以转。
  11. nfo viewer
  12. 看Nfo的软件,有Linux版本。小巧好使。
  13. 1by1
  14. 非常小巧快速的目录音乐播放器,不需要添加播放列表,基于目录,直接播放。打开速度非常快,界面简洁清爽。

先介绍到这里。

Sep 3, 2008

考研还是双学位

现在已经有机会考双学位了。
于是问题又摆在面前,是考研还是看双学位,还是两者都准备?
该如何抉择?

Picasa 3 Download

已经可以下载picasa3了,官方网站似乎有点问题,我这里直接给出下载地址。
Google Picasa 3 Download 

Google Chrome可以下载了

主页
直接下载

Waiting For Google Chrome

Waiting,waiting,and waiting......

Sep 2, 2008

考研

准备考研

本来还是犹豫不决,不过貌似我们这种系不考研有点亏了,再加上本校优势,估计认真准备,还是很容易考上的,复试基本不成问题。貌似考验之后的光景也是非常不错。
既然受此诱惑,于是乎,下决心考!!

Sep 1, 2008

美丽人生——只言片语

缺少的是什么,拥有的是什么,这都值得思考。
缺少的重要吗,拥有的重要吗?
什么是值得追求的,什么又是可以放弃的?
不能言语,不能明示,似乎只得心领神会。
痛苦不是孤独,但孤独定是痛苦。
趁着年轻,需要好好抚慰一下心伤,准备一下人生。
只言片语,不得而语。
一切尽抚心胃,万事无惧。

Aug 31, 2008

Arch 个人笔记

0.1. 安装Arch

  1. 下载iso,刻盘;或者下载Img,用winimage复制到U盘或者用dd命令。
  2. 启动,手动分区,注意不要删除你的数据。
  3. 挂载,不要挂错了
  4. 选择软件包,默认选择后再加选ntfs-3g和sudo,以及你的无线网卡。
  5. 安装软件包。时间很短,大概在1分钟不到。如果不是网络安装的话。
  6. 配置系统。基本不用改,可以以后再改。可能需要改的是rc.conf,设置你的主机名,上网方式。还有就是要修改一下locale,去掉en_US.utf-8的注释
  7. 安装grub,重启。最好重启,不要直接装软件,不然你可能会发现,最后并没有安装。
Welcome to Myblog

0.2. 配置Arch

这个是根据我的笔记本来写的,不过可以参考

useradd -m -s /bin/bash username
passwd username
添加用户并设置密码。
pacman -S xorg
安装X,但是可以选择,不必全部安装。
pacman -S hwd catalyst
安装硬件检测工具和显卡驱动
pacman -S synaptics
安装笔记本触摸板驱动
pacman -S alsa-utils
安装声卡驱动 装好之后需要运行alsaconf来配置声卡,并且需要把alsa放在daemon里面.
pacman -S gnome gdm gnome-terminal gnome-power-manager gnome-system-tools
安装gnome桌面,你也可以有选择的安装,比如最后的epiphany浏览器可以不装
pacman -S fcitx vim
Once you have installed. You'd better install vim first. Because you can not edit if you don't set gbk encoding. You can put "set fileencodings=utf8,gbk" in ~/.vimrc. And then you can run the command "vim .fcitx/config". And then you maybe want to put the following into .profile. setup XIM environment, needn't if use SCIM as gtk-immodules
---------------------------------
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
fcitx &
---------------------------------
pacman -S ccsm compiz-decorator-gtk compiz-plugins-extra
安装compiz及其相关的东西
pacman -S sudo
安装sudo,首先你要在root下运行visudo,然后反注释掉#%wheel ALL这一行. 然后运行gpasswd -a username wheel
pacman -S alacarte
Gnome菜单编辑器
pacman -S firefox opera amule liferea pidgin
各类网络工具
pacman -S file-roller unrar
Gnome的菜单编辑器
pacman -S smplayer codecs
看电影的东西 ──全能播放器
pacman -S gedit
用不惯vim的另一选择
pacman -S hal
自动挂载U盘等作用────不是很清楚 你需要把hal加入到daemon中,并且加入该组 usermod -aG hal username 可能你还需要加入其他组 usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal username
pacman -S gpicview mirage
两个简单快速的看图软件,mirage功能多点
pacman -S rdesktop vino
rdesktop :命令行远程桌面 rdesktop -f 192.168.0.1 vino:图形化的远程桌面

0.3. Arch的备份与重装

0.3.1. Arch的备份

这里介绍的是用tar来备份与恢复系统
tar cvpzf /media/E/backup.tgz --exclude=/proc --exclude=/home --exclude=/mnt --exclude=/sys --exclude=/media /
可以根据自己的需要来修改,保存到back.sh里面,加入执行权限。 注意在执行该命令时,最好把/boot/grub/menu.lst里面的内容修改一下,因为在arch下,是用uuid来确定分区,可以改成sda5 ...这样以后重新划分区也可以成功启动。 同样把/etc/fstab里面的uuid也改掉,不然在不匹配的时候,是进不去系统的。 然后在root下,执行back.sh命令。

0.3.2. Arch的重装

恢复的时候需要进入linux,不知道livecd可不可以,没试过,我是直接装了一遍arch,注意可能你需要安装ntfs-3g,不然进不去。 然后执行tar xvpfz /media/E/backup.tgz -C / 这个命令不会删除根分区下back.tgz里没有的东西。

可能遗留的问题,你不能修改你的密码。此时需要在root下执行pwconv,然后即可改密码 passwd username


0.4. Tips Of Arch

  1. 复制命令
    • cp /home/user/doc.txt{,.bak} 同一目录备份
    • cp /home/user/doc.txt{,.bak} ~/ 复制同一目录下的文件到其他地方
  2. 安装字体
    • cp font.ttf /usr/share/fonts/myfonts/ 复制字体
    • cd alt+. alt+.表示按下alt健和.健,会直接转换为上个命令最后的内容
    • mkfontdir ;mkfontscale ;fc-cache ./ 刷新字体
  3. 关闭显示器
    • 执行命令xset dpms force off
    • 可以添加该命令到compiz里面,用快捷键来代替

Arch 代理设置

Welcome to Myblog

0.1. Arch:Pacman的代理设置

0.1.1. 一级代理上网

  • 执行 export http_proxy="http://username:passwd@192.168.1.2:8080" 其中192.168.1.2 换成你的代理,8080 换成代理端口。
  • 如果需要ftp的话,export ftp_proxy="http://username:passwd@192.168.1.2:8080"
  • pacman 使用代理需要注释掉 pacman.conf 里面的 wget那行.
  • 可以使用sudo http_proxy="http://usename:passwd@192.168.1.2:8080" pacman -S xxx
  • 还可以这样用 http_proxy="http://127.0.0.1:8088" yaourt xxx   这个需要二级代理
  • 如果需要自动加载代理设置,需要把上面的两个命令写到.bashrc里面,或者alias

0.1.2. 二级代理上网

  • 下载desproxy这个软件,可以在sourceforge上下载。
  • 编译安装desproxy。
  • 执行export PROXY_USER=yourname:passwd
  • 再执行/usr/local/bin/desproxy 二级代理Ip 二级代理端口 一级代理IP 一级代理端口 本地端口
  • 运行desproxy后,指定代理为127.0.0.1:自己指定的本地端口,这样就可以了

Aug 30, 2008

Linux Command

转自 from http://www.linuxguide.it/linux_commands_line_en.htm

System information
arch show architecture of machine
uname -r show used kernel version
dmidecode -q show hardware system components - (SMBIOS / DMI)
hdaparm -i /dev/hda displays the characteristics of a hard-disk
hdparm -tT /dev/sda perform test reading on a hard-disk
cat /proc/cpuinfo show information CPU info
cat /proc/interrupts show interrupts
cat /proc/meminfo verify memory use
cat /proc/swaps show file(s) swap
cat /proc/version show version of the kernel
cat /proc/net/dev show network adpters and statistics
cat /proc/mounts show mounted file system(s)
lspci -tv display PCI devices
lsusb -tv show USB devices
date show system date
cal 2007 show the timetable of 2007
date 041217002007.00 set date and time - MonthDayhoursMinutesYear.Seconds
clock -w
save date changes on BIOS

Shutdown, Restart of a system and Logout
shutdown -h now shutdown system
init 0
telinit 0
shutdown -r hours:minutes & planned shutdown of the system
shutdown -c cancel a planned shutdown of the system
shutdown -r now reboot
reboot
logout leaving session

Files and Directory
cd /home enter to directory '/ home'
cd .. go back one level
cd ../.. go back two levels
cd go to home directory
cd ~utente go to home directory
cd - go to previous directory
pwd show the path of work directory
ls view files of directory
ls -F view files of directory
ls -l show details of files and directory
ls -a show hidden files
ls *[0-9]* show files and directory containing numbers
lstree show files and directories in a tree starting from root
mkdir dir1 create a directory called 'dir1'
mkdir dir1 dir2 create two directories simultaneously
mkdir -p /tmp/dir1/dir2 create a directory tree
rm -f file1 delete file called 'file1'
rmdir dir1 delete directory called 'dir1'
rm -rf dir1 remove a directory called 'dir1' and contents recursively
rm -rf dir1 dir2 remove two directories and their contents recursively
mv dir1 new_dir rename / move a file or directory
cp file1 file2 copying a file
cp dir/* . copy all files of a directory within the current work directory
cp -a /tmp/dir1 . copy a directory within the current work directory
cp -a dir1 dir2 copy a directory
ln -s file1 lnk1 create a symbolic link to file or directory
ln file1 lnk1 create a physical link to file or directory
touch -t 0712250000 fileditest modify timestamp of a file or directory - (YYMMDDhhmm)

File search
find / -name file1 search file and directory into root filesystem from '/'
find / -user user1 search files and directories belonging to 'user1'
find /home/user1 -name *.bin search files with '. bin' extension within directory '/ home/user1'
find /usr/bin -type f -atime +100 search binary files are not used in the last 100 days
find /usr/bin -type f -mtime -10 search files created or changed within 10 days
find / -name *.rpm -exec chmod 755 {} ; search files with '.rpm' extension and modify permits
find / -xdev -name *.rpm search files with '.rpm' extension ignoring removable partitions as cdrom, pen-drive, etc.¡­
locate *.ps find files with the '.ps' extension - first run 'updatedb' command
whereis halt show location of a binary file, source or man
which halt show full path to a binary / executable

Mounting a Filesystem
mount /dev/hda2 /mnt/hda2 mount disk called hda2 - verify existence of the directory '/ mnt/hda2'
umount /dev/hda2 unmount disk called hda2 - exit from mount point '/ mnt/hda2' first
fuser -km /mnt/hda2 force umount when the device is busy
umount -n /mnt/hda2 run umount without writing the file /etc/mtab - useful when the file is read-only or the hard disk is full
mount /dev/fd0 /mnt/floppy mount a floppy disk
mount /dev/cdrom /mnt/cdrom mount a cdrom / dvdrom
mount /dev/hdc /mnt/cdrecorder mount a cdrw / dvdrom
mount /dev/hdb /mnt/cdrecorder mount a cdrw / dvdrom
mount -o loop file.iso /mnt/cdrom mount a file or iso image
mount -t vfat /dev/hda5 /mnt/hda5 mount a Windows FAT32 file system
mount /dev/sda1 /mnt/usbdisk mount a usb pen-drive or flash-drive
mount -t smbfs -o username=user,password=pass //winclient/share /mnt/share
mount a windows network share

Disk Space
df -h show list of partitions mounted
ls -lSr |more show size of the files and directories ordered by size
du -sh dir1 estimate space used by directory 'dir1'
du -sh * | sort -rn show size of the files and directories sorted by size
rpm -q -a --qf '%10{SIZE}t%{NAME}n' | sort -k1,1n show space used by rpm packages installed sorted by size (fedora, redhat and like)
dpkg-query -W -f='${Installed-Size;10}t${Package}n' | sort -k1,1n show space used by deb packages installed sorted by size (ubuntu, debian and like)

Users and Groups
groupadd group_name create a new group
groupdel group_name delete a group
groupmod -n new_group_name old_group_name rename a group
useradd -c "Nome Cognome" -g admin -d /home/user1 -s /bin/bash user1 create a new user belongs "admin" group
useradd user1 create a new user
userdel -r user1 delete a user ( '-r' eliminates home directory)
usermod -c "User FTP" -g system -d /ftp/user1 -s /bin/nologin user1 change user attributes
passwd change password
passwd user1 change a user password (only by root)
chage -E 2005-12-31 user1 set deadline for user password
pwck check correct syntax and file format of '/etc/passwd' and users existence
grpck check correct syntax and file format of '/etc/group' and groups existence
newgrp group_name log in to a new group to change default group of newly created files

Permits on File - use "+" to set permissions and "-" to remove
ls -lh show permits
ls /tmp | pr -T5 -W$COLUMNS divide terminal into 5 columns
chmod ugo+rwx directory1 set permissions reading (r), write (w) and (x) access to users owner (u) group (g) and others (o)
chmod go-rwx directory1 remove permits reading (r), write (w) and (x) access to users group (g) and others (or
chown user1 file1 change owner of a file
chown user1 -R directory1 change user owner of a directory and all the files and directories contained inside
chgrp gruppo1 file1 change group of files
chown user1:gruppo1 file1 change user and group ownership of a file
find / -perm -u+s view all files on the system with SUID configured
chmod u+s /bin/file_eseguibile set SUID bit on a binary file - the user that running that file gets same privileges as owner
chmod u-s /bin/file_binario disable SUID bit on a binary file
chmod g+s /home/public set SGID bit on a directory - similar to SUID but for directory
chmod g-s /home/public disable SGID bit on a directory
chmod o+t /home/comune set STIKY bit on a directory - allows files deletion only to legitimate owners
chmod o-t /home/comune disable STIKY bit on a directory

Special Attributes on file - use "+" to set permissions and "-" to remove
chattr +a file1 allows write opening of a file only append mode
chattr +c file1 allows that a file is compressed / decompressed automatically by the kernel
chattr +d file1 makes sure that the program ignores Dump the files during backup
chattr +i file1 makes it an immutable file, which can not be removed, altered, renamed or linked
chattr +s file1 allows a file to be deleted safely
chattr +S file1 makes sure that if a file is modified changes are written in synchronous mode as with sync
chattr +u file1 allows you to recover the contents of a file even if it is canceled
lsattr show specials attributes

Archives and compressed files
bunzip2 file1.bz2 decompress a file called 'file1.bz2'
bzip2 file1 compress a file called 'file1'
gunzip file1.gz decompress a file called 'file1.gz'
gzip file1 compress a file called 'file1'
gzip -9 file1 compress with maximum compression
rar a file1.rar test_file create an archive rar called 'file1.rar'
rar a file1.rar file1 file2 dir1 compress 'file1', 'file2' and 'dir1' simultaneously
rar x file1.rar decompress rar archive
unrar x file1.rar decompress rar archive
tar -cvf archive.tar file1 create a uncompressed tarball
tar -cvf archive.tar file1 file2 dir1 create an archive containing 'file1', '
file2' and 'dir1'
tar -tf archive.tar show contents of an archive
tar -xvf archive.tar extract a tarball
tar -xvf archive.tar -C /tmp extract a tarball into / tmp
tar -cvfj archive.tar.bz2 dir1 create a tarball compressed into bzip2
tar -xvfj archive.tar.bz2 decompress a compressed tar archive in bzip2
tar -cvfz archive.tar.gz dir1 create a tarball compressed into gzip
tar -xvfz archive.tar.gz decompress a compressed tar archive in gzip
zip file1.zip file1 create an archive compressed in zip
zip -r file1.zip file1 file2 dir1 compress in zip several files and directories simultaneously
unzip file1.zip decompress a zip archive

RPM Packages - Fedora, Red Hat and like
rpm -ivh package.rpm install a rpm package
rpm -ivh --nodeeps package.rpm install a rpm package ignoring dependencies requests
rpm -U package.rpm upgrade a rpm package without changing configuration files
rpm -F package.rpm upgrade a rpm package only if it is already installed
rpm -e package_name.rpm remove a rpm package
rpm -qa show all rpm packages installed on the system
rpm -qa | grep httpd show all rpm packages with the name "httpd"
rpm -qi package_name obtain information on a specific package installed
rpm -qg "System Environment/Daemons" show rpm packages of a group software
rpm -ql package_name show list of files provided by a rpm package installed
rpm -qc package_name show list of configuration files provided by a rpm package installed
rpm -q package_name --whatrequires show list of dependencies required for a rpm packet
rpm -q package_name --whatprovides show capability provided by a rpm package
rpm -q package_name --scripts show scripts started during installation / removal
rpm -q package_name --changelog show history of revisions of a rpm package
rpm -qf /etc/httpd/conf/httpd.conf verify which rpm package belongs to a given file
rpm -qp package.rpm -l show list of files provided by a rpm package not yet
installed
rpm --import /media/cdrom/RPM-GPG-KEY import public-key digital signature
rpm --checksig package.rpm verify the integrity of a rpm package
rpm -qa gpg-pubkey verify integrity of all rpm packages installed
rpm -V package_name check file size, permissions, type, owner, group, MD5 checksum and last modification
rpm -Va check all rpm packages installed on the system - use with caution
rpm -Vp package.rpm verify a rpm package not yet installed
rpm2cpio package.rpm | cpio --extract --make-directories *bin* extract executable file from a rpm package
rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm install a package built from a rpm source
rpmbuild --rebuild package_name.src.rpm build a rpm package from a rpm source

YUM packages updater - Fedora, RedHat and like
yum install package_name download and install a rpm package
yum update update all rpm packages installed on the system
yum update package_name upgrade a rpm package
yum remove package_name remove a rpm package
yum list list all packages installed on the system
yum search package_name find a package on rpm repository
yum clean packages clean up rpm cache erasing downloaded packages
yum clean headers remove all files headers that the system uses to resolve dependency
yum clean all remove from the cache packages and headers files

DEB packages - Debian, Ubuntu and like
dpkg -i package.deb install / upgrade a deb package
dpkg -r package_name remove a deb package from the system
dpkg -l show all deb packages installed on the system
dpkg -l | grep httpd show all rpm packages with the name "httpd"
dpkg -s package_name obtain information on a specific package installed on system
dpkg -L package_name show list of files provided by a package installed on system
dpkg --contents package.deb show list of files provided by a package not yet installed
dpkg -S /bin/ping verify which package belongs to a given file

APT packages updater - Debian, Ubuntu e like
apt-get install package_name install / upgrade a deb package
apt-cdrom install package_name install / upgrade a deb package from cdrom
apt-get update update all deb packages installed on system
apt-get remove package_name remove a deb package from system
apt-get check verify correct resolution of dependencies
apt-get clean clean up cache from packages downloaded

View file content
cat file1 view the contents of a file starting from the first row
tac file1 view the contents of a file starting from the last line
more file1 view content of a file along
less file1 similar to 'more' command but which allows backward movement in the file as well as forward movement
head -2 file1 view first two lines of a file
tail -2 file1 view last two lines of a file
tail -f /var/log/messages view in real time what is added to a file

Text Manipulation
cat file_test | [operation: sed, grep, awk, grep, etc] > result.txt syntax to elaborate the text of a file, and write result to a new file
cat file_originale | [operazione: sed, grep, awk, grep, etc] >> result.txt syntax to elaborate the text of a file and append result in existing file
grep Aug /var/log/messages look up words "Aug" on file '/var/log/messages'
grep ^Aug /var/log/messages look up words that begin with "Aug" on file '/var
/log/messages'
grep [0-9] /var/log/messages select from file '/var/log/messages' all lines that contain numbers
grep Aug -R /var/log/* search string "Aug" at directory '/var/log' and below
sed 's/stringa1/stringa2/g' example.txt replace "string1" with "string2" in example.txt
sed '/^$/d' example.txt remove all blank lines from example.txt
sed '/ *#/d; /^$/d' example.txt remove comments and blank lines from example.txt
echo 'esempio' | tr '[:lower:]' '[:upper:]' convert from lower case in upper case
sed -e '1d' result.txt eliminates the first line from file example.txt
sed -n '/stringa1/p' view only lines that contain the word "string1"
sed -e 's/ *$//' example.txt remove empty characters at the end of each row
sed -e 's/stringa1//g' example.txt remove only the word "string1" from text and leave intact all
sed -n '1,5p;5q' example.txt view from 1th to 5th row
sed -n '5p;5q' example.txt view row number 5
sed -e 's/00*/0/g' example.txt replace more zeros with a single zero
cat -n file1 number row of a file
cat example.txt | awk 'NR%2==1' remove all even lines from example.txt
echo a b c | awk '{print $1}' view the first column of a line
echo a b c | awk '{print $1,$3}' view the first and third column of a line
paste file1 file2 merging contents of two files for columns
paste -d '+' file1 file2 merging contents of two files for columns with '+' delimiter on the center
sort file1 file2 sort contents of two files
sort file1 file2 | uniq sort contents of two files omitting lines repeated
sort file1 file2 | uniq -u sort contents of two files by viewing only unique line
sort file1 file2 | uniq -d sort contents of two files by viewing only duplicate line
comm -1 file1 file2 compare contents of two files by deleting only unique lines from 'file1'
comm -2 file1 file2 compare contents of two files by deleting only unique lines from 'file2'
comm -3 file1 file2 compare contents of two files by deleting only the lines that appear on both files

Character set and Format file conversion
dos2unix filedos.txt fileunix.txt convert a text file format from MSDOS to UNIX
unix2dos fileunix.txt filedos.txt convert a text file format from UNIX to MSDOS
recode ..HTML < page.txt > page.html convert a text file to html
recode -l | more show all available formats conversion
linux commands line v1.1 - LinuxGuide.it
Filesystem Analysis
badblocks -v /dev/hda1 check bad blocks in disk hda1
fsck /dev/hda1 repair / check integrity of linux filesystem on disk hda1
fsck.ext2 /dev/hda1 repair / check integrity of ext2 filesystem on disk hda1
e2fsck /dev/hda1 repair / check integrity of ext2 filesystem on disk hda1
e2fsck -j /dev/hda1 repair / check integrity of ext3 filesystem on disk hda1
fsck.ext3 /dev/hda1 repair / check integrity of ext3 filesystem on disk hda1
fsck.vfat /dev/hda1 repair / check integrity of fat filesystem on disk hda1
fsck.msdos /dev/hda1 repair / check integrity of dos filesystem on disk hda1
dosfsck /dev/hda1 repair / check integrity of dos filesystems on disk hda1

Format a Filesystem
mkfs /dev/hda1 create a filesystem type linux on hda1 partition
mke2fs /dev/hda1 create a filesystem type linux ext2 on hda1 partition
mke2fs -j /dev/hda1 create a filesystem type linux ext3 (journal) on hda1 partition
mkfs -t vfat 32 -F /dev/hda1 create a FAT32 filesystem
fdformat -n /dev/fd0 format a floppy disk
mkswap /dev/hda3 create a swap filesystem

SWAP filesystem
mkswap /dev/hda3 create a swap filesystem
swapon /dev/hda3 activating a new swap partition
swapon /dev/hda2 /dev/hdb3 activate two swap partitions

Backup
dump -0aj -f /tmp/home0.bak /home make a full backup of directory '/home'
dump -1aj -f /tmp/home0.bak /home make a incremental backup of directory '/home'
restore -if /tmp/home0.bak restoring a backup interactively
rsync -rogpav --delete /home /tmp synchronization between directories
rsync -rogpav -e ssh --delete /home ip_address:/tmp rsync via SSH tunnel
rsync -az -e ssh --delete ip_addr:/home/public /home/local synchronize a local directory with a remote directory via ssh and compression
rsync -az -e ssh --delete /home/local ip_addr:/home/public synchronize a remote directory with a local directory via ssh and compression
dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' make a backup of a local hard disk on remote host via ssh
tar -Puf backup.tar /home/user make a incremental backup of directory '/home/user'
( cd /tmp/local/ && tar c . ) | ssh -C user@ip_addr 'cd /home/share/ && tar x
-p' copy content of a directory on remote directory via ssh
( tar c /home ) | ssh -C user@ip_addr 'cd /home/backup-home && tar x -p' copy a local directory on remote directory via ssh
tar cf - . | (cd /tmp/backup ; tar xf - ) local copy preserving permits and links from a directory to another
find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents find and copy all files with '.txt' extention from a directory to another
find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 find all files with '.log' extention and make an bzip archive
dd if=/dev/hda of=/dev/fd0 bs=512 count=1 make a copy of MBR (Master Boot Record) to floppy
dd if=/dev/fd0 of=/dev/hda bs=512 count=1 restore MBR from backup copy saved to floppy

CDROM
cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force clean a rewritable cdrom
mkisofs /dev/cdrom > cd.iso create an iso image of cdrom on disk
mkisofs /dev/cdrom | gzip > cd_iso.gz create a compressed iso image of cdrom on disk
mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd create an iso image of a directory
cdrecord -v dev=/dev/cdrom cd.iso burn an ISO image
gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom - burn a compressed ISO image
mount -o loop cd.iso /mnt/iso mount an ISO image
cd-paranoia -B rip audio tracks from a CD to wav files
cd-paranoia -- "-3" rip first three audio tracks from a CD to wav files
cdrecord --scanbus scan bus to identify the channel scsi

Networking - LAN and WiFi
ifconfig eth0 show configuration of an ethernet network card
ifup eth0 activate an interface 'eth0'
ifdown eth0 disable an interface 'eth0'
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 configure IP Address
ifconfig eth0 promisc configure 'eth0' in promiscuous mode to gather packets (sniffing)
dhclient eth0 active interface 'eth0' in dhcp mode
route -n show routing table
route add -net 0/0 gw IP_Gateway configura default gateway
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 configure static route to reach network '192.168.0.0/16'
route del 0/0 gw IP_gateway remove static route
echo "1" > /proc/sys/net/ipv4/ip_forward activate ip routing
hostname show hostname
host www.linuxguide.it lookup hostname to resolve name to ip address and viceversa
ip link show show link status of all interfaces
mii-tool eth0 show link status of 'eth0'
ethtool eth0 show statistics of network card 'eth0'
netstat -tup show all active network connections and their PID
netstat -tupl show all network services listening on the system and their PID
tcpdump tcp port 80 show all HTTP traffic
iwlist scan show wireless networks
iwconfig eth1 show configuration of a wireless network card
linux commands line v1.1 - LinuxGuide.it
Microsoft Windows networks - SAMBA
nbtscan ip_addr netbios name resolution
nmblookup -A ip_addr netbios name resolution
smbclient -L ip_addr/hostname show remote shares of a windows host
smbget -Rr smb://ip_addr/share like wget can download files from a host windows via smb
mount -t smbfs -o username=user,password=pass //winclient/share /mnt/share mount a windows network share

IPTABLES - firewall
iptables -t filter -L show all chains of filtering table
iptables -t nat -L show all chains of nat table
iptables -t filter -F clear all rules from filtering table
iptables -t nat -F clear all rules from table nat
iptables -t filter -X delete any chains created by user
iptables -t filter -A INPUT -p tcp --dport telnet -j ACCEPT allow telnet connections to input
iptables -t filter -A OUTPUT -p tcp --dport http -j DROP block HTTP connections to output
iptables -t filter -A FORWARD -p tcp --dport pop3 -j ACCEPT allow POP3 connections to forward chain
iptables -t filter -A INPUT -j LOG --log-prefix "DROP INPUT" logging sulla chain di input Logging on chain input
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE configure a PAT (Port Address Traslation) on eth0 masking outbound packets
iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp --dport 22 -j DNAT --to-destination 10.0.0.2:22 redirect packets addressed to a host to another host

Monitoring and debugging
top display linux tasks using most cpu
ps -eafw displays linux tasks
ps -e -o pid,args --forest displays linux tasks in a hierarchical mode
pstree mostra un albero dei processi sistema Shows a tree system processes
kill -9 ID_Processo force closure of the process and finish it
kill -1 ID_Processo force a process to reload configuration
lsof -p $$ display a list of files opened by processes
lsof /home/user1 displays a list of open files in a given path system
strace -c ls >/dev/null display system calls made and received by a process
strace -f -e open ls >/dev/null display library calls
watch -n1 'cat /proc/interrupts' display interrupts in real-time
last reboot show history reboot
lsmod display kernel loaded
free -m displays status of RAM in megabytes
smartctl -A /dev/hda monitoring reliability of a hard-disk through SMART
smartctl -i /dev/hda check if SMART is active on a hard-disk
tail /var/log/dmesg show events inherent to the process of booting kernel
tail /var/log/messages show system events

Other useful commands
apropos ...keyword display a list of commands that pertain to keywords of a program , useful when you know what your program does, but you don't know the name of the command
man ping display the on-line manual pages for example on ping command
whatis ...keyword displays description of what a program does
mkbootdisk --device /dev/fd0 `uname -r` create a boot floppy
gpg -c file1 encrypt a file with GNU Privacy Guard
gpg file1.gpg decrypt a file with GNU Privacy Guard
wget -r www.example.com download an entire web site
wget -c www.example.com/file.iso download a file with the ability to stop the download and resume later
echo 'wget -c www.example.com/files.iso' | at 09:00 start a download at any given time
ldd ssh show shared libraries required by ssh program
alias hh='history' set an alias for a command - hh = history