Tuesday, December 30, 2014

set up an openstack test environment

This is just for testing openstack in a virtual environment. With nested KVM, we can control all the networks(public, private).

1. Setup nested KVM environment by following this article:

https://openstack.redhat.com/Multi-node_Openstack_with_Neutron_with_libvirt,_netsted_kvm,_virt-manager_and_qcow2_images

2. Follow this article to enable external access:

https://openstack.redhat.com/Neutron_with_existing_external_network

3. Follow this one to add more nodes:

https://openstack.redhat.com/Adding_a_compute_node

Tested with openstack icehouse, and CentOS 6.6 as the openstack nodes.

Thursday, December 18, 2014

puppet tutorials



https://www.digitalocean.com/community/tutorials/getting-started-with-puppet-code-manifests-and-modules

  1. How To Install Puppet To Manage Your Server Infrastructure

  2. Getting Started With Puppet Code: Manifests and Modules

  3. How To Use Foreman To Manage Puppet Nodes on Ubuntu 14.04

Thursday, December 11, 2014

resolving svn confilict

http://www.tutorialspoint.com/svn/svn_resolve_conflicts.htm

Friday, October 31, 2014

pxe document


Official one:

http://www.syslinux.org/wiki/index.php/PXELINUX

Fedora:

http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/s1-netboot-pxe-config.html



Tuesday, August 26, 2014

move /var to a new partition or directory


http://blog.oshim.net/2011/10/how-to-move-var-folder-to-new-partition.html

http://serverfault.com/questions/344014/proper-way-to-remap-a-partition-to-a-new-disk



Tuesday, February 11, 2014

Find top 10 biggest files/directories from Linux shell

When disk is about full and I have to delete some files, I want to find the biggest file or directory and then probably delete it.

Following commands find the largest directories/files in current directory:
for i in $(ls); do du -s -h $i; done | sort -h  -r | head -n 10
 Sample output:
for i in $(ls); do du -s -h $i; done | sort -h  -r | head -n 10
4.9G    lib
231M    cache
23M     log
2.3M    backups
116K    spool
4.0K    tmp
4.0K    opt
4.0K    metrics
4.0K    mail
4.0K    local

Another similar command which is less helpful due to some duplicate info:

du -a -h /var | sort -h -r | head -n 10
Sample output:
# du -a -h /var | sort -h -r | head -n 10
5.1G    /var
4.9G    /var/lib
4.6G    /var/lib/libvirt/images/vn1.img
4.6G    /var/lib/libvirt/images
4.6G    /var/lib/libvirt
263M    /var/lib/apt/lists
263M    /var/lib/apt
231M    /var/cache
112M    /var/cache/pbuilder/aptcache
112M    /var/cache/pbuilder 

Note, the 2nd command is copied from here: http://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/

But I put -h  for both du and sort commands so that the result is easier to read (Otherwise, you will probably get a very long sequences of numbers). When  using -h, both du and sort need to be consistent, otherwise, it will give wrong output, like following:

# du -a -h /var | sort -r | head -n 10
988K    /var/cache/pbuilder/aptcache/libssl1.0.0_1.0.1-4ubuntu3_amd64.deb
976K    /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-amd64_Packages
96M     /var/cache/apt-xapian-index/index.1  ### should move up, and vn1.img is missing.