<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux-2 | Hessian's Blog</title><link>https://hessian.cn/tag/linux-2</link><description>Hessian 的技术笔记：Linux、C++、网络与嵌入式</description><language>zh-CN</language><atom:link href="https://hessian.cn/tag/linux-2/index.xml" rel="self" type="application/rss+xml"/><item><title>解决阿里云postfix邮件发不出去的问题</title><link>https://hessian.cn/p/1450.html</link><pubDate>Tue, 24 Jun 2014 19:04:27 +0800</pubDate><guid>https://hessian.cn/p/1450.html</guid><description>执行mail输出错误信息&#10;sendmail: fatal: parameter inet_interfaces: no local interface found for ::1 原因是神马给忘了，记得是跟IPv6有关，解决办法就是让postfix只用IPv4。&#10;打开文件：/etc/postfix/main.cf&#10;把&#10;inet_protocols = all 改成&#10;inet_protocols = ipv4 完了之后执行&#10;service postfix restart</description></item><item><title>CentOS + Cacti 集中监控服务器 （笔记）</title><link>https://hessian.cn/p/1411.html</link><pubDate>Wed, 15 Jan 2014 06:44:42 +0800</pubDate><guid>https://hessian.cn/p/1411.html</guid><description>Cacti官方网站&#10;官方文档——Installing Under Unix&#10;Percona Monitoring Plugins （Plugins for Cacti）&#10;Percona 为我们提供了很多包括linux,apache,mysql,redis,nginx等等常见服务的监控模板非常方便。&#10;下载地址 | 官方文档&#10;</description></item><item><title>CentOS 6.4 openvpn服务器搭建笔记</title><link>https://hessian.cn/p/1386.html</link><pubDate>Wed, 15 Jan 2014 06:24:26 +0800</pubDate><guid>https://hessian.cn/p/1386.html</guid><description>OpenVPN 源代码、安装包下载地址&#10;官方安装手册&#10;官方easy-rsa3 github&#10;1. 安装openvpn、easy-rsa&#10;yum install openvpn easy-rsa&#10;easy-rsa是生成秘钥用的一系列脚本集合。openvpn2.3版之后程序包里不再捆绑，需要单独安装，官方2.3版本的easy-rsa3改动比较&#10;大，网上也很少有用easy-rsa3的文章，为了避免麻烦，直接装源里的easy-rsa就好了。&#10;</description></item><item><title>在Windows/Linux下让程序指定出口IP地址</title><link>https://hessian.cn/p/1378.html</link><pubDate>Fri, 18 Oct 2013 01:43:00 +0800</pubDate><guid>https://hessian.cn/p/1378.html</guid><description>Windows/Unix* 系统都支持为一个网卡绑定多个IP地址，但是通常操作系统会根据路由表自动选择IP地址，应用程序使用哪个IP地址用户无法主动控制。本文分别讲解在Linux和Windows下为应用程序绑定指定IP地址的方法。&#10;</description></item><item><title>CentOS Linux 6 NFS 配置</title><link>https://hessian.cn/p/1360.html</link><pubDate>Tue, 17 Sep 2013 20:34:40 +0800</pubDate><guid>https://hessian.cn/p/1360.html</guid><description>yum install nfs nfs-utils rpcbind&#13;service rpcbind start&#13;chckonfig rpcbind on&#13;cat "/shared_dir 192.168.1.200(rw,async,all_squash,anonuid=500,anongid=500)" &gt; /etc/exports 參數 參數功能 預設參數 fg&#10;bg 當執行掛載時，該掛載的行為會在前景 (fg) 還是在背景 (bg) 執行？ 若在前景執行時，則 mount 會持續嘗試掛載，直到成功或 time out 為止，若為背景執行， 則 mount 會在背景持續多次進行 mount ，而不會影響到前景的程序操作。 如果你的網路連線有點不穩定，或是伺服器常常需要開關機，那建議使用 bg 比較妥當。 fg soft&#10;hard 如果是 hard 的情況，則當兩者之間有任何一部主機離線，則 RPC 會持續的呼叫，直到對方恢復連線為止。如果是 soft 的話，那 RPC 會在 time out 後『重複』呼叫，而非『持續』呼叫， 因此系統的延遲會比較不這麼明顯。同上，如果你的伺服器可能開開關關，建議用 soft 喔！ hard intr 當你使用上頭提到的 hard 方式掛載時，若加上 intr 這個參數， 則當 RPC 持續呼叫中，該次的呼叫是可以被中斷的 (interrupted)。 沒有 rsize&#10;wsize 讀出(rsize)與寫入(wsize)的區塊大小 (block size)。 這個設定值可以影響用戶端與伺服器端傳輸資料的緩衝記憶容量。一般來說， 如果在區域網路內 (LAN) ，並且用戶端與伺服器端都具有足夠的記憶體，那這個值可以設定大一點， 比如說 32768 (bytes) 等，提升緩衝記憶區塊將可提升 NFS 檔案系統的傳輸能力！ 但要注意設定的值也不要太大，最好是達到網路能夠傳輸的最大值為限。 rsize=1024&#10;wsize=1024 mount -t nfs -o bg,soft,rsize=32768,wsize=32768 192.168.1.100:/shared_dir /mount_point Mac系统下挂载NFS有一点特别，需要加几个参数&#10;不加resvport在mac下会挂载不了，不加nolockd的话给文件加锁的时候会提示nfs server lockd not responding&#10;</description></item><item><title>强大的 轻量级 Linux服务器监控系统 Monitorix</title><link>https://hessian.cn/p/1348.html</link><pubDate>Thu, 12 Sep 2013 01:16:49 +0800</pubDate><guid>https://hessian.cn/p/1348.html</guid><description>Monitorix 是一个开源的、轻量的 Linux/Unix 服务器监控工具。安装配置简单，图表功能丰富。&#10;官方网站：http://www.monitorix.org&#10;安装方法：&#10;# perl-HTTP-Server-Simple 需要从EPEL安装&#13;rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm&#13;# 安装依赖&#13;yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple&#13;# 安装Monitorix&#13;yum install monitorix&#13;# 启动服务&#13;service monitorix start 博主最近要监控一台线上服务器，用cacti又嫌太麻烦，在看了《比cacti更好的linux单机监控——Monitorix的安装与配置》 之后决定采用Monitorix。&#10;</description></item><item><title>你可能不知道的Shell | 酷壳 – CoolShell.cn</title><link>https://hessian.cn/p/1054.html</link><pubDate>Fri, 23 Nov 2012 09:08:18 +0800</pubDate><guid>https://hessian.cn/p/1054.html</guid><description>via 你可能不知道的Shell | 酷壳 – CoolShell.cn.&#10; &#10;Shell也叫做命令行界面，它是*nix操作系统下用户和计算机的交互界面。Shell这个词是指操作系统中提供访问内核服务的程序。&#10;</description></item><item><title>CentOS 6.2（RHEL6）高可用服务器环境搭建</title><link>https://hessian.cn/p/961.html</link><pubDate>Fri, 25 May 2012 16:32:44 +0800</pubDate><guid>https://hessian.cn/p/961.html</guid><description>目标 为四台新服务器部署MySQL、Coreseek、Redis、MongoDB、NFS、Varnish等服务。四台服务器分为两组、使用Linux-HA + Pacemaker 实现高可用（HA, High-Availablility）。&#10;</description></item><item><title>解决fcitx 4.1 选择候选词后输入框消失的问题</title><link>https://hessian.cn/p/165.html</link><pubDate>Wed, 07 Sep 2011 18:42:45 +0800</pubDate><guid>https://hessian.cn/p/165.html</guid><description>fcitx更新到4.0之后我就一直在用fcitx，但是自2011年9月5日更新到4.1.0-1之后，很多候选词就无法上屏了，尤其是当候选词是处在第二页的时候。具体表现为当选择一个无法输入的词时输入框就会消失。后来我把这个问题报给了fcitx的开发人员，以下贴上问题解决的过程。&#10;</description></item><item><title>WEB开发的福音阿，再也不用为频繁切换host苦恼了</title><link>https://hessian.cn/p/131.html</link><pubDate>Tue, 06 Sep 2011 15:32:36 +0800</pubDate><guid>https://hessian.cn/p/131.html</guid><description>刚刚发现一个霸气的 Firefox 插件 HostAdmin，地址在下面有&#10;https://addons.mozilla.org/zh-CN/firefox/addon/hostadmin/&#10;这个插件可以分析你的hosts文件，自动在firefox中提供给你选择你需要指向的IP地址，你也可以手工修改hosts文件，安装了这个插件之后hosts的修改是实时生效的。&#10;</description></item><item><title>[转]Linux 中的键盘映射</title><link>https://hessian.cn/p/144.html</link><pubDate>Tue, 23 Aug 2011 00:17:42 +0800</pubDate><guid>https://hessian.cn/p/144.html</guid><description> 原文地址：http://www.linuxidc.com/Linux/2011-04/35197.htm&#10; &#10;对于英语来说，键盘上的字母键直接和英语字母表中的字母对应，但是对于非英语的语种来说，情况就不太一样了。例如，德语中的“ß”字母就没有直接的键和它对应，为此，Linux 提供“键盘映射”或“键盘翻译”，利用键盘映射可将某些键转换为特殊键。&#10;前面提到，X Window 直接处理了键盘的输入输出端口，因此，在 Linux 虚拟控制台下和 X Window 下使用不同的键盘映射方法。在 Linux 虚拟控制台上，可利用 loadkeys 命令将特殊按键映射为特殊字符；而在 X Window 中，必须使用 xmodmap 命令完成键盘映射。这些命令均按照字符映射表文件（文本文件）中的规定完成相应的转换。在 X Window 启动时，它会参考 Linux 文本模式下的字符映射表，因此可获得某些一致的键映射。&#10;字符映射表文件保存在 /usr/lib/kbd/keytables 目录下，defkeymap.map 是默认的字符映射表文件。利用命令：&#10;$ loadkeys fr.map 可装入 fr.map 所规定的字符映射表。这时，按下“.”会显示“:”。命令&#10;$ loadkeys –d 可装入默认字符映射表。对于非默认的键盘映射，可在启动时在 shell 脚本中装入特殊的映射表。&#10;对X Window 而言，它对键盘的处理过程分如下两个步骤：&#10;1．X Server 首先将键码转换为键符号名（keysym）。文件 /usr/include/X11/keysymdef.h 中包含所有的符号名。X Server 能够区分修饰键带来的不同，因为 keysymdef.h 中区分了两种不同的键，例如对“a”和“A”，分别用“KS_a”和“KS_A”定义。&#10;2．X Server 将键符号翻译为 ASCII 字符串。对于大多数的键来说，该字符串只包含一个字符，而对于功能键等特殊按键来说，则包含多个字符。例如，F5 键对应的默认 ASCII 字符串为 “5~”。&#10;利用 xmodmap 工具可修改键盘和键符号名之间的对应关系。例如，X Window 中“A”的键码为 30，而“Q”的键码为16。如果建立文件 maptest：&#10;keycode 38 = A&#13;keycode 24 = Q 在 xterm 中运行&#10;$ xmodmap maptest 之后，将发现“A”键和“Q”键交换了过来。&#10;上述的 maptest 文件实际就是一个简单的 X Window 映射文件。但需要注意的是，文件中的 keycode 和 Linux 内核对键值的定义是不一样的，一般而言，X Window 中的键码要比内核的键值大 8。利用 showkey 命令可以查看内核对键值的定义。例如，运行 showkey 并前后按下“A”和“Q”后，程序的输出为：&#10;$ showkey&#13;kb mode was RAW&#13;...&#13;keycode 30 press&#13;keycode 30 press&#13;keycode 16 press&#13;keycode 16 press 该程序给出的是“A”和“Q”的内核键值。&#10;在 XF86Config 文件中，Keyboard 段用来指定键盘参数，一般而言，这些参数不需要特殊设置：&#10;Section “Keyboard”&#13;Protocol “Standard”&#13;AutoRepeat 500 5&#13;EndSection</description></item><item><title>[译]如何在Linux下禁用键盘、触摸板、鼠标等输入设备</title><link>https://hessian.cn/p/139.html</link><pubDate>Mon, 22 Aug 2011 10:14:46 +0800</pubDate><guid>https://hessian.cn/p/139.html</guid><description>原文地址：http://blog.yjl.im/2010/12/using-xinput-to-disable-keyboard-mouse.html&#10;</description></item><item><title>Arch Linux + Wine运行RTX / QQ</title><link>https://hessian.cn/p/129.html</link><pubDate>Thu, 18 Aug 2011 15:35:24 +0800</pubDate><guid>https://hessian.cn/p/129.html</guid><description>最近被客户要求用RTX沟通，我又懒得开虚拟机，想到以前就有人用WINE 运行过QQ，应该RTX也可以运行才对就到网上搜索了一下。&#10;最后找到这篇帖子：http://www.php-oa.com/2011/01/06/linux-wine-rtx.html&#10;</description></item><item><title>Archlinux 环境配置记录</title><link>https://hessian.cn/p/121.html</link><pubDate>Wed, 10 Aug 2011 17:10:08 +0800</pubDate><guid>https://hessian.cn/p/121.html</guid><description>Archlinux+Openbox+Bmpanel2&#10;Window Manager = Openbox&#10;http://openbox.org/&#10;Desktop Background = Habak&#10;Performace Monitor = Conky&#10;http://conky.sourceforge.net/&#10;Panel = Bmpanel2&#10;http://code.google.com/p/bmpanel2/&#10;Panel-Calendar = Gsimplecal&#10;http://code.google.com/p/gsimplecal/&#10;Volume Control = Volumeicon&#10;http://softwarebakery.com/maato/volumeicon.html&#10;NetworkManager = NetworkManager + nm-applet&#10;http://projects.gnome.org/NetworkManager/?x=22&#10;FileManager = PcManFM&#10;http://pcmanfm.sourceforge.net/&#10;现在用着感觉用pcmanfm做桌面还是不太爽，于是改用了xfce4的桌面，xfdesktop，但是用这个的话file manager也得换成thunar。。。&#10;</description></item></channel></rss>