- 博客(52)
- 资源 (4)
- 收藏
- 关注
原创 拯救崩溃的系统
最近遭遇到虚机遇到存储故障导致操作系统损坏无法进入系统。 这种情况如果虚机里面没什么重要的东西就懒得去折腾修复了。但这次不同,里面有非常重要的数据。所以必须想办法搞定。症状是开机系统提示有错误需要修复,可以进入修复菜单。 这时如果这台机器之前有过镜像备份可以直接恢复,如果只是磁盘受损也可以尝试通过checkdisk命令行工具修复。但我既没有镜像备份,修复硬盘也无果。 尝试正常进入系统的
2016-04-21 11:03:21
864
原创 找出数据库中size最大的表
select object_name(b.object_id)TableName, sum(a.total_pages)TotalPages, Sum(a.total_pages)*8/1024Size_MB, Sum(a.total_pages)*8/1024/1024Size_GBfrom sys.system_interna
2013-10-08 16:55:21
1372
原创 OSSEC Monitor your App log file
OSSEC monitors system logs with build-in support, and does a good job. Don't forget OSSEC is also can monitor the custom log file like our app's log. You have to create your own decoder and rule for that.
2013-08-22 10:24:17
1339
原创 OSSEC installation guide
SSEC is an Open Source Host-based Intrusion Detection System. It performs log analysis, integrity checking, Windows registry monitoring, rootkit detection, real-time alerting and active response. It r
2013-08-21 14:03:08
1188
转载 Linux后台进程管理利器:supervisor
Linux的后台进程运行有好几种方法,例如nohup,screen等,但是,如果是一个服务程序,要可靠地在后台运行,我们就需要把它做成daemon,最好还能监控进程状态,在意外结束时能自动重启。supervisor就是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启。安装supervisorDeb
2013-07-22 17:52:40
1276
转载 Python lib "Fabric"
Fabric官方参考文档:http://docs.fabfile.org/en/1.6/以前一直用rsync同步代码到服务器,这种山寨方法用一次两次还可,每天部署10次就麻烦了,最近抽空研究了一下Fabric,发现这个东西部署起来简直太爽了。Fabric是一个用Python开发的部署工具,最大特点是不用登录远程服务器,在本地运行远程命令,几行Python脚本就可以轻松部署。
2013-07-22 17:26:07
1402
原创 How to install Cacti on Ubuntu
Installation prerequisiteThe following packages are required to run Cacti properlyApache2# apt-get install apache2# apt-get install php5 php5-cli php5-mysql php5-snmpMYSQL# apt-get
2013-05-22 21:39:17
1279
转载 Puppet Installation Guide on Ubuntu12.04
Pre-InstallOS/Ruby Version· See the supported platforms guide.· If your OS is older than the supported versions, you may still be able to run Puppet if you install an updated ver
2013-05-22 17:11:40
1079
转载 Time Management Hacks I wish I'd known at 20
几天前在 Slideshare 上看到 Etienne Garbugli 的一个关于时间管理的幻灯片,觉得挺不错,值得分享。另外由于 Slideshare 被墙,顺带保存分享到墙内。如果译文有不到位的地方,烦请指出,谢谢。01. There is alway time. Time is priorities. 时间常有。时间优先。02. Days always fi
2013-04-29 21:42:46
1533
转载 Powershell: Get Content Faster with ReadCount!
Do you use Powershell? Do you use Get-Content in Powershell to read files? Do you sometimes work with large text files?If you answered yes to any of the questions above, then read on - this po
2013-04-28 11:28:20
1492
原创 How to change CentOS IP address on a cloned VM
I cloned a CentOS VM(wmware) but couldn't bring the network up, it said "device eth0 does not seem to be present, delaying initialization".It turns out that the NIC on the cloned VM was being re
2013-04-24 17:26:09
1373
转载 【系统工程师的自我修养】sed篇
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/注:本文除特殊注明外均针对传统UNIX中的sed,而非GNU的版本,以保证通用性,GNU的新特性本文暂不进行介绍,请参看手册。另外,本文对sed的讲述和总结不为求全面,只求实用性和适用性强。有需要还是参阅man手册和sed相关资料。1.原理篇掌握这个东西首先需要掌握的就是原理,否则一切
2013-02-20 22:17:35
941
原创 Erlang IDE NotePad++
NotePad++是个全能王,简单的文本编辑都可轻松上手,当然复杂项目可能会力不从心。不过本着学习新语言的练习目的这个还是非常合适大家使用的。尽管NotePad++默认支持了很多语言的语法高亮,但这次的Erlang没在默认列表里面,不过没关系,网上针对NotePad++的语言列表大把的有。http://sourceforge.net/apps/mediawiki/notepad-plus/
2013-02-03 00:22:04
3905
转载 Erlang入门第一课《我的执行目录在哪?》
在目前网络上许多的Erlang基础教程中都提到类似下面的一个例子:-module(tut).-export([double/1]).double(X) -> 2 * X.然后在Erlang Shell中进行编译tut.erl源文件:1> c(tut). 但对于一个刚刚接触到Erlang的初学者来说,经常会发生如下的错误:./tut
2013-02-02 23:38:32
1441
原创 MongoDB 基本操作尝试
# start mongo db>mongo# list data base>show dbs# use db>use adv_pms_development # show all collections(tables) in current db.>show collections# list all elements in 'projects' table>db.pr
2013-01-09 11:08:32
736
转载 Datastore Provisioned Space vs Free Space
Last week I was asked by a customer which datastore would be the best location for a new virtual machine. They asked because while all of their datastores were showing plenty of free space they rememb
2012-12-27 15:18:57
1085
原创 不同操作系统下的“回车(CR)” and "换行(LF)"
遇到的问题是在windows编辑的配置文件,放到Linux上面就解析出错。这种错误光靠肉眼真是很难看出端倪。 于是想到Windows和Unix文件格式的区别,其中一个就是回车和换行在两种平台下的区别。于是乎用Notepad++ 打开文件查看,发现windwos下编辑的文件结尾是CRLF, Linux下面只是LF. 这事才恍然大悟:WINDOWS下, 以为行尾的标志.
2012-12-04 10:37:36
1186
转载 谈谈离职和跳槽
这篇文章是我在部门会议上一次发言的总结。之所以会有这次会议,是因为我的一名员工向我提出了辞职,在思索了几天后,我整理了一下自己的思路,于是便有了这次的会议和现在的这篇文章。收入是由什么决定的?这位员工辞职的原因主要有两个:公司的薪水无法达到他的预期,未来一年在公司的收入前景也不是很明确。想要去做更底层的开发,方向是使用C/C++开发3D图形图像。而我们公司主要是.NET开发
2012-11-24 23:49:30
740
转载 5 Linux Touch Command Examples (How to Change File Timestamp)
Every file in Linux is associated with timestamps, which specifies the last access time, last modification time and last change time.Whenever we create a new file, or modify an existing file or it
2012-11-22 15:50:47
979
转载 RAID 2, RAID 3, RAID 4, RAID 6 Explained with Diagram
In most critical production servers, you will be using either RAID 5 or RAID 10.However there are several non-standard raids, which are not used except in some rare situations. It is good to kno
2012-11-22 15:49:29
1261
转载 RAID 0, RAID 1, RAID 5, RAID 10 Explained with Diagrams
RAID stands for Redundant Array of Inexpensive (Independent) Disks.On most situations you will be using one of the following four levels of RAIDs.RAID 0RAID 1RAID 5RAID 10 (also known as RAID
2012-11-22 15:47:50
793
原创 Linux CRON Best Practice
手头有个Node.js的web应用,host在linux主机上。刚开发完遇到个小问题,系统bug比较多经常不经意间操作,整个应该就crash了,还得手动重新启动node应用。当然这主要原因是我们的错误处理机制没完善,这事接下来的任务,当务之急是想写个小程序检测node应用,发现crash立马再次重启应用。这样给用户的体验会好些。立马想到了Linux下单Cron,类似windows下面的
2012-11-02 16:52:31
737
转载 Corrupted esx.conf file prevents network settings from displaying
Corrupted esx.conf file prevents network settings from displayingSymptomsThe command esxcfg-vswitch -l does not always produce any output.The file /etc/vmware/esx.conf is corrupted; it is
2012-10-25 16:33:11
1091
原创 How to remove orphan virtual switch on ESXi host
If you use WMware ESXi product to manage all your virtual resources. you may met this issue. The scenario like below:Some bad things happened on your host, and esx.conf file maybe corrupted a
2012-10-25 16:24:04
798
原创 The Secret of String Formating
One of the great features of PowerShell is that much formatting is done for free. For example, to find out the size of a particular file you could just enter:PSH [D:\foo]: ls demo-format.txt
2012-08-28 16:41:05
796
原创 Restart-Computer enhanced in powershell V3
In PowerShell v3, Restart-Computer now has a number of useful newparameters. For example, you can restart a remote machine and wait for thereboot process to finish.-Wait: Halts the script until th
2012-08-24 10:01:45
2017
转载 Notepad++ 运行Python程序
Notepad++ 是一个开源的文本编辑器,功能强大而且使用方便,一般情况下,Notepad++作为代码查看器,很方便,但是每次要运行的时候,总是需要用右键打开其他的IDE来编译和运行,总有些不方便。特别是像lua这种语言,在Eclipse中无法集成,因此运行的时候,总是不方便。我搜到了一个使用Notepad++作为编译器的方法,现在share给大家,:),还是很方便的。。。我先说下配置,看到
2012-08-16 00:05:02
11199
转载 Powersehll有哪些运算符
Powershell有哪些运行符?当然Google有答案,也许Baidu也有答案。不过我决定还是先问Powershell试试。所以我尝试了这么一条命令:PS F:\> help about_operator 嘿,蒙对了,这里果然有Powershell运算符的详细介绍。 Powershell支持运算符主要有这么几种类型: √ 算术运算符:用于进行数值计算
2012-07-20 16:05:35
1499
原创 Powershell invokes FTP scripts
Do you have the requirement to transfer file from Windows to Linux?Do you want your script get this job done automatically, maybe you prefer Powershell.As for as i know Powershell doesn't suppor
2012-07-11 17:52:39
925
转载 IP的网段划分规则
IP网段的计算和划分 IP和子网掩码 我们都知道,IP是由四段数字组成,在此,我们先来了解一下3类常用的IP A类IP段 0.0.0.0 到127.255.255.255 B类IP段 128.0.0.0 到191.255.255.255 C类IP段 192.0.0.0 到223.255.255.255 XP默认分配的子网掩码每段只有2
2012-07-02 12:40:44
4109
1
原创 Lab Manager 4.0 Console Display issue
DetailsVMware vCenter LabManager installs an ActiveX plug-in to display the Web console in MicrosoftInternet Explorer. If the vSphere Client is installed on the same machine, itinterferes with the r
2012-06-15 11:15:01
1096
原创 Set up SVN in Ubuntu
In Ubuntu, the easiest way to do version control is to set up a Subversion (SVN) server.After several tries i did, the following steps should be works on Ubuntu 11.04 desktop version!I
2012-05-17 10:52:35
667
原创 Ubuntu在corporate network下的网络配置问题
在折腾几次之后终于有些眉目了,搞清楚了虚拟环境中Linux虚机如何联网的问题。 话说这Linux系统只要配置好IP地址就应该可以访问网络了啊,顶多是再加个代理。事情本应该就是这么美好。 但通常公司的corporate network有成百上千的policy限制,防火墙就是这么出来的。场景描述:1. Install Ubuntu OS2. Configure network3. Tr
2012-05-11 17:54:08
868
转载 VI/VIM text editor 12 Powerful Find and Replace Examples
In this article, let us review how to perform both basic and advanced text and pattern substitution features in Vi and Vim Editor. These features are explained using 12 very practical and powerful t
2012-02-24 16:37:49
1243
原创 Using Functions after the Pipeline
我们都知道Powershell普通函数的声明的样子,使用也很简单:function(关键字) 函数名 (参数) {代码}比如:function add ($x,$y) { $n = $x + $y “$x+$y=$n” }
2011-10-19 15:14:25
618
原创 Powershell uses .Net DLL is pretty simple
Step1 :Create a C sharp DLL project like below:using System;using System.Collections.Generic;using System.Linq;using System.Text;nam
2011-10-13 16:13:19
697
原创 How To Load .NET Assemblies In A PowerShell Session
PowerShell (the engine) runs fine under .NET 4.0. PowerShell ( the console host and the ISE) do not, simply because they were compiled again
2011-10-13 16:07:18
689
原创 Find and delete unused VM snapshot
#import powershell community extensions for increased functionalityImport-Module Pscx #import vmware cliAdd-PSSnapin "Vmware.VimAutomati
2011-10-13 11:15:43
786
原创 Disk usage monitoring
# To monitor disk space usage $volumeSet = Get-WmiObcject -Class win32_volume -ComputerName localhost -filter "drivetype = 3"
2011-10-13 11:12:17
612
原创 A simple Powershell script to monitor CUP/Mem utilization
#import powershell community extensions for increased functionality Import-Module Pscx #import vmware cli Add-PSSnapin "Vmware.VimA
2011-10-13 11:09:07
756
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人