about 3 years ago

Hi, 其实早就想写点文字记录录点点滴滴,刚开始在ChinaUnix写过点,但是那个博客系统用着真是不爽,我不喜欢那种style,后来搭建好了我喜欢的GitHub风格博客,但是由于那段时间太忙了,也没记录什么,再后来看到xdite大神开发的这个用着实在是很爽,符合我现在的需求,这次是真的开始写东西了!

这一年多来听到最多的一个词就是 需求,经常对这个词进行认识再认识,逐渐更加深刻。就拿我为什么用Logdown,因为它满足了我的需求,界面冰清玉洁,没有那些乱糟糟的广告,支持Markdown,这就吸引了我,也满足了我这一类人的需求。为什么这个产品能做成这样,究其根本原因还是其对需求的深刻认识。

这一年来思考更多了,更多的独立思考!

 
over 1 year ago

There will be times when the root password for your MySQL instance is either forgotten or compromised. This calls for you to reset the root password.

The follwing steps will walk you through how to reset the root password for MySQL.

  1. Stop the MySQL process.

    # service mysqld stop
    

    Once MySQL has stopped

  2. Restart it with the --skip-grant-tables option.

    # mysqld_safe --skip-grant-tables &
    
  3. Connect to MySQL using the root user.

    # mysql -u root
    

    Once logged in, you should see the following prompt:

    mysql>
    

    Tell MySQL which database to use:

    mysql> use mysql;
    

    Enter the new password for the root user as follows:

    mysql> UPDATE user SET password=PASSWORD("YOUR NEW PASSWORD HERE") WHERE User='root';
    

    Flush the privileges:

    mysql> flush privileges;
    

    Exit MySQL:

    mysql> quit
    
  4. Now stop MySQL again.

    # service mysqld stop
    
  5. Now restart MySQL.

    # service mysqld restart
    

    Test your new login.

    # mysql -u root -p
    

    Congratulations.

 
over 1 year ago

About Zabbix

Zabbix is the ultimate enterprise-level software designed for monitoring availability and performance of IT infrastructure components. Zabbix is open source and comes at no cost.

 
over 1 year ago

About Cacti

Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

 
over 1 year ago
Diff 创建软件补丁,用patch 打补丁

diff 是生成源码补丁的必备工具。其命令格式为:
diff [命令行选项] 原始文件新文件
常用命令行选项如下:
-r 递归处理目录
-u 输出统一格式(unified format)
-N patch 里包含新文件
-a patch 里可以包含二进制文件
它的输出在stdout 上,所以你可能需要把它重定向到一个文件。输出格式保存了上下文(缺省是上下各三行,最少需要两行),这样,patch 的时候可以允许行号不精确匹配的情况出现。另外,在patch 文件的开头明确地用---和+++标示出原始文件和当前文件,也方便阅读。

通常,我们需要对整个软件包做修改,并生成一个patch 文件,下面是典型的操作过程。

tar xzvf software.tar.gz # 展开原始软件包,其目录为software
cp _a software software-orig # 做个修改前的备份
cd software
[修改,测试……]
cd ..
diff -ruNa software-orig software > software-my.patch

