CentOS 6 (74)

centos ssh puttygen

我也碰到你这样的情况,我开始是成成pub key文件以后再记事本打开,复制的,不能登陆。不过我后来直接从puttygen的界面上的公匙框里面复制到authorized_keys文件里面,就可以登陆了。
Read more...

sort very large file

LC_ALL=C sort -u --buffer-size=2G --temporary-directory=/root/Desktop/tmp --output=joined_sorted.txt joined.txt uniq joined_sorted.txt joined_sorted_uniqed.txt split bigFileName -l 按行分割 wc -l joined.txt split -l 10000000 joined.txt joined_split_ for f in joined_split_*; do sort -u "$f" > "$f"_sorted done sort -u -m joined_split_*_sorted > final.out
Read more...

strace命令

[email protected]:/usr# strace cat /dev/null execve("/bin/cat", ["cat", "/dev/null"], [/* 22 vars */]) = 0 brk(0) = 0xab1000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f29379a7000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) ... brk(0) = 0xab1000 brk(0xad2000) = 0xad2000 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 open("/dev/null", O_RDONLY) = 3 fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0 read(3, "", 32768) = 0 close(3) = 0 close(1) = 0 close(2) = 0 exit_group(0) = ? --- 每一行都是一条系统调用,等号左边是系统调用的函数名及其参数,右边是该调用的返回值。strace 显示这些调用的参数并返回符号形式的值。strace 从内核接收信息,而且不需要以任何特殊的方式来构建内核。 --   -c 统计每一系统调用的所执行的时间,次数和出错的次数等. -d 输出strace关于标准错误的调试信息. -f 跟踪由fork调用所产生的子进程. -ff 如果提供-o…
Read more...

Lexicographically sorting large files in Linux

When I hear the word “sort” my first thought is usually “Hadoop”! Yes, sorting is one thing that Hadoop does well, but if you’re working with large files in Linux the built-in sort command is often all you need. Let’s say you have a large file on a host with 2GB or more of main memory free. The following sort command is a efficient way to lexicographically-order large files. LC_COLLATE=C sort --buffer-size=1G --temporary-directory=./tmp --unique bigfile.txt Let’s break this command down and examine each part in detail.
Read more...

关于”running yum-complete-transaction first” 的提示信息

今天在用yum升级一台新机器时,顾客用ssh远程把server重新启动了。之后,在使用yum 时总是有提示信息: There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.The program yum-complete-transaction is found in the yum-utils package. 意思是,有未完成的yum事务,建议先运行yum-complete-transaction命令清除。 处理步骤: # 安装 yum-complete-transaction yum install yum-utils # 运行 yum-complete-transaction yum-complete-transaction –cleanup-only # 清除可能存在的重复包 package-cleanup –dupes # 清除可能存在的损坏包 package-cleanup –problems
Read more...

ntpq -p输出含义

位置 标志 含义 remote之前 * 响应的NTP服务器和最精确的服务器 + 响应这个查询请求的NTP服务器 blank(空格) 没有响应的NTP服务器 列表上方 remote 响应这个请求的NTP服务器的名称 refid NTP服务器使用的更高一级服务器的名称 st 正在响应请求的NTP服务器的级别 when 上一次成功请求之后到现在的秒数 poll 本地和远程服务器多少时间进行一次同步,单位秒, 在一开始运行NTP的时候这个poll值会比较小,服务器同步的频率大,可以尽快调整到正确的时间范围,之后poll值会逐渐增大,同步的频率也就会相应减小 reach 用来测试能否和服务器连接,是一个八进制值,每成功连接一次它的值就会增加 delay 从本地机发送同步要求到ntp服务器的往返时间 offset 主机通过NTP时钟同步与所同步时间源的时间偏移量,单位为毫秒,offset越接近于0,主机和ntp服务器的时间越接近 jitter 统计了在特定个连续的连接数里offset的分布情况。简单地说这个数值的绝对值越小,主机的时间就越精确
Read more...

awk实例操作学习记录

