tag:blogger.com,1999:blog-64274522024-02-19T20:14:50.390+08:00Allen's Tech BlogUnknownnoreply@blogger.comBlogger332125tag:blogger.com,1999:blog-6427452.post-21468978293986748772018-06-24T17:17:00.001+08:002018-06-24T17:19:03.387+08:00Small project for AWS Lambda bootstrap and deploymentThe is a very small project and still at the early staging. It focuses on AWS Lambda with python bootstrap, dependencies management, deployment with Cloudformation and so forth.<br />
<br />
Project repository,<br />
<br />
<a href="https://github.com/a3linux/pipenv-aws-lambda-template">https://github.com/a3linux/pipenv-aws-lambda-template</a><br />
<br />
Suggestion and pull request are welcome and need more test / user cases.<br />
<br />
Enjoy it then.<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-46806052026387675782018-04-09T11:31:00.002+08:002018-04-09T16:50:16.352+08:00What is DevOPS?<h2 style="background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.25; margin-bottom: 16px; margin-top: 0px !important; padding-bottom: 0.3em;">
What is DevOPS?</h2>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
As be a DevOPS engineer more than five years in the past, I was always asked what is DevOPS or what is a DevOPS role or what should a DevOPS Engineer do? Or even question like how to be a good DevOPS?</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
What? How? should be the most two frequently questions from almost all organizations.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
As I am working with <span style="box-sizing: border-box; font-weight: 600;">Amazon Web Service</span> for a long time with my DevOPS career, I tried to get answers from AWS guys frist as they have a special section about AWS DevOPS, also they have AWS DevOPS certificate cources, even though I never try such cources.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
This is the first page said about DevOPS on AWS DevOPS to answer "What is DevOPS?",</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<em style="box-sizing: border-box;">DevOps is the combination of cultural philosophies, practices, and tools that increases an organization’s ability to deliver applications and services at high velocity: evolving and improving products at a faster pace than organizations using traditional software development and infrastructure management processes. This speed enables organizations to better serve their customers and compete more effectively in the market.</em></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/9d6fa4ff951f9f6c01dc814e2f3a5f8de26b8534/68747470733a2f2f64312e6177737374617469632e636f6d2f70726f647563742d6d61726b6574696e672f4465764f70732f4465764f70735f666565646261636b2d6469616772616d2e666636363862666332393961626164613030623264636264633963653233383962643364636533662e706e67" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;" target="_blank"><img alt="DevOPS Model" data-canonical-src="https://d1.awsstatic.com/product-marketing/DevOps/DevOps_feedback-diagram.ff668bfc299abada00b2dcbdc9ce2389bd3dce3f.png" src="https://camo.githubusercontent.com/9d6fa4ff951f9f6c01dc814e2f3a5f8de26b8534/68747470733a2f2f64312e6177737374617469632e636f6d2f70726f647563742d6d61726b6574696e672f4465764f70732f4465764f70735f666565646261636b2d6469616772616d2e666636363862666332393961626164613030623264636264633963653233383962643364636533662e706e67" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<em style="box-sizing: border-box;">Under a DevOps model, development and operations teams are no longer “siloed.” Sometimes, these two teams are merged into a single team where the engineers work across the entire application lifecycle, from development and test to deployment to operations, and develop a range of skills not limited to a single function. Quality assurance and security teams may also become more tightly integrated with development and operations and throughout the application lifecycle.</em></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
Obviously, AWS guys think DevOPS is a <em style="box-sizing: border-box;">complex thing</em> combined with culture, practices and tools. This definition is not complete right or not, but I agree that DevOPS should be not only some tools, some ideas or some processes, in the first of all, it should be a team / organization culture. Second, it should come with processes, tools. DevOPS should be a term for a group of concepts introudced by the technology community.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
DevOPS, <em style="box-sizing: border-box;">mind</em> or <em style="box-sizing: border-box;">theory</em> or <em style="box-sizing: border-box;">culture</em> first, then tools, technology and procedures, then practice and more. Recognize the culture of DevOPS should be the first lesson for anyone who wants to go with DevOPS. Here, remember, DevOPS is <span style="box-sizing: border-box; font-weight: 600;">NOT JUST</span> culture, but don't forget the culture.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<span style="box-sizing: border-box; font-weight: 600;">DevOPS is agilty</span>. But the DevOPS agilty should rely on platforms, technologies and procedures. If the infrastructure platform is out of date, how could you apply aglity operations that DevOPS requires? For example, your traditional infrastructure Data Center can not hold such requirement at all, provisoning 1,000 nodes for quick test and terminating them after working time. Before AWS period, we already did similar requirements by VMWare vSphere platform, but for a single data center, it is still required large scale base infrastructure which can not affort by most of SME organizes. An elastic infrastructure platform here should be base. "Agile infrastructure", "Agile Operations", "Agile Development Process", those concepts are always mentioned in DevOPS drive team.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<span style="box-sizing: border-box; font-weight: 600;">DevOPS is NOT NoOPS</span>. DevOPS merges the developer and operation borders. But it is not said you don't want a stable and reliable monitor anymore. In the other hand, you want a much more requirements for monitoring, alerting and even auto recovery. There is always misunderstanding in this domain. Merging the border of Dev and Ops, it is not said OPS quit, it is because OPS evoluting to DevOPS, or I like the word "Elastic OPS", "Dynamic OPS".</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
DevOPS might be starting from about more than 10 years ago, at the time I was working in eBay.com as automation operation engineer or tools engineer. The technique community required things like,</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
<em style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 600;">a cross-disciplinary community of practice dedicated to the study of building, evolving and operating rapidly-changing resilient systems at scale</span></em></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
In that old days, operation team and development team are totally separate teams. We perbit development guys touch our production at all. New service go live with certain period as release plan or something similar. In eBay.com, it is called <em style="box-sizing: border-box;">train</em>and roll out every two weeks.</div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
But DevOPS is something deifferent comparing above traditional model, <em style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 600;">DevOps is the practice of operations and development engineers participating together in the entire service lifecycle, from design through the development process to production support</span></em></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
Also, DevOPS brings, <em style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 600;">DevOps is also characterized by operations staff making use many of the same techniques as developers for their systems work</span></em></div>
<div style="background-color: white; box-sizing: border-box; caret-color: rgb(36, 41, 46); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
DevOPS always discuss such topics,<br />
<br />
<ul style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Infrastructure Automation – create your systems, OS configs, and app deployments as code.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Continuous Delivery – build, test, deploy your apps in a fast and automated manner.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Site Reliability Engineering – operate your systems; monitoring and orchestration, sure, but also designing for operability in the first place.</li>
</ul>
<div>
This is the first time I tried to answer some questions always asked in the past years. I think I will start a topic on this to show more understanding about DevOPS then.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-64792846027777395212016-03-26T09:12:00.001+08:002016-03-26T09:13:58.171+08:00First release of Advanced DCOS AWS CloudFormation TemplateDCOS AWS CloudFormation Template is an easy way to try and deploy AWS based Mesosphere DCOS environment, but the community version provided by Mesosphere is complex and hard to include customization and other features, although, in the last release(<a href="https://docs.mesosphere.com/administration/release-notes/community-edition/dcos-1-6/">DCOS Community 1.6</a> ), include an advanced feature I never try yet.<br />
<br />
<a href="https://github.com/a3linux/dcos-aws">Here,</a> just comes my first customized version of DCOS community template with some essential points for a real running environment, more customization can be easy added then, at the same time, keep it easy to track the Mesosphere upstream release in future.<br />
<br />
If you want to try Mesosphere DCOS or deploy it, just enjoy it.<br />
<br />
<a href="https://github.com/a3linux/dcos-aws">https://github.com/a3linux/dcos-aws</a><br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-84198695456990580012015-08-27T10:14:00.000+08:002015-08-27T10:14:00.744+08:00Linux block device commandsMost of Linux user use df, du or fdisk, parted to check file system, block devices on a Linux system, me too.<br />
How about trying some new staffs from the linux commands set?<br />
<br />
1. lsblk - It is list the block devices info with friendly output,<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT</span><br />
<span style="font-family: Courier New, Courier, monospace;">sda 8:0 0 238.5G 0 disk </span><br />
<span style="font-family: Courier New, Courier, monospace;">├─sda1 8:1 0 976M 0 part /boot</span><br />
<span style="font-family: Courier New, Courier, monospace;">├─sda2 8:2 0 31.3G 0 part /</span><br />
<span style="font-family: Courier New, Courier, monospace;">└─sda3 8:3 0 206.3G 0 part /home</span><br />
<span style="font-family: Courier New, Courier, monospace;">sdb 8:16 0 931.5G 0 disk </span><br />
<span style="font-family: Courier New, Courier, monospace;">└─sdb1 8:17 0 931.5G 0 part /data</span><br />
<span style="font-family: Courier New, Courier, monospace;">sr0 11:0 1 1024M 0 rom </span><br />
<span style="font-family: Courier New, Courier, monospace;">loop0 7:0 0 100G 0 loop </span><br />
<span style="font-family: Courier New, Courier, monospace;">└─docker-8:2-266441-pool 253:0 0 100G 0 dm </span><br />
<span style="font-family: Courier New, Courier, monospace;">loop1 7:1 0 2G 0 loop </span><br />
<span style="font-family: Courier New, Courier, monospace;">└─docker-8:2-266441-pool 253:0 0 100G 0 dm </span><br />
<div>
<br /></div>
<div>
2. blkid - List block device attributes </div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">dev/sda3: LABEL="/home" UUID="c9018229-5fcb-4ac0-ad4e-8cfbfde14033" TYPE="ext4" PARTUUID="5063ffef-03"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdb1: LABEL="/data" UUID="fa0f9a52-734d-4fdc-9413-e987dc27f0c0" TYPE="ext4" PARTUUID="2856a071-01"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/loop0: UUID="0c5593b1-7766-4661-985e-619f08177f5f" TYPE="ext4"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/mapper/docker-8:2-266441-pool: UUID="0c5593b1-7766-4661-985e-619f08177f5f" TYPE="ext4"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/block/8:2: LABEL="/" UUID="35e7b4f9-a93c-42f8-bd18-dd62dd5d441d" TYPE="ext4" PARTUUID="5063ffef-02"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/block/8:1: LABEL="/boot" UUID="611d7adc-0f11-4d5c-8f78-31e2a83f9118" TYPE="ext4" PARTUUID="5063ffef-01"</span></div>
</div>
<div>
<br /></div>
<div>
3. findmnt - Find all file system(mount points) on the system </div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">TARGET SOURCE FSTYPE OPTIONS</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/ /dev/sda2 ext4 rw,relatime,data=ordered</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ └─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/sys/kernel/debug debugfs debugfs rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/sys/kernel/config configfs configfs rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ └─/sys/fs/fuse/connections fusectl fusectl rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/proc proc proc rw,nosuid,nodev,noexec,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ └─/proc/fs/nfsd nfsd nfsd rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/dev devtmpfs devtmpfs rw,nosuid,size=16434044k,nr_inodes=4108511,mode=755</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/dev/mqueue mqueue mqueue rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/run tmpfs tmpfs rw,nosuid,nodev,mode=755</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ ├─/run/user/42 tmpfs tmpfs rw,nosuid,nodev,relatime,size=3288812k,mode=700,uid=42,gid=42</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ │ └─/run/user/42/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=42,group_id=42</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,size=3288812k,mode=700,uid=1000,gid=1000</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">│ └─/run/user/1000/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/tmp tmpfs tmpfs rw</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/boot /dev/sda1 ext4 rw,relatime,data=ordered</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/home /dev/sda3 ext4 rw,relatime,data=ordered</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">├─/data /dev/sdb1 ext4 rw,relatime,data=ordered</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">└─/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime</span></div>
</div>
<div>
<br /></div>
<div>
Just try such commands and enjoy them with your Linux life. </div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-91378403322486504182015-08-05T09:14:00.000+08:002015-08-27T10:09:12.148+08:00Nouveau driver issue on workstationThe nouveau driver has issue with Fedora 22 on my workstation too, I think it might be the same issue as ElementaryOS one. For long time running, 3 or more days, Nouveau will report has no channel to connect and from Fedora's journal log, I can see many nouveau errors and system just reported /dev/dmsg overrun and some messages lost.<br />
When this happened, I hard to caught more information as the console and keyboard didn't work anymore. I can SSH to the system but it is impossible to restart GDM or X windows. Only a system reboot can bring back it.<br />
<br />
No time to dig into such problem, just try the Nvidia driver then.<br />
<br />
For Fedora user, it is luck we have a new Nvidia repository and it looks much cleaner and straightforward than before ones.<br />
<br />
Just try it. <a href="http://negativo17.org/nvidia-driver/">http://negativo17.org/nvidia-driver/</a><br />
I didn't use CUDA or more features here, so I didn't install additional things. Only keep simplest life,<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<pre class="bash" style="-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; max-width: 100%; outline: 0px; overflow: visible !important; padding: 0px 4px !important; vertical-align: baseline; width: auto !important; word-wrap: break-word;"><span style="font-family: Arial, Helvetica, sans-serif;">sudo dnf config-manager <span style="border: 0px; color: #660033; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">--add-repo</span>=http:<span style="border: 0px; color: black; font-style: inherit; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">//</span>negativo17.org<span style="border: 0px; color: black; font-style: inherit; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">/</span>repos<span style="border: 0px; color: black; font-style: inherit; font-weight: bold; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">/</span>fedora-nvidia.repo</span></pre>
<pre class="bash" style="-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; max-width: 100%; outline: 0px; overflow: visible !important; padding: 0px 4px !important; vertical-align: baseline; width: auto !important; word-wrap: break-word;"><span style="font-family: Arial, Helvetica, sans-serif;">sudo dnf install nvidia-driver </span></pre>
<pre class="bash" style="-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; max-width: 100%; outline: 0px; overflow: visible !important; padding: 0px 4px !important; vertical-align: baseline; width: auto !important; word-wrap: break-word;"><span style="font-family: Arial, Helvetica, sans-serif;">sudo reboot </span></pre>
<pre class="bash" style="-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; max-width: 100%; outline: 0px; overflow: visible !important; padding: 0px 4px !important; vertical-align: baseline; width: auto !important; word-wrap: break-word;"></pre>
<div style="-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: none !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; box-sizing: border-box; clear: none !important; color: #110000; font-size: 12px !important; line-height: 16px !important; max-width: 100%; outline: 0px; overflow: visible !important; padding: 0px 4px !important; vertical-align: baseline; width: auto !important; word-wrap: break-word;">
<br />
Then enjoy your life. Will update this for some days running.<br />
<br />
========Updated ==================<br />
This issue is not fixed with Nvida driver so I went back to Nouveau.<br />
<br />
This issue is something about the Link of DisplayPort as my monitoring used miniDisplayPort connection<br />
and the error message is that "Link Training Failed" and in some situation, even though a reboot can not bring back the monitor links.<br />
That's the real issue, I think.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-4783749872527492692015-07-29T21:05:00.000+08:002015-07-29T21:29:46.748+08:00Change my workstation back to FedoraI just changed my workstation from <a href="http://elementary.io/">ElementaryOS </a>to <a href="http://fedoraproject.org/">Fedora</a> 22, because as months testing, I think ElementaryOS is not fit for me and it might not be a stable enough for a Cloud DevOps engineer. I am not sure what's wrong with the latest update, but it is always CRASH and something is related to Gala. I reported crash I think. But now, in my VM, I can not reproduce it because I think it is related to Nouveau X driver with the hardware.<br />
<br />
Anyway, I can not let my workstation crash everyday any more.<br />
Let me just keep it in my VM in near future.<br />
<br />
Back to Fedora, it is so nice.<br />
<br />
Another reason is Evolution on Fedora supports Exchange very well, but I didn't what's reason the EWS didn't work on ElementaryOS. I think it should not be ElementaryOS, it should be caused by Ubuntu.<br />
<br />
But Fedora is wonderful as before. It took me ONLY 30 minutes to get Fedora workstation ready to work including such as AWSCli and so forth.<br />
<br />
With F22, up to now, the issue that I can NOT let the bridge network working with NetworkManage. I think there is a bug in F22 which was reported and verified already.<br />
But the guys said they can use command line tool "nmcli" to up the slave connection as "sudo nmcli con up <bridge_slave_id>", unfortunately, it is not working for me. </bridge_slave_id><br />
I think this is the bug in Fedora Bugzilla,<br />
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1058122">https://bugzilla.redhat.com/show_bug.cgi?id=1058122</a><br />
<br />
This is the blog described the workaround that didn't work on my workstation.<br />
<a href="https://www.happyassassin.net/2014/07/23/bridged-networking-for-libvirt-with-networkmanager-2014-fedora-21/">https://www.happyassassin.net/2014/07/23/bridged-networking-for-libvirt-with-networkmanager-2014-fedora-21/</a><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-80605926491244456232015-07-22T21:08:00.000+08:002015-07-22T21:09:41.030+08:00GoLang, is it a compilable script?It is the first time that I used GoLang for real work.<br />
Just a small piece of code which push Linux System memory and disk utilization to AWS CloudWatch from EC2 instance.<br />
<br />
It is easy task and Amazon also provide official Amazon Linux Monitor scripts for such topic, which is written by Perl.<br />
<br />
As working with CoreOS, I need a binary version for such scripts. I built <a href="https://github.com/a3linux/go-aws-mon">go-aws-mon</a> in about one day without any GoLang knowledge before. This is the repository on GitHub,<br />
<br />
As an operation guy, I just think about the compilable script -- GoLang, maybe it is not for system administrator when is designed. But now it is really easy to work with different system, operation tasks, especially in cloud environment with GoLang.<br />
<br />
Coding like Python, running like C/C++, that's really nice.<br />
It is easy to use AWS Go SDK, also similar to Python Boto.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-5419083183489836232014-11-07T17:50:00.002+08:002014-11-07T17:50:24.168+08:00Quick setup local S3 Test Environment with RiakCS On Fedora 20/21<br />
<ol>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Download Riak-1.4.10, Riak-cs-1.5.2 and stanchion-1.5.0 Fedora RPMs from Riak site,<br />according to the document, this is the latest match versions up to now.<br /></span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Config Riak first,<br />Add those lines to riak_kv and comment the old storage_backend config line.<br /><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;"> </span><span class="tuple" style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{add_paths, [<span class="string" style="color: #f2b156;">"<b>/usr/lib64/riak-cs/lib/riak_cs-1.5.2/ebin</b>"</span>]}</span><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">, %% Here, it is /usr/lib64/ on Fedora
</span><span class="tuple" style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{storage_backend, riak_cs_kv_multi_backend}</span><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">,
</span><span class="tuple" style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{multi_backend_prefix_list, [<span class="tuple">{<<<span class="string" style="color: #f2b156;">"0b:"</span>>>, be_blocks}</span>]}</span><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">,
</span><span class="tuple" style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{multi_backend_default, be_default}</span><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">,
</span><span class="tuple" style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{multi_backend, [
<span class="tuple">{be_default, riak_kv_eleveldb_backend, [
<span class="tuple">{max_open_files, <span class="number" style="color: #ea7107;">50</span>}</span>,
<span class="tuple">{data_root, <span class="string" style="color: #f2b156;">"/var/lib/riak/leveldb"</span>}</span>
]}</span>,
<span class="tuple">{be_blocks, riak_kv_bitcask_backend, [
<span class="tuple">{data_root, <span class="string" style="color: #f2b156;">"/var/lib/riak/bitcask"</span>}</span>
]}</span>
]}</span><span style="background-color: #f8f8f8;"><span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">,</span></span>
<span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">Add this line to riak_core section,
</span></span><span style="color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;"> </span><span class="tuple" style="color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">{default_bucket_props, [<span class="tuple">{allow_mult, true}</span>]}</span><span style="color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">,
</span></span><span style="background-color: #f8f8f8; color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">Official document is here,
http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Riak/
On Fedora 20, I met error with "systemctl start riak.service" and my workaround is put "Defaults:root !requiretty" in /etc/sudoers as it prompt sudo need tty.
ON Fedora 21, I didn't occur this error and the system just prompt to use chkconfig to enable the riak service as it is old one.
You can use both systemctl or service command to start/stop/status riak/riak.service on Fedora 21. </span></span></li>
<li><span style="background-color: #f8f8f8;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">Config Stanchion</span></span>
<span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">It is simple task just following the document,
</span></span>
<span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Stanchion/
</span></span>
</span></span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="background-color: #f8f8f8;"><span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">Follow this document to config riak-cs service </span></span></span><span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;">http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Riak-CS/
use
riak ping
stanchion ping
riak-cs ping
To check those three services are up.
</span></span><span style="color: #4d4d4c; line-height: 18.6611042022705px; white-space: pre;">
Before you create admin user, please confirm the </span><span style="color: #4d4d4c;"><span style="line-height: 18.6611042022705px; white-space: pre;"> {anonymous_user_creation, true}</span></span> in /etc/riak-cs/app.config. <br />I used this command to create the admin user,<br /><br />curl -H 'Content-Type: application/json' -XPOST http://localhost:8080/riak-cs/user --data '{"email":"foobar@example.com", "name":"admin user"}'<br /><br />After get the credential of Admin user, put the key and secret key to both /etc/stanchion/app.config and /etc/riak-cs/app.config files, also change {anonymous_user_creation, true} to {anonymous_user_creation, false} in /etc/riak-cs/app.config. Then restart stanchion and riak-cs.<br />The official document seems missed the credential in /etc/stanchion/app.config one.<br /></span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Test the environment with s3cmd<br /><br />put the credential got in last step to s3cfg.<br />Document is here.<br />http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-an-S3-Client/</span></li>
</ol>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">This is a simple guide and only for Fedora user to test S3 API on local. </span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-68996975739343444862014-10-21T10:08:00.004+08:002014-10-21T10:08:41.703+08:00Transparent in VTE fixed on Gtk3Just found it is fixed on Fedora 21 with the latest update.<br />
Gnome-terminal, Drop Down Terminal extension of Gnome-Shell and other Terminal applications which is based on GTK3 VTE now can enable the transparent feature.<br />
<br />
Just tried to switch Guake from to Drop Down Terminal extension of gnome-shell.<br />
<br />
Drop Down Terminal + Tmux.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9sgKbBRkqvaHiPep3VrpH5q_BelGQad62XlFpuKG0rE8qK_QY9IahxZXjXbOzPNslzvla2ErFfU1HA7UzFMF5CpaUlkkGIORS3tzMD89RRQ9uircjh8cFOoAv6E4746Lnn_qWA/s1600/Selection_093.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9sgKbBRkqvaHiPep3VrpH5q_BelGQad62XlFpuKG0rE8qK_QY9IahxZXjXbOzPNslzvla2ErFfU1HA7UzFMF5CpaUlkkGIORS3tzMD89RRQ9uircjh8cFOoAv6E4746Lnn_qWA/s1600/Selection_093.png" height="171" width="320" /></a></div>
The big remained issue for Drop Down Terminal extension is that VTE does not support color schema change according to its issue list.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-74344160639964941082014-10-18T16:02:00.001+08:002014-10-18T16:02:20.945+08:00Quick to disable sslv3 on Linux clientIf you want to disable the sslv3 on your Linux browser, you can do this,<br />
<br />
For Google Chrome Stable,<br />
<br />
start it by command line,<br />
# google-chrome-stable --ssl-version-min=1<br />
<br />
Or<br />
<br />
Edit the file /usr/share/applications/google-chrome.dekstop, put the parameter to<br />
Exec line, for example,<br />
Exec=/usr/bin/google-chrome-stable --ssl-version-min=1<br />
<br />
For Firefox, Input "about:config" as URL and open the settings page of Firefox,<br />
in the filter box, input "security.tls.version.min", change it to 1 then restart Firefox.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2z2ubMMXgwzvz1DeG88gGL-ptTjBzBBKbBNSv2uDnwIojnVwLdGJRiXGHSRWjr1RIUhu48K8z4bC9wuPEef0cLGbXxzTgd1NL5UbJcPQIiUqJ2CfSJ0LeOmWkkHhwxIONkjpBKg/s1600/Selection_092.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2z2ubMMXgwzvz1DeG88gGL-ptTjBzBBKbBNSv2uDnwIojnVwLdGJRiXGHSRWjr1RIUhu48K8z4bC9wuPEef0cLGbXxzTgd1NL5UbJcPQIiUqJ2CfSJ0LeOmWkkHhwxIONkjpBKg/s1600/Selection_092.png" height="131" width="320" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-16425265161267620002014-10-18T15:48:00.001+08:002014-10-18T15:50:49.955+08:00Django South does not compatible with MariaDB latest version?If you working with DJango South and the latest MariaDB just like coming from Fedora 21 or any of the new Linux distribution which is released at 2014, you might meet this and you might comes here from search on Internet just like me.<br />
<br />
The solution for this issue is here,<br />
Create<br />
<br />
<b>mysql.table_stats, </b><br />
<b>mysql.column_stats, </b><br />
<b>mysql.index_stats </b><br />
<br />
according to this page,<br />
<a href="https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/engine-independent-table-statistics/#manual-updates-to-statistics-tables">https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/engine-independent-table-statistics/#manual-updates-to-statistics-tables</a><br />
<br />
It is discussed here.<br />
<a href="http://simionbaws.ro/stories/south-migrations-and-mariadb">http://simionbaws.ro/stories/south-migrations-and-mariadb</a>/<br />
<br />
The bug is described by South here,<br />
<a href="http://south.aeracode.org/ticket/1309">http://south.aeracode.org/ticket/1309</a><br />
<br />
But it seems it is not a bug of South and it actually is the issue of MariaDB.<br />
<br />
The error message is like following,<br />
<br />
<i><span style="color: #444444;">Running migrations for contactus:</span></i><br />
<i><span style="color: #444444;"> - Migrating forwards to 0001_initial.</span></i><br />
<i><span style="color: #444444;"> > contactus:0001_initial</span></i><br />
<i><span style="color: #444444;">Traceback (most recent call last):</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/bin/django-admin.py", line 5, in <module></module></span></i><br />
<i><span style="color: #444444;"> management.execute_from_command_line()</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line</span></i><br />
<i><span style="color: #444444;"> utility.execute()</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute</span></i><br />
<i><span style="color: #444444;"> self.fetch_command(subcommand).run_from_argv(self.argv)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv</span></i><br />
<i><span style="color: #444444;"> self.execute(*args, **options.__dict__)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute</span></i><br />
<i><span style="color: #444444;"> output = self.handle(*args, **options)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle</span></i><br />
<i><span style="color: #444444;"> ignore_ghosts = ignore_ghosts,</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app</span></i><br />
<i><span style="color: #444444;"> success = migrator.migrate_many(target, workplan, database)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many</span></i><br />
<i><span style="color: #444444;"> result = migrator.__class__.migrate_many(migrator, target, migrations, database)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many</span></i><br />
<i><span style="color: #444444;"> result = self.migrate(migration, database)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate</span></i><br />
<i><span style="color: #444444;"> result = self.run(migration, database)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 111, in run</span></i><br />
<i><span style="color: #444444;"> if not south.db.db.has_ddl_transactions:</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__</span></i><br />
<i><span style="color: #444444;"> res = instance.__dict__[self.func.__name__] = self.func(instance)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/db/generic.py", line 124, in has_ddl_transactions</span></i><br />
<i><span style="color: #444444;"> if getattr(connection.features, 'supports_transactions', True):</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__</span></i><br />
<i><span style="color: #444444;"> res = instance.__dict__[self.func.__name__] = self.func(instance)</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 664, in supports_transactions</span></i><br />
<i><span style="color: #444444;"> self.connection.leave_transaction_management()</span></i><br />
<i><span style="color: #444444;"> File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 315, in leave_transaction_management</span></i><br />
<i><span style="color: #444444;"> "Transaction managed block ended with pending COMMIT/ROLLBACK")</span></i><br />
<i><span style="color: #444444;">django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK</span></i><br />
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-36402603735085464762014-09-26T22:37:00.000+08:002014-09-26T22:37:55.006+08:00First try Fedora 21 AlphaToday, I update my Fedora 20 to Fedora 21 Alpha on my Laptop.<br />
Some tips are listed here,<br />
<br />
<br />
<ul>
<li>fedup didn't work for me as it is always complains "Couldn't get boot images".<br />I am not luck to fix it today. So I switch to fedora-upgrade and yum ones.<br />It works.</li>
<li>Commands I used to do the upgrade, before that I disabled all the third party repositories.</li>
</ul>
<br />
<blockquote class="tr_bq" style="border: 0px; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px;">
<span style="font-family: Arial, Helvetica, sans-serif;"> # fedora-upgrade </span><br />
<blockquote>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.428571em;"># yum update yum </span></span> </blockquote>
</blockquote>
<blockquote class="tr_bq" style="border: 0px; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px;">
<blockquote>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.428571em;"># yum clean all </span></span> </blockquote>
</blockquote>
<blockquote class="tr_bq" style="border: 0px; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px;">
<blockquote>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.428571em;"># yum --releasever=21 distro-sync </span></span></blockquote>
</blockquote>
<br />
<ul>
<li> I removed some packages for example vlc-core and etc, they are prompted as yum --releasever can not resolve the package dependence when run it.</li>
<li>Update to now, there is no big issue for me and Gnome 3.13.9 is pretty good, but some gnome-shell extensions are not compatible with the new shell.</li>
<li>I didn't have the compatible issue with Google Chrome Stable version from google's official repository. Someone reported the libgcrypto compatible issue before.<br />I think the guys just fixed it. :-)</li>
<li>One more question, The mail list in Evolution didn't apply the Dark Theme color correctly. I got the black text in Mail list view. </li>
<li>More update come later.</li>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-73942501254149567522011-10-12T10:32:00.002+08:002011-10-12T11:00:40.653+08:00Linux删除MBR<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: rgb(17, 17, 17); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; line-height: 22px; text-align: -webkit-auto; background-color: rgb(255, 255, 255); ">基于各种linux发行版的USB Live Key越来越多,由于USB优盘的MBR被Linux写过,不适用于其他的一些情况,在Linux移除MBR的方法如下(dd命令),</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: rgb(17, 17, 17); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; line-height: 22px; text-align: -webkit-auto; background-color: rgb(255, 255, 255); "><code style="padding-top: 0.667em; padding-right: 0.917em; padding-bottom: 0.667em; padding-left: 0.917em; margin-top: 0px; margin-right: 0px; margin-bottom: 1.833em; margin-left: 0px; line-height: 1.5em; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.857em; overflow-x: auto; overflow-y: auto; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); display: block; background-position: 0px 0px; background-repeat: repeat repeat; "># dd if=/dev/zero of=/dev/sdc bs=512 count=1</code></p><pre style="padding-top: 0.667em; padding-right: 0.917em; padding-bottom: 0.667em; padding-left: 0.917em; margin-top: 0px; margin-bottom: 1.833em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); overflow-x: auto; overflow-y: auto; clear: both; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em; color: rgb(17, 17, 17); text-align: -webkit-auto; ">输出如下,</pre><pre style="padding-top: 0.667em; padding-right: 0.917em; padding-bottom: 0.667em; padding-left: 0.917em; margin-top: 0px; margin-bottom: 1.833em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); overflow-x: auto; overflow-y: auto; clear: both; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em; color: rgb(17, 17, 17); text-align: -webkit-auto; ">1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.00308483 s, 166 kB/s </pre><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: rgb(17, 17, 17); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; line-height: 22px; text-align: -webkit-auto; background-color: rgb(255, 255, 255); ">注意:/dev/sdc是你的USB盘设备,硬盘一般是/dev/sda, 优盘等移动设备为 /dev/sdb, /dev/sdbc ...</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-89707794632559480352011-08-15T17:32:00.004+08:002011-08-15T17:37:26.607+08:00太长时间没有来更新Blog了……<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu-SDlSOTx8UlsDNaPuXh-_QlnB6Y4B8y5NnVj5_LHhiEQokEWxjVlacb1iNXFrfia5TKY6JdEy9Vaob418TJYlaZFqu0nWNK3PfUeKCi8PtoA4gdFmFR1c24Mk7hF-jT_vrYE1A/s1600/Workspace+1_004.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu-SDlSOTx8UlsDNaPuXh-_QlnB6Y4B8y5NnVj5_LHhiEQokEWxjVlacb1iNXFrfia5TKY6JdEy9Vaob418TJYlaZFqu0nWNK3PfUeKCi8PtoA4gdFmFR1c24Mk7hF-jT_vrYE1A/s320/Workspace+1_004.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5641014165267627858" /></a>
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinV2zq1d9xS7jJq416E5mHHYglxHm000P4bxAPDPetddWV5ExxdIITza7p-rNTtHXm-Z_SCNQiLe9VmC5FTCp684JgZIkEhCBG0bvgClFJyDDLGxEn89n0s5XF5hwK2-uK8MGgUw/s1600/Workspace+1_005.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinV2zq1d9xS7jJq416E5mHHYglxHm000P4bxAPDPetddWV5ExxdIITza7p-rNTtHXm-Z_SCNQiLe9VmC5FTCp684JgZIkEhCBG0bvgClFJyDDLGxEn89n0s5XF5hwK2-uK8MGgUw/s320/Workspace+1_005.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5641013987536074834" /></a>
<br />
<br /><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>
<br /></div><div>时间,我们最抓不住的东西,大概就是时间……<div>秀两张Fedora 15的桌面,这是在<a href="http://suzhoulug.org/index.php/%E9%A6%96%E9%A1%B5">苏州自由软件用户组</a>活动上的PPT里面的.</div><div>
<br /></div><div>
<br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-68149094983179632472009-03-13T16:44:00.002+08:002009-03-13T16:49:01.323+08:00像Last命令一样列出history命令内容history对于了解过往命令历史比较有用,默认的history只列出number和命令来,如果能列出想last那样的格式会更有用!<br />root pts/0 10.240.68.141 Wed Mar 11 20:56 - 20:56 (00:00)<br />root pts/0 d-shc-361236.cor Wed Mar 11 20:48 - 20:48 (00:00)<br />root pts/0 d-shc-kaliu.corp Wed Mar 11 09:19 - 10:30 (01:11)<br />root pts/4 d-shc-361236.cor Tue Mar 10 13:26 - 19:14 (05:47)<br />root pts/3 10.249.72.23 Tue Mar 10 13:09 still logged in<br /><br />使用这个指令,就可以输出这样的history了,<br />export HISTTIMEFORMAT="%F %T "<br /><br />history,<br /> 1217 2009-03-12 14:51:57 ls -l<br /> 1218 2009-03-12 14:51:58 ls -l<br /> 1219 2009-03-12 14:52:07 rm -rf old<br /> 1220 2009-03-12 14:52:08 ls<br /> 1221 2009-03-12 14:52:10 ls -l<br /> 1222 2009-03-12 14:52:15 rm -f *.old<br /> 1223 2009-03-12 14:52:16 ls<br /> 1224 2009-03-12 14:52:18 ls -l<br /> 1225 2009-03-12 14:52:24 ls -l<br /> 1226 2009-03-12 14:52:25 ls -l<br /> 1227 2009-03-12 14:52:27 ls -l<br /> 1228 2009-03-12 14:52:28 ls -l<br /> 1229 2009-03-12 14:57:41 ls -l<br /> 1230 2009-03-12 14:57:44 ls -l<br /> 1231 2009-03-12 14:57:45 ls -l<br /> 1232 2009-03-12 14:57:46 ls -l<br /> 1233 2009-03-12 14:57:47 ls -l<br /> 1234 2009-03-12 14:57:49 ls -l<br /> 1235 2009-03-12 14:57:51 cd ..<br /> 1236 2009-03-12 14:57:51 ls<br /> 1237 2009-03-12 14:57:59 cd common/<br /> 1238 2009-03-12 14:58:00 ls<br /> 1239 2009-03-12 14:58:03 cd var<br /> 1240 2009-03-12 14:58:03 ls<br /> 1241 2009-03-12 14:58:05 cd log<br /> 1242 2009-03-12 14:58:06 ls<br /> 1243 2009-03-12 14:58:09 cd syslog-ng/<br /> 1244 2009-03-12 14:58:09 ls<br /> 1245 2009-03-12 14:58:12 ls -l<br /> 1246 2009-03-12 14:58:14 cd ..Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-65522105055049768572009-01-08T10:43:00.002+08:002009-01-08T10:50:56.293+08:00Fedora每日一篇:用yum-fastestmirror加快yum<div class="serendipity_entry_body"> Fedora在全球有众多的镜像服务器(在中国好像不多,至少没有很快的),Fedora系统在用YUM进行软件包管理时,首先会从服务器得到一份镜像列表。<br /><br /><a onclick="F1 = window.open('/uploads/2008-11-16-yum-fastestmirror.png','Zoom','height=425,width=672,top=320,left=511.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes'); return false;" href="http://dailypackage.fedorabook.com/uploads/2008-11-16-yum-fastestmirror.png" class="serendipity_image_link"><!-- s9ymdb:299 --><img src="http://dailypackage.fedorabook.com/uploads/2008-11-16-yum-fastestmirror.serendipityThumb.png" style="border: 0px none ; float: right; padding-left: 5px; padding-right: 5px;" align="right" width="300" height="187" /></a><br /><p><i>yum-fastestmirror </i>包可以提供对镜像服务器列表中的服务器测速和排序,得出速度最快的镜像服务器,该插件可以很大程度上加速YUM。</p><p><b>安装命令:</b> <span style="font-family:courier new,courier,monospace;">yum install yum-fastestmirror</span><br /><b>图形安装:</b> 无,在搜索标签中搜索 <i>yum-fastestmirror</i><br /><b>菜单:</b>没有,该插件会由YUM或其他基于YUM的package工具自动使用;<br /><b>命令:</b> 无,通过命令<span style="font-family:courier new,courier,monospace;">/usr/bin/yum</span> and <span style="font-family:courier new,courier,monospace;">/usr/bin/pkcon自动使用</span><br /><b>网站: </b><a href="http://yum.baseurl.org/">http://yum.baseurl.org/</a></p><p> </p> </div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-14023655618381251282008-12-20T11:19:00.004+08:002008-12-29T13:23:12.844+08:00正则表达式之道!老早就知道这篇好文,如今再次阅读下来,方知正则表达式之道!精辟!
<br />精选这张表格,真正能领悟这张表格的内容的才是正则表达式使用之道的一点精华!置于此以备查!
<br />
<br /><table border="1" cellspacing="0"><tbody><tr><td><b>Command or</b>
<br /><b>Environment</b></td> <td><b><tt><span style="font-family:Courier New;">.</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">[ ]</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">^</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">$</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">\( \)</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">\{ \}</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">?</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">+</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">|</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">( )</span></tt></b></td> </tr> <tr> <td>vi</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>Visual C++</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>awk</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>sed</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>Tcl</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>ex</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>grep</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>egrep</td> <td> X </td> <td> X</td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>fgrep</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>perl</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>
<br /></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td></tr></tbody></table>
<br />
<br /><a href="http://jmason.org/software/sitescooper/tao_regexps.html">英文原文</a> http://jmason.org/software/sitescooper/tao_regexps.html
<br />
<br />什么是正则表达式
<br />一个正则表达式,就是用某种模式去匹配一类字符串的一个公式。很多人因为它们看上去比较古怪而且复杂所以不敢去使用——很不幸,这篇文章也不能够改变这一点,不过,经过一点点练习之后我就开始觉得这些复杂的表达式其实写起来还是相当简单的,而且,一旦你弄懂它们,你就能把数小时辛苦而且易错的文本处理工作压缩在几分钟(甚至几秒钟)内完成。正则表达式被各种文本编辑软件、类库(例如Rogue Wave的tools.h++)、脚本工具(像awk/grep/sed)广泛的支持,而且像Microsoft的Visual C++这种交互式IDE也开始支持它了。
<br />
<br />我们将在如下的章节中利用一些例子来解释正则表达式的用法,绝大部分的例子是基于vi中的文本替换命令和grep文件搜索命令来书写的,不过它们都是比较典型的例子,其中的概念可以在sed、awk、perl和其他支持正则表达式的编程语言中使用。你可以看看不同工具中的正则表达式这一节,其中有一些在别的工具中使用正则表达式的例子。还有一个关于vi中文本替换命令(s)的简单说明附在文后供参考。
<br />正则表达式基础
<br />正则表达式由一些普通字符和一些元字符(metacharacters)组成。普通字符包括大小写的字母和数字,而元字符则具有特殊的含义,我们下面会给予解释。
<br />
<br />在最简单的情况下,一个正则表达式看上去就是一个普通的查找串。例如,正则表达式"testing"中没有包含任何元字符,,它可以匹配"testing"和"123testing"等字符串,但是不能匹配"Testing"。
<br />
<br />要想真正的用好正则表达式,正确的理解元字符是最重要的事情。下表列出了所有的元字符和对它们的一个简短的描述。
<br />
<br />元字符 描述
<br />
<br />.
<br /> 匹配任何单个字符。例如正则表达式r.t匹配这些字符串:rat、rut、r t,但是不匹配root。
<br />$
<br /> 匹配行结束符。例如正则表达式weasel$ 能够匹配字符串"He's a weasel"的末尾,但是不能匹配字符串"They are a bunch of weasels."。
<br />^
<br /> 匹配一行的开始。例如正则表达式^When in能够匹配字符串"When in the course of human events"的开始,但是不能匹配"What and When in the"。
<br />*
<br /> 匹配0或多个正好在它之前的那个字符。例如正则表达式.*意味着能够匹配任意数量的任何字符。
<br />\
<br /> 这是引用府,用来将这里列出的这些元字符当作普通的字符来进行匹配。例如正则表达式\$被用来匹配美元符号,而不是行尾,类似的,正则表达式\.用来匹配点字符,而不是任何字符的通配符。
<br />[ ]
<br />[c1-c2]
<br />[^c1-c2]
<br /> 匹配括号中的任何一个字符。例如正则表达式r[aou]t匹配rat、rot和rut,但是不匹配ret。可以在括号中使用连字符-来指定字符的区间,例如正则表达式[0-9]可以匹配任何数字字符;还可以制定多个区间,例如正则表达式[A-Za-z]可以匹配任何大小写字母。另一个重要的用法是“排除”,要想匹配除了指定区间之外的字符——也就是所谓的补集——在左边的括号和第一个字符之间使用^字符,例如正则表达式[^269A-Z] 将匹配除了2、6、9和所有大写字母之外的任何字符。
<br />\< \>
<br /> 匹配词(word)的开始(\<)和结束(\>)。例如正则表达式\<the能够匹配字符串"for wise="" otherwise="" 9="" him="" her="" it="" belongs="" to="" rat="" in="" a="" rut="" food="" rotten="" i="" like="" root="" beer="" grep="" txt="" he="" t="" or="" vi="" bug="" 1t="" 1="" comma="" separated="" 95011="" 95012="" amos="" 95013="" 95014="" bill="" tek="" corporation="" sharon="" lee="" design="" works="" incorporated="" hill="" street="" cafe="" alexander="" ca="" the="" crafts="" store="" 2="" g="" 3="" simple="" is="" s="" billy="" sally="" timmy="" johnny="" tried="" very="" hard="" really="" coming="" regular="" visual="">Replace,然后选择"Regular expression"选择框,Find What输入框对应上面介绍的vi命令:%s/pat1/pat2/g中的pat1部分,而Replace输入框对应pat2部分。但是,为了得到vi的执行范围和g选项,你要使用Replace All或者适当的手工Find Next and Replace(译者按:知道为啥有人骂微软弱智了吧,虽然VC中可以选中一个范围的文本,然后在其中执行替换,但是总之不够vi那么灵活和典雅)。
<br />sed
<br />
<br />Sed是Stream EDitor的缩写,是Unix下常用的基于文件和管道的编辑工具,可以在手册中得到关于sed的详细信息。
<br />
<br />这里是一些有趣的sed脚本,假定我们正在处理一个叫做price.txt的文件。注意这些编辑并不会改变源文件,sed只是处理源文件的每一行并把结果显示在标准输出中(当然很容易使用重定向来定制):
<br />
<br />sed脚本 描述
<br />
<br />sed 's/^$/d' price.txt 删除所有空行
<br />sed 's/^[ \t]*$/d' price.txt 删除所有只包含空格或者制表符的行
<br />sed 's/"//g' price.txt 删除所有引号
<br />awk
<br />awk是一种编程语言,可以用来对文本数据进行复杂的分析和处理。可以在手册中得到关于awk的详细信息。这个古怪的名字是它作者们的姓的缩写(Aho,Weinberger和Kernighan)。
<br />
<br />在Aho,Weinberger和Kernighan的书The AWK Programming Language中有很多很好的awk的例子,请不要让下面这些微不足道的脚本例子限制你对awk强大能力的理解。我们同样假定我们针对price.txt文件进行处理,跟sed一样,awk也只是把结果显示在终端上。
<br />
<br />awk脚本 描述
<br />
<br />awk '$0 !~ /^$/' price.txt 删除所有空行
<br />awk 'NF > 0' price.txt awk中一个更好的删除所有行的办法
<br />awk '$2 ~ /^[JT]/ {print $3}' price.txt 打印所有第二个字段是'J'或者'T'打头的行中的第三个字段
<br />awk '$2 !~ /[Mm]isc/ {print $3 + $4}' price.txt 针对所有第二个字段不包含'Misc'或者'misc'的行,打印第3和第4列的和(假定为数字)
<br />awk '$3 !~ /^[0-9]+\.[0-9]*$/ {print $0}' price.txt 打印所有第三个字段不是数字的行,这里数字是指d.d或者d这样的形式,其中d是0到9的任何数字
<br />awk '$2 ~ /John|Fred/ {print $0}' price.txt 如果第二个字段包含'John'或者'Fred'则打印整行
<br />grep
<br />grep是一个用来在一个或者多个文件或者输入流中使用RE进行查找的程序。它的name编程语言可以用来针对文件和管道进行处理。可以在手册中得到关于grep的完整信息。这个同样古怪的名字来源于vi的一个命令,g/re/p,意思是global regular expression print。
<br />
<br />下面的例子中我们假定在文件phone.txt中包含以下的文本,——其格式是姓加一个逗号,然后是名,然后是一个制表符,然后是电话号码:
<br />
<br /> Francis, John 5-3871
<br /> Wong, Fred 4-4123
<br /> Jones, Thomas 1-4122
<br /> Salazar, Richard 5-2522
<br />
<br />grep命令 描述
<br />
<br />grep '\t5-...1' phone.txt 把所有电话号码以5开头以1结束的行打印出来,注意制表符是用\t表示的
<br />grep '^S[^ ]* R' phone.txt 打印所有姓以S打头和名以R打头的行
<br />grep '^[JW]' phone.txt 打印所有姓开头是J或者W的行
<br />grep ', ....\t' phone.txt 打印所有姓是4个字符的行,注意制表符是用\t表示的
<br />grep -v '^[JW]' phone.txt 打印所有不以J或者W开头的行
<br />grep '^[M-Z]' phone.txt 打印所有姓的开头是M到Z之间任一字符的行
<br />grep '^[M-Z].*[12]' phone.txt 打印所有姓的开头是M到Z之间任一字符,并且点号号码结尾是1或者2的行
<br />egrep
<br />egrep是grep的一个扩展版本,它在它的正则表达式中支持更多的元字符。下面的例子中我们假定在文件phone.txt中包含以下的文本,——其格式是姓加一个逗号,然后是名,然后是一个制表符,然后是电话号码:
<br />
<br /> Francis, John 5-3871
<br /> Wong, Fred 4-4123
<br /> Jones, Thomas 1-4122
<br /> Salazar, Richard 5-2522
<br />
<br />egrep command Description
<br />
<br />egrep '(John|Fred)' phone.txt 打印所有包含名字John或者Fred的行
<br />egrep 'John|22$|^W' phone.txt 打印所有包含John 或者以22结束或者以W的行
<br />egrep 'net(work)?s' report.txt 从report.txt中找到所有包含networks或者nets的行
<br />正则表达式语法支持情况
<br /></the能够匹配字符串"for><table border="1" cellspacing="0"><tbody><tr><td><b>Command or</b>
<br /><b>Environment</b></td> <td><b><tt><span style="font-family:Courier New;">.</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">[ ]</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">^</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">$</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">\( \)</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">\{ \}</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">?</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">+</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">|</span></tt></b></td> <td><b><tt><span style="font-family:Courier New;">( )</span></tt></b></td> </tr> <tr> <td>vi</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>Visual C++</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>awk</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>sed</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>Tcl</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>ex</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>grep</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>egrep</td> <td> X </td> <td> X</td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> </tr> <tr> <td>fgrep</td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td> X </td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> <td>
<br /></td> </tr> <tr> <td>perl</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>
<br /></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td></tr></tbody></table>
<br /><the能够匹配字符串"for wise="" otherwise="" 9="" him="" her="" it="" belongs="" to="" rat="" in="" a="" rut="" food="" rotten="" i="" like="" root="" beer="" grep="" txt="" he="" t="" or="" vi="" bug="" 1t="" 1="" comma="" separated="" 95011="" 95012="" amos="" 95013="" 95014="" bill="" tek="" corporation="" sharon="" lee="" design="" works="" incorporated="" hill="" street="" cafe="" alexander="" ca="" the="" crafts="" store="" 2="" g="" 3="" simple="" is="" s="" billy="" sally="" timmy="" johnny="" tried="" very="" hard="" really="" coming="" regular="" visual="">
<br />
<br />vi替换命令简介
<br />Vi的替换命令:
<br />
<br /> :ranges/pat1/pat2/g
<br />
<br />其中
<br />
<br /> : 这是Vi的命令执行界面。
<br />
<br /> range 是命令执行范围的指定,可以使用百分号(%)表示所有行,使用点(.)表示当前行,使用美元符号($)表示最后一行。你还可以使用行号,例如10,20表示第10到20行,.,$表示当前行到最后一行,.+2,$-5表示当前行后两行直到全文的倒数第五行,等等。
<br />
<br /> s 表示其后是一个替换命令。
<br />
<br /> pat1 这是要查找的一个正则表达式,这篇文章中有一大堆例子。
<br />
<br /> pat2 这是希望把匹配串变成的模式的正则表达式,这篇文章中有一大堆例子。
<br />
<br /> g 可选标志,带这个标志表示替换将针对行中每个匹配的串进行,否则则只替换行中第一个匹配串。
<br />
<br />网上有很多vi的在线手册,你可以访问他们以获得更加完整的信息。</the能够匹配字符串"for>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-85788178262387439302008-12-04T16:44:00.001+08:002008-12-05T09:54:44.710+08:00Linux Kernel网络参数调优在/etc/sysctl.conf 中加入下面的配置,<br /><p><code># 开启TCP滑动窗口以便程序可以使用TCP数据包扩展位来增大滑动窗口的大小,提高网络性能 Fedora和很多发行版已经默认开启<br />net.ipv4.tcp_window_scaling = 1</code><br /># 开启SYN Cookie,以便更好的应付SYN洪水之类过多连接请求的情况,一些发行版已经开启该项,Fedora默认没有开启<br /><code>net.ipv4.tcp_syncookies = 1<br /></code># 下面四项增大TCP发送和接收缓冲区,以便网络程序更快的处理网络数据<br /><code>net.core.rmem_max = 16777216</code><br /><code>net.core.wmem_max = 16777216</code><br /><code>net.ipv4.tcp_rmem = 4096 87380 16777216</code><br /><code>net.ipv4.tcp_wmem = 4096 65536 16777216</code></p><p><code>前两项有些发行版已经打开,分别是开启TCP滑动窗口和SYN Cookie的功能;后面的四项加大了TCP的发送接收缓冲区大小!比较关乎网络的性能!</code></p><p><code>针对Linux Kernel 2.6的新特性,不缓存ssthresh连接<br />net.ipv4.tcp_no_metrics_save = 1<br />net.ipv4.tcp_moderate_rcvbuf = 1 # Fedora 默认开启<br /></code></p><p><code>sysctl -p /etc/sysctl.conf<br />命令来使设置生效<br /></code></p>sysctl -q 可以用来查询某个具体kernel选项的当前值!<br />切记:SysCtl 的任何调整都要非常小心!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-49939087816425929982008-12-02T20:35:00.002+08:002008-12-02T21:03:37.545+08:00几个Linux管理员应该注意的习惯问题最近整理了一些自己的思路和过往的工作,也有空看了一些别人的建议,发觉一些作为Linux管理员或者对于其他系统管理员也有益的要点。温故而知新,起所以然也。<br /><br /><span style="font-weight: bold;">尽量采用一致的方法安装软件,除非有有特殊情况;</span><br />很多人会像我以前一样,一上来很喜欢用源代码装东西,觉得很酷,其实对于一个管理员,在自己管理的系统,特别是一些生产系统上使用源代码安装软件有很多坏处,不统一是最大的问题。尽管Open Source固然可以让我们一切从头开始,如果这样的话,发行版出了LFS之外,都没什么意义了不是。<br />我比较遵循的原则是尽可能使用官方的发布软件包,其次是比较有名第三方软件库,这些并不太难找!像REDHAT系统,CentOS之类的,Fedora EPEL <a href="http://fedoraproject.org/wiki/EPEL">EPEL Extra Packages for Enterprise Linu</a>x是首选,其次有很多第三方的库可以选择,如Perl模块,DAG的库就很全;最次就是寻找软件包发行的SRC包,自行编译相应的二进制包,不过这一步对于比较重要的系统,还是建议在测试环境上编译,安装测试。最次才是使用源代码安装。不过,对于WEB应用这类东西,源代码安装很多时候也是唯一的选择!未来维护源代码安装的软件是需要规划的!使用统一的包管理方式安装软件无论无何你的首选。<br /><br /><span style="font-weight: bold;">及时更新系统,注意系统安全</span><br />Linux是很安全的,但是请不要无视安全更新!这样的代价或许是你无法承担的。<br />注意系统安全,启用简单的防火墙(iptables默认一般是开启的,没有什么坏处),使用强壮的根用户密码;对于比较新的的系统,稍加注意,完全可以启用SELinux或者AppArmor这些扩展安装机制,不用惧怕而轻易的disable它们,安全问题远比你我想象的复杂!<br /><br /><span style="font-weight: bold;">惧怕命令行</span><br />很多人惧怕命令行,其实命令行是很多管理员在很多时候唯一的选择(特别是远程维护管理的系统),惧怕是没有用的。驯服命令行是必修课。我的经验是驯服命令行一定要学会使用man和在线联机帮助。几乎所有的命令都有详细的手册和使用帮助,与其查阅其他文档,何不使用联机帮助,随用随查,多查查,自然就熟悉了!<br /><br /><span style="font-weight: bold;">备份重要文件</span><br />备份重要文件,不一定非要制定详细的备份计划,并严格的执行,当然那是产品系统的必须!很多时候,好的管理员知道随时备份自己的重要文件,诸如桌面的X配置文件,服务器的web配置文件,mysql参数文件,php的ini文件和很多自己的管理脚本,很多看似根本谈不上要采用完整备份方案或备份计划执行备份的文件,其实对你很重要,不要忘了它们。至于备份方式,不一而足,USB盘都可以,还有一种我经常采用的方式,快捷而有效,就是在不同的主机间相互备份重要的文件。当然这些事情很多时候并不会被作为工作业绩汇报给你的老板,其实这是为了管理员自己,这是一种习惯和态度!<br /><br /><span style="font-weight: bold;">注意文件权限</span><br />经常看到有人动不动把文件属性都改成777,这样的坏处我就不想列举了,其实在SELinux或者ACL启用的系统上,此举未必真的有效。理解文件属性和合理的权限!当然,请也学习一点关于ACL,SELinux规则以及AppArmor设置的知识,至少不让自己显得那么业余!归根到底,还是安全和良好的习惯。<br /><br /><span style="font-weight: bold;">不要只使用root</span><br />我在很多时候也是只使用root用户的人,这样不好!这个坏习惯真的很讨厌!<br /><br /><span style="font-weight: bold;">关注你的日志</span><br />日志文件不是一种摆设,请关注一下你的日志。分析日志的工具实在很多,Fedora和RedHat系统带有一些最简单的分析工具。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-75947651121358829232008-11-26T08:54:00.002+08:002008-11-26T09:10:39.466+08:00Fedora 10和RPM FusionFedora在发布的时候最大程度的去除了RedHat认为有问题的软件,主要是出于License的考虑,这个问题一直是很多桌面用户对Fedora的诟病,RPM Fusion将会很大程度上弥补Fedora官方库缺乏的一些“问题”软件。<br />首先RPM Fusion是原来三大第三方仓库的融合,<br /><br /><ul><li><ul><li><p class="line891"><a class="http" href="http://dribble.org.uk/">Dribble</a> <span class="anchor" id="line-4"></span></p></li><li><p class="line891"><a class="http" href="http://freshrpms.net/">Freshrpms</a> <span class="anchor" id="line-5"></span></p></li><li><p class="line891"><a class="http" href="http://rpm.livna.org/">Livna</a></p></li></ul><div style="text-align: left;">RPM Fusion也不仅仅针对Fedora,还针对RedHat企业版linux及其兼容的系统如CentOS等支持。</div></li><li>配置RPM Fusion<br />RPM Fusion分成Free软件库和nonfree软件库,这个和Ubuntu类似,<br />针对最新版的Fedora(8,9,10),下载和安装<a href="http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm">Free</a> 和<a href="http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm"> nonfree</a>的;<br />对于RedHat企业版和CentOS等,下载和安装 <a href="http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm">Free</a> 和 <a href="http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm">nonfree</a> 的;<br />直接命令行安装,<br />Fedora 8, 9 or 10: <span class="anchor" id="line-20"></span><span class="anchor" id="line-21"></span><br />su -c 'rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'<br /><br />Fedora Alpha, Beta, Preview, Rawhide, RC, Snapshot: <span class="anchor" id="line-24"></span><span class="anchor" id="line-25"></span><br />su -c 'rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-rawhide.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-rawhide.noarch.rpm'<br /><br />RHEL5 or compatible like CentOS: <span class="anchor" id="line-28"></span><span class="anchor" id="line-29"></span><br />su -c 'rpm -ivh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm'<br />对于CentOS等系统,需要先激活EPEL的仓库,<br />关于EPEL, <a href="http://fedoraproject.org/wiki/EPEL">EPEL Extra Packages for Enterprise Linu</a>x,是Fedora的项目,旨在提供高品质的RedHat企业版Linux的兼容扩展软件,以方便更好的部署Open Source应用。 </li><li>验证<a href="http://rpmfusion.org/keys">RPM Fusion的签名证书</a><br /></li><li><br /></li></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-46471769174140755782008-11-24T22:07:00.002+08:002008-11-24T22:17:20.534+08:00'tar'出系统全备份简单的用tar做Linux等系统的全备份是比较快速和便捷的备份方法,特别是当备份介质是大容量的USB硬盘或其他网络硬盘的话,这看起来更加合理有效和快速。<br />下面的命令很简单,也很实用,<br />tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/media --exclude=/sys /<br />这里的命令参数只是exclude,无须多少解释!有时候可能/dev等目录也未必需要,所以你可能需要一个更长的exclude列表。<br />而恢复上面的备份看起来似乎更加方便,命令如下,<br />tar xvpfz backgup.tgz -C /<br />而对于exclude列表中的目录或许你需要手动创建.<br />此外,从这个全备份中恢复部分数据也相当方便,命令,<br />tar -zxvpf backup.tgz /path/filename<br />对于一个系统,除了这个全备份之外,再备份个MBR就比较完整了。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-71964053635229756712008-10-18T22:18:00.002+08:002008-10-18T22:30:32.727+08:00升级到Ubuntu 8.10面对的几个问题!本来有计划升级自己的桌面系统到8.10版本的Ubuntu去,在检视了升级文档之后,觉得暂时停止行动,有待8.10正式发布后再看!<br />从我的系统来看,使用的第三方的软件库不是很多,用到了medibuntu的媒体库和banshee那个特定发行,现在还不确定banshee是不是可以移去,medibuntu是很重要的第三方库,就看它的速度如何?检视medibuntu的官方页面,http://packages.medibuntu.org/,发现针对8.10的包已经可用!<br /><br />针对已经的一些问题,主要分析不利因素有,<br />对于日常使用,不能从Evolution等GNOME程序直接点开连接将是很不舒服的一件事情,而且这个fix应该只是wrapper脚本的问题,很快可以解决的;<br />而对于选择升级的用户必须谨慎对待 NetworkManager 0.7和当前网络配置(/etc/network/interfaces)不兼容的问题,解决方法是停止 NetworkManager服务;<br />对于nVidia用户需要注意的是一个问题,无法正常识别不被支持的显卡;<br /><br />等待8.10的正式发布,时间应该不多了!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-42546736990324134132008-09-09T15:32:00.002+08:002008-09-09T15:35:57.333+08:00Some Ukulele Music(Clara Belle)I found the Music author when I am searching funny music on YouTube.<br />This is the first time I listen some Ukulele music.<br />I think it is very nice!<br /><br /><br /> <a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/3BayyAIdr4o&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/3BayyAIdr4o&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/3BayyAIdr4o&hl=en&fs=1"></a><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3BayyAIdr4o&hl=en&fs=1"><param name="allowFullScreen" value="true"><embed src="http://www.youtube.com/v/3BayyAIdr4o&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /><br /> <a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/A6ujWEyNgbQ&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/A6ujWEyNgbQ&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/A6ujWEyNgbQ&hl=en&fs=1"></a><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/A6ujWEyNgbQ&hl=en&fs=1"><param name="allowFullScreen" value="true"><embed src="http://www.youtube.com/v/A6ujWEyNgbQ&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /> <a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/H1RXfiRPE74&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/H1RXfiRPE74&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/H1RXfiRPE74&hl=en&fs=1"></a><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/H1RXfiRPE74&hl=en&fs=1"><param name="allowFullScreen" value="true"><embed src="http://www.youtube.com/v/H1RXfiRPE74&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /> <a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/17IRhh673_c&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/17IRhh673_c&hl=en&fs=1"></a><a style="left: 0px ! important; top: 13px ! important;" title="点击这里使 Adblock Plus 过滤该对象" class="abp-objtab-06319681798145474 visible ontop" href="http://www.youtube.com/v/17IRhh673_c&hl=en&fs=1"></a><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/17IRhh673_c&hl=en&fs=1"><param name="allowFullScreen" value="true"><embed src="http://www.youtube.com/v/17IRhh673_c&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6427452.post-38050259811507083582008-09-03T14:36:00.005+08:002008-09-04T09:45:22.473+08:00Google浏览器Chrome和开源项目ChromiumGoogle终于发布了它的浏览器--Chrome以及Chrome基于的开源项目Chromium。<div>Chrome是怎样的一个产品呢!</div><div>首先Chrome基于WebKit的浏览器解析引擎,加上Google全新开源项目V8的Javascript解析器,技术上来说没有太多其他新的东西引入,但是Google的整合功力从Chrome上可见一斑,Chrome无论是速度还是一般的解析效果都没话说!只是还处于测试版本的Chrome对于一些特殊的页面和应用还有些问题,这也是正常的!</div><div>一些关于浏览器技术的资料,</div><div><br /></div><div>Chrome属性页面,类似Firefox的about:config</div><div><br /></div><div><span class="Apple-style-span" style="font-family: Tahoma; font-size: 12px; "><li><big>"about:network": 查看网络状态。</big></li><li><big>"about:stats": 查看浏览器状态。</big></li><li><big>"about:cache":查看缓存。</big></li><li><big>"about:histograms": 可能是比较各种运行数据。</big></li><li><big>"about:plugins":插件管理。</big></li><li><big>"about:dns"dns查看。</big></li><li><big>"about:version": 版本<br /></big></li><li><big>"about:memory": 内存使用<br /></big></li><li><big>"about:crash": 浏览器崩溃页</big></li></span><div><span class="Apple-style-span" style="font-family: Tahoma; font-size: 14px;"><br /></span></div><div><span class="Apple-style-span" style="font-family: Tahoma; font-size: 14px;"><br /></span></div></div><div>三大Web解析引擎:</div><div><a href="http://www.microsoft.com/">IE</a> -- 微软独家技术垄断;</div><div><a href="http://www.mozilla.org/newlayout">Gecko</a> -- Mozilla解析引擎,从Netscape的解析引擎演化而来;</div><div><a href="http://webkit.org/">WebKit</a> -- Apple的Safari,KDE的浏览器以及Google的Chrome所使用的引擎;</div><div><br /></div><div><a href="http://code.google.com/apis/v8">JavaScript引擎V8</a></div><div><a href="http://dev.chromium.org/Home">Chromium开发者主页</a></div><div><br /></div><div><br /></div><div><br /></div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6427452.post-62152579437907446742008-08-19T23:19:00.002+08:002008-08-19T23:49:02.970+08:00掌握几个处理Linux网络必须的小技巧处理Linux系统时,网络几乎是不可能回避的话题,即使是Linux作为桌面系统也一样,无线网络的支持一直是Linux的一个弱项,如今也大可不必为此担忧,WICD应该可以搞定大部分无线网络配置的问题,是桌面linux可以选择的一个不错的工具,WICD官方网站,<br />http://wicd.sourceforge.net<br />对于Ubuntu/Debian系统,可以在apt源中添加相应的项解决,<br />deb http://apt.wicd.net hardy extras / deb http://apt.wicd.net debian extras<br />在Fedora/RedHat系统上安装会比较复杂,需要关闭NetworkManager服务, 并启动wicd服务,具体安装见http://wicd.net/wiki/doku.php?id=fedora,(在最新的Ubuntu上NetworkManager也是默认的服务,应该关闭);<br />使用NetworkManager还是WICD,个人以为看具体需求了,NetworkManager发展至今也不错了!WICD可能具有更加全的功能;<br /><br />处理了网络配置的问题,还有几个必须掌握的基本技巧需要列一下的,<br />/etc/hosts文件的配置,这个简单而历史悠久的文件确实还有用处,应该注意一下的,它的格式一般如下,<br />ip地址 主机名字/别名 全域名的主机名字<br />其他的IP地址和主机名列表,需要注意的是IPv6的地址也已经被各大发行版加入!<br /># The following lines are desirable for IPv6 capable hosts<br />::1 ip6-localhost ip6-loopback<br />fe00::0 ip6-localnet<br />ff00::0 ip6-mcastprefix<br />ff02::1 ip6-allnodes<br />ff02::2 ip6-allrouters<br />ff02::3 ip6-allhosts<br />上面这段是Ubuntu最新版本中的一段!<br />关于主机名的问题和hosts文件还有一篇旧文<a href="http://a3linux.blogspot.com/2006/06/linuxhostname.html">连接于此</a>!<br />另外基于IP Wrapper(IP包裹)这种最原始的访问控制依然有效,且稳妥至极,<br />/etc/hosts.deny和/etc/hosts.allow设置得当还是可以有不错的效果。<br /><br />iptables必须要掌握一点的,至于使用iptables的前台程序如Firestarter未见得是很好的主意,iptables如果不涉及转发和NAT,基本可以参照各个发行版默认的规则依葫芦画飘的,关于转发和NAT部分参见相关的文档。<br /><br />DNS还是使用硬code写死的方式会比较好!<br />在/etc/resolv.conf文件中写上<br />nameserver ip_address会省去很多麻烦的!<br /><br />手工的配置网卡地址,一般的用ifconfig命令手工配置网卡地址还是要记一下的,<br />/sbin/ifconfig eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255<br />当然相应的系统网卡配置文件应当知道,对于Ubuntu/Debian类系统的/etc/network/interfaces文件和Fedora/RedHat系统的/etc/sysconfig/network-scripts/ifcfg-eth* 文件的功能和格式应当比较了解,方能处理这些系统的网络基础问题。<br />auto lo<br />iface lo inet loopback<br /><br /><br />iface eth0 inet static<br />address 192.168.1.2<br />netmask 255.255.255.0<br />gateway 192.168.1.1<br /><br />auto eth0<br />这是Ubuntu系统interfaces文件的例子,配置了静态地址。<br />DEVICE=eth0<br />BOOTPROTO=dhcp<br />HWADDR=00:16:3E:52:82:75<br />ONBOOT=yes<br />DHCP_HOSTNAME=centos5<br />这是RedHat系统的例子,使用的是DHCP方式。<br /><br />这里简单总结了一些自己的使用经验,开个头,以后需要补充更多的东西!Unknownnoreply@blogger.com0