现在我们就可以保存software-my.patch 做为这次修改的结果,至于原始软件包,可以不必保存。等到下次需要再修改的时候,可以用patch 命令把这个补丁打进原始包,再继续工作。比如是在linux kernel 上做的工作,就不必每次保存几十兆修改后的源码了。这是好处之一,好处之二是维护方便,由于unified patch格式有一定的模糊匹配能力,能减少原软件包升级带来的维护工作量。
patch
patch 程序根据补丁(patch)文件修改一个文件。补丁文件通常是使用diff 程序建立的一个列表,这个列表包含如何修改原始文件的一些指令。由于节省时间和空间,Patch 经常用于源代码的修补。
可以想象一个有1MB 的程序包,这个程序包的下一个版本仅仅改变了前面一个版本的两个文件的内容,这个新版本可以完全以一个1MB 的新版本进行发布或者以一个仅仅有1KB 的补丁文件进行发布。这个补丁文件可以对第一个版本的进行更新,更新后的版本就和第二个版本完全一致了。因此,如果已经下载了第一个版本,那么为了下一个版本而进行的大数据量下载工作就可以有效地避免。
常用命令行选项:
patch [命令行选项] [待patch 的文件[patch]]
-pn patch level(n 是数字) 
-b[后缀] 生成备份,缺省是.orig,为了说明什么是patch level,这里看一个patch 文件的头标记。
diff -ruNa xc.orig/config/cf/Imake.cf xc.bsd/config/cf/Imake.cf
--- xc.orig/config/cf/Imake.cf Fri Jul 30 12:45:47 1999
+++ xc.new/config/cf/Imake.cf Fri Jan 21 13:48:44 2000
这个patch 如果直接应用,它会去找xc.orig/config/cf 目录下的Imake.cf 文件,假如你的源码树的根目录是缺省的xc 而不是xc.orig,除了mv xc xc.orig 之外,有无简单的方法应用此patch 呢?patch level 就是为此而设:patch 会把目标路径名砍去开头patch level 个节(由/分开的部分)。在本例中,可以用下述命令:
cd xc; patch -p1 
完成操作。注意,由于没有指定patch 文件,patch 程序默认从stdin 读入,所以用了输入重定向。又例如:
diff -r dir1 dir2 >patch20020523.patch

递归的比较目录dir1 与dir2 内,所有各文件之不同处,并将不同处记录到patch20020523.patch 文件中。
 patch -p1  
 -p1 选项代表patchfile 中文件名左边目录的层数,顶层目录在不同的机器上有所不同。要使用这个选项,就要把你的patch 放在要被打补丁的目录下,然后在这个目录中运行path -p1 。

http://www.ruanyifeng.com/blog/2012/08/how_to_read_diff.html

 
over 1 year ago

This is a quick tutorial on how to set a static IP address using the terminal within Fedora 20.

Disable Network Manager

  1. First stop and disable the gnome network manager from running on boot.
    # systemctl stop NetworkManager.service
    # systemctl disable NetworkManager.service
    
  2. Now start and enable the network service to run on boot.
    # systemctl restart network.service
    # systemctl enable network.service
    

