Category Archives: freebsd

vi usage

Modes of Operation vi, the Unix visual editor, has two modes of operation: Command mode–This is vi’s initial and normal state. In this mode, most commands you type are not displayed. Only commands preceded by :, /, or ! are … Continue reading

Stop PHP nobody Spammers

Stop PHP nobody Spammers http://www.webhostgear.com/232.html Update: May 25, 2005: – Added Logrotation details – Added Sample Log Output PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail … Continue reading

service restart

location: /etc/init.d/mysql start|stop exim Turn off exim while we do this so it doesn’t freak out. /etc/init.d/exim stop ? How about httpd?

增加内存表的使用空间

如何增加内存表的使用空间 this is how to change it with my.cnf /usr/local/mysql/bin/mysqld_safe –user=mysql    -O max_heap_table_size=320M  & 默认的是16M,可以根据自己的需要,增加到需要的大小

mstring installed as a port under FreeBSD

{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\nowidctlpar\fi-4800\li4800\b\f0\fs20  Main >> Installing port in /usr/ports/converters/php5-mbstring\par \par Installing port in /usr/ports/converters/php5-mbstring\par ===>  Vulnerability check disabled, database not found\par => php-5.2.6.tar.bz2 doesn’t seem to exist in /usr/ports/distfiles/.\par => Attempting to fetch from http://br.php.net/distributions/.\par php-5.2.6.tar.bz2                                     … Continue reading

exim

Main >> DNS Functions >> Edit MX Entry /var/spool/exim/msglog/6 Current MX Entries Domain   MX Entry Always Accept hobid.com  0 hobid.com Delete 20 alt1.aspmx.l.google.com Delete No Set To Yes Main >> Service Configuration >> Exim Configuration Editor Exim Configuration Editor Configuration … Continue reading

Shell中的grep、awk和sed的常用命令和语法

Grep的常用命令语法1. 双引号引用和单引号引用 在g r e p命令中输入字符串参数时,最好将其用双引号括起来。例如:”m y s t r i n g”。这样做有两个原因,一是以防被误解为 s h e l l命令,二是可以用来查找多个单词组成的字符串,例如:”jet plane”,如果不用双引号将其括起来,那么单词 p l a n e将被误认为是一个文件,查询结果将返回”文件不存在”的错误信息。 在调用变量时,也应该使用双引号,诸如: g r e p”$ M Y VA R”文件名,如果不这样,将 没有返回结果。 在调用模式匹配时,应使用单引号.[root@mypc ]# echo `grep 123 111.txt`  … Continue reading

List All Unix Users

List All Unix Users To list all users on a Unix system, even the ones who are not logged in, look at the /etc/password file. $ cat /etc/passwd … george:*:1009:1009:George Washington:/home/george:/usr/bin/bash tom:*:1016:1016:Thomas Jefferson:/home/tom:/usr/bin/bash al:*:1017:1017:Alexander Hamilton:/home/alex:/usr/bin/bash … You can use the … Continue reading

unix command

LIST OF COMMON COMMANDS Name Manual Page Description alias csh(1) Create an alias for a command sequence, see csh(1) apropos apropos(1) locate commands by keyword lookup banner banner(1V) display a string in large letters bc bc(1) arbitrary-precision arithmetic language bg … Continue reading

Freebsd下字符串的查找替换

在Freebsd下我们常常要进行字符串的查找替换,有在vim编辑器里面进 行的,也有在shell下进行的,这样的事情常遇到,但是每次都会感到有些概念模糊,尤其对类似awk、sed、grep、find等命令的具体参数使用 问题上老是糊涂,下面收集几个常用的方法,实在不能理解就死记算了!1、在vi中使用的查找替换方法 利用 :s 命令可以实现字符串的替换。具体的用法包括: :s/str1/str2/ 用字符串 str2 替换行中首次出现的字符串 str1 :s/str1/str2/g 用字符串 str2 替换行中所有出现的字符串 str1 :.,$ s/str1/str2/g 用字符串 str2 替换正文当前行到末尾所有出现的字符串 str1 :1,$ s/str1/str2/g 用字符串 str2 替换正文中所有出现的字符串 str1 :g/str1/s//str2/g 功能同上从上述替换命令可以看到:g 放在命令末尾,表示对搜索字符串的每次出现进行替换;不加 g,表示只对搜索字符串的首次出现进行替换;g 放在命令开头,表示对正文中所有包含搜索字符串的行进行替换操作。 2、在shell中使用find结合grep进行文件的替换 # find ./ -exec grep str1 … Continue reading