awk '/^root/ { print }' /etc/passwd 打印以root开头的行 awk是一种编程语言,用于在linux/unix下对文本和数据进行处理。数据可以来自标准输入、一个或多个文件,或其它命令的输出。它支持用户自定义函数和动态正则表达式等先进功能,是linux/unix下的一个强大编程工具。 awk的处理文本和数据的方式是这样的,它逐行扫描文件,从第一行到最后一行,寻找匹配的特定模式的行,并在这些行上进行你想要的操作。如果没有指定处理动作,则把匹配的行显示到标准输出(屏幕),如果没有指定模式,则所有被操作所指定的行都被处理。 例子: 一般语法格式 1.# awk '{ print }' /etc/passwd 或# awk '{ print $0 }' /etc/passwd 马上显示/etc/passwd的内容,其中$0变量表示整个当前行 2.# awk '{ print "william" }' /etc/passwd 或# awk '{ print "" }' /etc/passwd 第一条按照/etc/passwd文件中的行数显示william,第二条则显示空行。 字段 3.# awk -F: '{ print $1 }' /etc/passwd 或# awk -F: '{ print $1 $3 }' /etc/passwd 第一条打印输入文件中每一行中出现的第一个字段,第二条则打印第一和第三字段。其中-F:表示指定“:”作为字段分隔符。 4.# awk -F: '{ print $1 " " $3 }' /etc/passwd # awk -F: '{ print "username: "$1 "\t\tuid: " $3 }' /etc/passwd 例3中输出的结果两个字段之间没有空格,这第一条命令就是加空格,第二条则加了文本标签。 外部脚本 5.# awk -f my.awk /etc/passwd 如果要运行外部的脚本加上-f选项即可,其中my.awk是脚本,/etc/passwd是要操作的文本。 BEGIN和END块 6.BEGIN{ FS=":" 相当于命令行中的-F: } { print $1 } END{…
Read more...

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName解决办法非常简单:#vim /web/apache/conf/httpd.conf (在这里/web/apahce是我安装apache的目录,你默认安装的话应该是/usr/local/apache2/icons)找到#ServerName www.example.com:80 把#去掉,再重启apache即可没事了。现象: bogon:~/webserver/httpd-2.0.59 # /usr/local/apache2/bin/apachectl starthttpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerNamehttpd (pid 20183) already running 這個問題應該是沒有在 /etc/httpd/conf/httpd.conf 中設定 ServerName vi /usr/local/apache2/conf/httpd.conf 最简单的,修改httpd.conf文件,增加:ServerName www.example.com:80我的改为: ServerName www.example.com:80 再次启动就正常了!------------------------------------------------------------------------------------------------------------------------------------------------------------AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this messagehttpd (pid 7907) already running修改:去掉注释即可。# If your host doesn't have a registered DNS name, enter its IP address here.#ServerName www.example.com:8080解决方案:进入apache的安装目录:Windows : D:\Program Files\Apache Software Foundation\Apache2.2\conflinux : /usr/local/apache/conf用记事本打开httpd.conf将里面的#ServerName localhost:80注释去掉即可。再执行httpd然后可以通过浏览器访问http://localhost:80,如果页面显示“It…
Read more...

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category.php on line 191
Call Stack
#TimeMemoryFunctionLocation
10.0003399440{main}( ).../index.php:0
20.02831350304Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.02831350304Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.11492792744Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ).../SiteApplication.php:233
50.11532817160Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_k2', $params = ??? ).../SiteApplication.php:194
60.11582872512Joomla\CMS\Component\ComponentHelper::executeComponent( $path = '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:377
70.11582889568require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php ).../ComponentHelper.php:402
80.11913021808K2ControllerItemlist->execute( $task = 'category' ).../k2.php:64
90.11913021808K2ControllerItemlist->display( $cachable = ???, $urlparams = ??? ).../BaseController.php:710
100.12143045432K2ControllerItemlist->display( $cachable = TRUE, $urlparams = ['limit' => 'UINT', 'limitstart' => 'UINT', 'id' => 'INT', 'tag' => 'STRING', 'searchword' => 'STRING', 'day' => 'INT', 'year' => 'INT', 'month' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'ordering' => 'CMD', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../itemlist.php:49
110.12143045432K2ControllerItemlist->display( $cachable = TRUE, $urlparams = ['limit' => 'UINT', 'limitstart' => 'UINT', 'id' => 'INT', 'tag' => 'STRING', 'searchword' => 'STRING', 'day' => 'INT', 'year' => 'INT', 'month' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'ordering' => 'CMD', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../controller.php:19
120.12203052944Joomla\CMS\Cache\Controller\ViewController->get( $view = class K2ViewItemlist { public $document = class Joomla\CMS\Document\HtmlDocument { public $_links = [...]; public $_custom = [...]; public $template = NULL; public $baseurl = NULL; public $params = NULL; public $_file = NULL; protected $_template = ''; protected $_template_tags = [...]; protected $_caching = NULL; private $_html5 = NULL; public $title = 'CentOS 6'; public $description = ''; public $link = ''; public $base = 'https://www.shan.info/itemlist/category/49-centos-6.html'; public $language = 'en-gb'; public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content Management'; public $_mdate = ''; public $_tab = '\t'; public $_lineEnd = '\n'; public $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = ''; public $_profile = ''; public $_scripts = [...]; public $_script = [...]; protected $scriptOptions = [...]; public $_styleSheets = [...]; public $_style = [...]; public $_metaTags = [...]; public $_engine = NULL; public $_type = 'html'; protected $mediaVersion = '15dbf078d61dbbf76811992dd0143dd9' }; protected $_name = 'itemlist'; protected $_models = ['item' => class K2ModelItem { ... }, 'itemlist' => class K2ModelItemlist { ... }]; protected $_basePath = '/var/www/vhosts/shan.info/httpdocs/components/com_k2'; protected $_defaultModel = 'itemlist'; protected $_layout = 'category'; protected $_layoutExt = 'php'; protected $_layoutTemplate = '_'; protected $_path = ['template' => [...], 'helper' => [...]]; protected $_template = '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category_item.php'; protected $_output = '\n<article class="itemView groupPrimary"> \t\n\t\t<time datetime="2013-05-29T19:03:56+02:00">\n\t\t29 May\t</time>\n\t\t\t\n\t<section>\t\t\n\t\t<header>\n\t\t\t\t\n\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t\t\t\t<a href="/item/475-httpd-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-using-127-0-0-1-for-servername.html">httpd: Could not reliably determine the server&#039;s fully qualified domain name, using 127.0.0.1 for ServerName</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\n\t\t\t<ul>'; protected $_escape = 'htmlspecialchars'; protected $_charset = 'UTF-8'; protected $_errors = []; public $baseurl = ''; public $now = '2021-01-26 21:42:25'; public $nullDate = '0000-00-00 00:00:00'; public $category = class TableK2Category { public $id = '49'; public $name = 'CentOS 6'; public $alias = 'centos-6'; public $description = ''; public $parent = '0'; public $extraFieldsGroup = '0'; public $published = '1'; public $image = '/components/com_k2/images/placeholder/category.png'; public $access = '1'; public $ordering = '6'; public $params = '{"inheritFrom":"59","theme":"","num_leading_items":"0","num_leading_columns":"1","leadingImgSize":"Large","num_primary_items":"10","num_primary_columns":"1","primaryImgSize":"Medium","num_secondary_items":"0","num_secondary_columns":"1","secondaryImgSize":"Small","num_links":"0","num_links_columns":"1","linksImgSize":"XSmall","catCatalogMode":"0","catFeaturedItems":"1","catOrdering":"","catPagination":"2","catPaginationResults":"1","catTitle":"1","catTitleItemCounter":"1","catDescription":"0","catImage":"0"'; public $trash = '0'; public $plugins = ''; public $language = '*'; protected $_tbl = '#__k2_categories'; protected $_tbl_key = 'id'; protected $_tbl_keys = [...]; protected $_db = class JDatabaseDriverMysqli { ... }; protected $_trackAssets = FALSE; protected $_rules = NULL; protected $_locked = FALSE; protected $_autoincrement = TRUE; protected $_observers = class JObserverUpdater { ... }; protected $_columnAlias = [...]; protected $_jsonEncode = [...]; protected $_errors = [...]; public $metaDescription = NULL; public $metaKeywords = NULL; public $metaRobots = NULL; public $metaAuthor = NULL; public $link = '/itemlist/category/49-centos-6.html'; public $text = ''; public $jcfields = [...]; public $event = class stdClass { ... } }; public $user = class Joomla\CMS\User\User { protected $isRoot = FALSE; public $id = 0; public $name = NULL; public $username = NULL; public $email = NULL; public $password = NULL; public $password_clear = ''; public $block = NULL; public $sendEmail = 0; public $registerDate = NULL; public $lastvisitDate = NULL; public $activation = NULL; public $params = NULL; public $groups = [...]; public $guest = 1; public $lastResetTime = NULL; public $resetCount = NULL; public $requireReset = NULL; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = NULL; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $userHelper = class Joomla\CMS\User\UserWrapper { ... }; protected $_errors = [...]; public $aid = 0; public $gid = 1 }; public $feed = 'https://www.shan.info/itemlist/category/49-centos-6.html?start=20&format=feed&Itemid=53'; public $leading = []; public $primary = [0 => class stdClass { ... }, 1 => class stdClass { ... }, 2 => class stdClass { ... }, 3 => class stdClass { ... }, 4 => class stdClass { ... }, 5 => class stdClass { ... }, 6 => class stdClass { ... }, 7 => class stdClass { ... }, 8 => class stdClass { ... }, 9 => class stdClass { ... }]; public $secondary = []; public $links = []; public $params = class Joomla\Registry\Registry { protected $data = class stdClass { ... }; protected $initialized = TRUE; public $separator = '.' }; public $pagination = class Joomla\CMS\Pagination\Pagination { public $limitstart = 20; public $limit = 10; public $total = 74; public $prefix = ''; public $pagesStart = 1; public $pagesStop = 8; public $pagesCurrent = 3; public $pagesTotal = 8; public $hideEmptyLimitstart = FALSE; protected $viewall = FALSE; protected $additionalUrlParams = [...]; protected $app = class Joomla\CMS\Application\SiteApplication { ... }; protected $data = NULL }; public $item = class stdClass { public $id = '475'; public $title = 'httpd: Could not reliably determine the server&#039;s fully qualified domain name, using 127.0.0.1 for ServerName'; public $alias = 'httpd-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-using-127-0-0-1-for-servername'; public $catid = '49'; public $published = '1'; public $introtext = 'httpd: Could not reliably determine the server\'s fully qualified domain name, using 127.0.0.1 for ServerName解决办法非常简单:#vim /web/apache/conf/httpd.conf (在这里/web/apahce是我安装apache的目录,你默认安装的话应该是/usr/local/apache2/icons)找到#ServerName www.example.com:80 把#去掉,再重启apache即可没事了。现象: bogon:~/webserver/httpd-2.0.59 # /usr/local/apache2/bin/apachectl starthttpd: Could not determine the server\'s fully qualified domain name, usi'; public $fulltext = ''; public $video = NULL; public $gallery = NULL; public $extra_fields = '[]'; public $extra_fields_search = ''; public $created = '2013-05-29 17:03:56'; public $created_by = '63'; public $created_by_alias = ''; public $checked_out = '0'; public $checked_out_time = '0000-00-00 00:00:00'; public $modified = '0000-00-00 00:00:00'; public $modified_by = '0'; public $publish_up = '2013-05-29 17:03:56'; public $publish_down = '0000-00-00 00:00:00'; public $trash = '0'; public $access = '1'; public $ordering = '44'; public $featured = '0'; public $featured_ordering = '0'; public $image_caption = ''; public $image_credits = ''; public $video_caption = ''; public $video_credits = ''; public $hits = '1482'; public $params = class Joomla\Registry\Registry { ... }; public $metadesc = ''; public $metadata = 'robots=\nauthor='; public $metakey = ''; public $plugins = ''; public $language = '*'; public $categoryname = 'CentOS 6'; public $categoryid = '49'; public $categoryalias = 'centos-6'; public $categoryparams = '{"inheritFrom":"59","theme":"","num_leading_items":"0","num_leading_columns":"1","leadingImgSize":"Large","num_primary_items":"10","num_primary_columns":"1","primaryImgSize":"Medium","num_secondary_items":"0","num_secondary_columns":"1","secondaryImgSize":"Small","num_links":"0","num_links_columns":"1","linksImgSize":"XSmall","catCatalogMode":"0","catFeaturedItems":"1","catOrdering":"","catPagination":"2","catPaginationResults":"1","catTitle":"1","catTitleItemCounter":"1","catDescription":"0","catImage":"0"'; public $itemGroup = 'primary'; public $category = class TableK2Category { ... }; public $link = '/item/475-httpd-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-using-127-0-0-1-for-servername.html'; public $printLink = '/item/475-httpd-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-using-127-0-0-1-for-servername.html?tmpl=component&amp;print=1'; public $tags = [...]; public $imageXSmall = ''; public $imageSmall = ''; public $imageMedium = ''; public $imageLarge = ''; public $imageXLarge = ''; public $rawTitle = 'httpd: Could not reliably determine the server\'s fully qualified domain name, using 127.0.0.1 for ServerName'; public $author = class Joomla\CMS\User\User { ... }; public $text = 'httpd: Could not reliably determine the server\'s fully qualified domain name, using 127.0.0.1 for ServerName解决办法非常简单:#vim /web/apache/conf/httpd.conf (在这里/web/apahce是我安装apache的目录,你默认安装的话应该是/usr/local/apache2/icons)找到#ServerName www.example.com:80 把#去掉,再重启apache即可没事了。现象: bogon:~/webserver/httpd-2.0.59 # /usr/local/apache2/bin/apachectl starthttpd: Could not determine the server\'s fully qualified domain name, usi'; public $event = class stdClass { ... }; public $jcfields = [...]; public $image = ''; public $imageWidth = '400' } }, $method = 'display', $id = ???, $wrkarounds = ??? ).../BaseController.php:663
130.12363073632K2ViewItemlist->display( $tpl = ??? ).../ViewController.php:102
140.18554122648K2ViewItemlist->display( $tpl = NULL ).../view.html.php:1407
150.18554122648K2ViewItemlist->loadTemplate( $tpl = NULL ).../HtmlView.php:230
160.18614199472include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category.php ).../HtmlView.php:701