Set the Static Address

  1. Check which interface(s) you want to set as static.

    [root@server ~]# ifconfig
    
    em1: flags=4163 mtu 1500
    inet 192.168.1.148 netmask 255.255.255.0 broadcast 192.168.1.255
    inet6 fe80::dad3:85ff:feae:dd4c prefixlen 64 scopeid 0x20 ether d8:d3:85:ae:dd:4c txqueuelen 1000 (Ethernet)
    RX packets 929 bytes 90374 (88.2 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 1010 bytes 130252 (127.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    device interrupt 19
    lo: flags=73mtu 16436
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10
    loop txqueuelen 0 (Local Loopback)
    RX packets 32 bytes 3210 (3.1 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 32 bytes 3210 (3.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    
  2. Next edit the config file for the required interface.

    # vim /etc/sysconfig/network-scripts/ifcfg-em1
    
  3. Edit the config file to look similar to the following.
    Change the BOOTPROTO from “dhcp” to “static”. Also adding IPADDR, NETMASK, BROADCAST and NETWORK variables and make sure ONBOOT is set to yes.

    UUID="e88f1292-1f87-4576-97aa-bb8b2be34bd3"
    NM_CONTROLLED="yes"
    HWADDR="D8:D3:85:AE:DD:4C"
    BOOTPROTO="static"
    DEVICE="em1"
    ONBOOT="yes"
    IPADDR=192.168.1.2
    NETMASK=255.255.255.0
    BROADCAST=192.168.1.255
    NETWORK=192.168.1.0
    GATEWAY=192.168.1.1
    

Apply the Settings
Restart the network service to apply the settings.

# systemctl restart network.service

Configure DNS
Make sure the correct DNS servers are configured to allow Fedora to resolve domains.

# vim /etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.8.8
 
over 1 year ago

https://www.hashicorp.com/

https://www.vagrantup.com/
https://packer.io/
https://serfdom.io/
https://consul.io/
https://terraform.io/
https://atlas.hashicorp.com/development
https://atlas.hashicorp.com/

https://www.docker.com/

https://about.gitlab.com/

 
over 1 year ago

CentOS/Fedora:

yum install -y gcc-c++ glibc-headers openssl-devel readline libyaml-devel readline-devel zlib zlib-devel

install rbenv by rbenv installer

curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash

add below in .bashrc not .bash_profile

export RBENV_ROOT="${HOME}/.rbenv"

if [ -d "${RBENV_ROOT}" ]; then
  export PATH="${RBENV_ROOT}/bin:${PATH}"
  eval "$(rbenv init -)"
fi

install ruby

rbenv install 2.1.4
rbenv global 2.1.4

rbenv rehash
 
almost 2 years ago

Hi all,
If you use mongo client alot but hate the default cli behavior, I
find this tool to be very helpful to enhance the cli experience.

https://github.com/TylerBrock/mongo-hacker

 
almost 2 years ago

Hi all,
This is handy tool to reformat your ruby codes outside of your editor.

https://github.com/erniebrodeur/ruby-beautify

The only drawback is it only prints out the result and doesn't
overwrite the original source. As a workaround you can do these steps.

rbeautify bad_file.rb > good_file.rb; mv good_file.rb bad_file.rb

If you use sublime text, you can add this plugin instead. I'm using
it and it works great.

https://github.com/CraigWilliams/BeautifyRuby

Hopefully these tools will eliminate the indentation issues we've
been seeing with the git pull requests.

 
about 2 years ago

今天同事经历了一次电话诈骗,和之前看过的《同事亲历的一次电话诈骗》里面描述的一样。

 
about 2 years ago

Prerequisites

gem install pry

gem install pry-nav

touch ~/.pryrc

create alias for gdb style navigation

Pry.commands.alias_command 'c', 'continue'

Pry.commands.alias_command 's', 'step'

Pry.commands.alias_command 'n', 'next'

Example on how to use pry-nav

def some_method

binding.pry # Execution will stop here.

puts 'Hello World' # Run 'step' or 'next' in the console to move here.

end

 
about 2 years ago

The aritcles on the sites of nixCraft and DigitalOcean always have high value

http://www.cyberciti.biz/tips/howto-performance-benchmarks-a-web-server.html

https://www.digitalocean.com/community/tutorials/how-to-use-apachebench-to-do-load-testing-on-an-ubuntu-13-10-vps

https://www.blitz.io/

 
about 2 years ago

https://github.com/kahun/awesome-sysadmin

 
over 2 years ago

The CentOS Linux distribution is a stable, manageable and reproduceable platform derived from the sources of Red Hat Enterprise Linux (RHEL). free to redistribute.

Asterisk is an open source framework for building communications applications.Asterisk turns an ordinary computer into a communications server.

MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia.

MantisBT is an open source issue tracker makes collaboration with team members & clients easy, fast, professional and effectively.

TestLink is an Open Source Test Management.

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer. This functionality enables a more centralized usage of Git.

Jenkins is an extendable open source continuous integration server, it provides many plugins to support building and testing virtually any project.

Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

VirtualBox is freely available as Open Source Software

Puppet Open Source is a flexible, customizable framework available under the Apache 2.0 license designed to help system administrators automate the many repetitive tasks they regularly perform.

Chef also have an open-source free version

RVMis a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
another similar tool is rbenv

ruby on rails is an open-source web framework optimized for programmer happiness and sustainable productivity, it lets you write beautiful code by favoring convention over configuraion

A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. it has a friendly and growing community.

Docker is an open-source project to easily create lightweight, portable, self-sufficient containers from any application.

we use many open source tools, such as centos, asterisk, mediawiki, mantis, testlink, gerrit, jenkins,
Our working operating system is CentOs,I use it everyday, Writing automated shell scripts to deploy asterisk on Cloud Application Platform
I also wirte spec scripts to build rpm package of asterisk, libpri, dahdi
we use git as our version control system
use gerrit as code review and project management
I deploy testlink on cloud server, then write test cases with it
we use mantis as our issue tracker to manage our bugs,
we use mediawiki as our Knowledge management system, writing technology tips with it
we use jenkins as our continuous integration server, doing some daliy build, and some automated tests
wo use these Open source softwares to collaborate on code
github and gitlab is also good tools, they offers git repository management, code reviews, issue tracking, activity feeds and wiki’s. wo also use them

i also use redmine, puppet, chef, VirtualBox,Selenium,vagrant,Docker,rails,ruby

familiar with google app engine, Amazon Elastic Compute Cloud, linode, digtial ocean, aliyun,openshift,heroku,Godaddy,newrelic

As a start-up, OpenShift has been an ideal platform because it has allowed us to focus on our application and our customers and not on infrastructure and operations.
paas is convenient and efficient to build app, i use openshift to host a site http://ihuer.com/
familiar efficient

when i create an OpenShift account using my gmail, i encountered a problem, it tell me, can't
contain capital letters in email account, so i turn my gmail account into lower case letters, gmail
is not case-sensitive,so I can use it in this way, openshift tell me i create my accout successfully
but i can't receive emails from openshift, i also use my gmail receive all my emails,
because openshift case-sensitive, so my gmail can't register successfuly i think this is not friendlyto customers, many people use capital letters in their email accout, i think openshift should modify the design of register

 
over 2 years ago

Matrix Admin

http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/
https://www.udemy.com/bootstrap-3/
http://www.sitepoint.com/understanding-twitter-bootstrap-3/
http://pluralsight.com/training/Courses/TableOfContents/bootstrap-3

http://codepen.io/dsm-webdsigner/pen/zlomL
http://codepen.io/waddington/pen/mloCb

http://haoqicat.com/happypeter/html7
http://getbootstrap.com/css/
http://jquery.com/

https://learnable.com/books/jump-start-html5-basics/online/cover

 
over 2 years ago

后台开发中的数据可视化是非常关键的开发,因为要做数据化运营,把相关数据统计成漂亮的图形和曲线显得更有必要。目前接触到的工具如下,

http://www.highcharts.com/

http://nvd3.org/

http://d3js.org/

相关使用视频
http://haoqicat.com/luckyyang
http://haoqicat.com/billie66/web-kai-fa-ji-qiao-fen-xiang
http://happycasts.net/episodes/95

未完待续

 
over 2 years ago

最近在看《考拉小巫的英语学习日记》,感触很深,我感觉和她的经历大致相似中又本质相同,看到一段话,那些产生了强烈的共鸣,这是通过我鲜活的人生经历体会出来的,但是我一直没有把这些形成文字,但是在书中91页的文字,让我内心真的感同身受,这就是真正意义上的独立人格的体现。

第一,人,不应该被自己所在的环境所束缚。如果身边的环境消极,那么就应该主动试着去改变环境,而不是被环境所改变。如果改变不了环境,那么就要努力改变自己的态度,用积极的态度在逆境中搏出一条路。有句话说得好:不要盲目地适应你生存地环境,因为很可能这个环境自身已经不适应这个社会地发展了。

第二,人,要超脱出身边所处地人群,而拥有属于自己的独特的思想和梦想。人群的思想和梦想是属于人群的,再好或再坏,都与自己无关。积极向上的东西要吸收,消极萎靡的东西要摒弃。自己作为人群中一个独立的个体,永远都要有自己的梦想和自己的目标。无论怎样,要保持清醒的头脑。看清自己,扬长补短。

这就是独立人格的体现,慢慢的我的独立人格在完善,慢慢的蜕变。

现在心里想的是,感谢郭哥,这样一位好大哥,从认识到现在一直在主动的帮我,每当我把自己的想法,目标和计划分享给他的时候,他总是能用心的和我交流,把他的看法和想法说给我听。我能接触到这本书,就是当我说想准备学英语时,郭哥再一次告诉我他看了一本书不错,明天给你带过来,在一次验证了社交红利=信息在关系链中流动,这样朋友圈最应该值得珍惜。

 
over 2 years ago

tutorialspoint

浏览器的工作原理:新式网络浏览器幕后揭秘

JavaScript 标准参考教程

ECMAScript 6入门

Rails Guides 中文版

Ruby on Rails Tutorial 原书第 2 版(涵盖 Rails 4)

Ruby on Rails Tutorial 原书第 2 版(涵盖 Rails 3.2)

GotGitHub

Unicorn!

Discover Meteor中文版

Redis 设计与实现

 
over 2 years ago

http://study.163.com/course/courseLearn.htm?courseId=468009#/learn/thirdRes?lessonId=598103&courseId=468009

http://www.ustraveldocs.com/