How To Get Started with CentOS Minimal

I wanted to share with everyone a little post about my exposure to CentOS 6.2 Minimal. If you are not aware with the latest release of CentOS 6.2 there is now a “Minimal” ISO option. Now let me tell you first off when they say minimal….it’s got next to nothing. Personally, I love that fact because there is zero bloat to it. If you are an admin or even a developer working on virtual appliances, this could be the solution for you. I decided to use it to build my own vCloud Catalog image on Virtacore so I could deploy it and use it for my Bitnami wordpress stack install. I have always been a fan of CentOS for my home lab and this release is no exception now that it is just so Read More

Step by Step install of CentOS 6.3 on Microsoft Hyper-V Server with Linux Integration Services Version 3.4

Create new VHD w/ Legacy Network Adapter for CentOS 6.3 Download CentOS 6.3-minimal.iso (insert disk & install) Download LinuxICv34.iso (insert disk) mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom cp -rp /mnt/cdrom /opt/linux_ic umount /mnt/cdrom cd /opt/linux_ic/RHEL63 ./install.sh Once the install is down, shutdown the VPS, note the mac address and then remove the legacy adapter. Add a standard network adapter with static mac previously noted. apply and restart the VPS Update your network settings via vi vi /etc/sysconfig/network-scripts/ifcfg-eth0 use “i” to insert text, (esc) to exit and “:wq” to write your changes. IT should look something like Read More

对LINUX服务器网卡进行带宽限制的办法:

对LINUX服务器网卡进行带宽限制的办法: 1、安装iproute yum -y install iproute 2、限制eth0网卡的带宽为100kbit: /sbin/tc qdisc add dev eth0 root tbf rate 500kbit latency 50ms burst 15kb   3、解除eth0网卡的带宽限制: /sbin/tc qdisc del dev eth0 root tbf       4、列出已有的策略: tc -s qdisc ls dev eth0   5、启动时自动加载带宽限制策略: vim /etc/rc.local 加入: /sbin/tc qdisc add dev eth0 root tbf rate 500kbit latency 50ms burst 15kb  参考资料:http://www.cyberciti.biz/faq/linux-traffic-shaping-using-tc-to-control-http-traffic/ PS:转载请注明出处,谢谢! Read More

linux使用dd命令快速生成大文件

dd命令可以轻易实现创建指定大小的文件,如 dd if=/dev/zero of=test bs=1M count=1000 会生成一个1000M的test文件,文件内容为全0(因从/dev/zero中读取,/dev/zero为0源) 但是这样为实际写入硬盘,文件产生速度取决于硬盘读写速度,如果欲产生超大文件,速度很慢 在某种场景下,我们只想让文件系统认为存在一个超大文件在此,但是并不实际写入硬盘 则可以 dd if=/dev/zero of=test bs=1M count=0 Read More

MYSQL导入与导出

1.导出整个数据库   mysqldump -u 用户名 -p 数据库名 > 导出的文件名   mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql 2.导出一个表   mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名   mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql 3.导出一个数据库结构   mysqldump -u wcnc -p -d –add-drop-table smgp_apps_wcnc >d:wcnc_db.sql   -d 没有数据 –add-drop-table 在每个create语句之前增加一个drop table 4.导入数据库   常用source 命令   进入mysql数据库控制台,   如mysql -u root -p   mysql>use Read More

LINUX DNS被防火墙拦截的解决办法

今天一个客户域名PING不通,检查了半天没有发现什么异常,NS设置没有问题,服务器上NS服务也都在跑。 后来才想到下午启用了IPTABLES,该不会是把DNS端口封掉了吧。。 果断进服务器service iptables stop,果然可以访问了。 打开防火墙配置文件:vim /etc/sysconfig/iptables 加两条防火墙规则: –A RH-Firewall-1-INPUT -p tcp -m tcp –dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m udp –dport 53 -j ACCEPT 保存退出后service iptables restart 再试,就OK了。。 顺便说下,禁止PING加上这句就可以了。 -A RH-Firewall-1-INPUT -p icmp –icmp-type any -j DROP Read More

linux top命令详解

top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器。下面详细介绍它的使用方法。 top – 01:06:48 up 1:22, 1 user, load average: 0.06, 0.60, 0.48 Tasks: 29 total, 1 running, 28 sleeping, 0 stopped, 0 zombie Cpu(s): 0.3% us, 1.0% sy, 0.0% ni, 98.7% id, 0.0% wa, 0.0% hi, 0.0% si Mem: 191272k total, 173656k used, 17616k free, 22052k buffers Swap: 192772k total, 0k used, 192772k free, 123988k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1379 root 16 0 7976 2456 1980 S 0.7 1.3 0:11.03 sshd 14704 Read More

eaccelerator optimization

In one of our previous articles here, we had written about eAccelerator and metioned that it should significantly reduce the server load while increasing its speed from 1 to 10 times. But during the evaluation of eAccelerator under 1000+ http req/sec. conditions, we have noticed that Apache repeatedly launches child processes untill it reaches the MaxClients server limit and causes abnormal load averages to bring multi-core and multi-cpu performance servers on their knees just in seconds. When we debug the issue, we have noticed that all complaints in gdb backtraces were somehow about nothing but Zend. We know eAccelerator has been reported to work with Zend many times but we realised Read More

linux批量更改后缀名

一.rename解决 1. Ubuntu系统下 rename ‘s//.c//.h/’ ./* 把当前目录下的后缀名为.c的文件更改为.h的文件 2. CentOS5.5系统下 rename .c .h *.c 把当前目录下的后缀名为.c的文件更改为.h的文件 二.shell 脚本解决 #!/bin/bash #http://blog.csdn.net/longxibendi find ./ -name *.c | while read i do echo “$i”; mv $i.c $i.h done 三.find xargs 解决 find ./ -name “*.c” | awk -F “.” ‘{print $2}’ | xargs -i -t mv ./{}.c Read More