一

{"type":"编程笔记"}


  • Home

  • Archives
  • Search

table for 16-color terminal escape sequences

Posted on 2007-06-03   |   In linux

linux terminal中可控制文字的显示颜色,包括8个前景色,8个背景色和字体粗细:

#!/bin/bash# prints a color table of 8bg * 8fg * 2 states (regular/bold)echoecho Table for 16-color terminal escape sequences.echo Replace ESC with \\033 in bash.echoecho "Background | Foreground colors"echo "---------------------------------------------------------------------"for((bg=40;bg<=47;bg++)); do for((bold=0;bold<=1;bold++)) do  echo -en "\033[0m"" ESC[${bg}m   | "  for((fg=30;fg<=37;fg++)); do   if [ $bold == "0" ]; then    echo -en "\033[${bg}m\033[${fg}m [${fg}m  "   else    echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m"   fi  done  echo -e "\033[0m" done echo "--------------------------------------------------------------------- "doneechoecho

以上脚本运行后会输出以下结果,横向的 8 个颜色是前景色([30m - [37m),并且有一个1;前缀表示为粗体,没有这个前缀就是正常大小字体,纵向的 8 个颜色是背景色([40m - [47m),[0m表示重置设置:

Read more »

ubuntu-7.04下安装mysql-ruby及dbi-ruby

Posted on 2007-05-28   |   In ruby

在ubuntu中使用apt-get安装ruby的mysql包:

Read more »

mysql load apache2 logs

Posted on 2007-05-27   |   In mysql

可以将apache2日志文件写入mysql数据库表。你可以将以下内容放到apache2配置文件中,更改apache2日志格式,使mysql更容易读取:

Read more »

useful shell command history shortcuts

Posted on 2007-05-27   |   In linux

Reuse previous arguments

The ! operator gives you a quick way to refer to parts of the previous command.

!! (Full contents of previous command)

Read more »

mysqld_safe 启动选项文件使用说明

Posted on 2007-05-26   |   In mysql

--defaults-file=FILE Use the specified defaults file, 如果给出,必须首选该选项。

--defaults-extra-file=FILE Also use defaults from the specified file, 如果给出,必须首选该选项。

执行mysqld_safe时,后面参数必须先给出--defaults-file或--defaults-extra-file,否则选项文件不生效。例如,该命令将不使用选项文件,这个指定的配置文件就没有生效:

 mysqld_safe --port=port_num --defaults-file=file_name

相反,使用下面的命令,则选项文件生效:

 mysqld_safe --defaults-file=file_name --port=port_num
1…949596…99
yuweijun

yuweijun

492 posts
12 categories
RSS
GitHub Twitter
© 2021 yuweijun
Powered by Hexo
Theme - NexT.Mist.KISS