Purge postfix mail queue
November 14th, 2011So ugly, but actually working if needed:
for mailid in
`mailq | awk -F' ' '{ if ( $1 ~ /^[A-F0-9]/ ) { print $1; } }'`; do
postsuper -d $mailid;
donemultipath, display blacklisted devices
November 11th, 2011A very simple command that can help troubleshooting a multipath configuration on linux, that you may already know about:
[root@linuxsrv ~]# multipathd -k > show devices [...] > show blacklist [...] >help
“help” is my favorite ![]()
Twitter plugin and b2evolution
September 24th, 2011If you’ve set b2evolution as your blog/cms engine a long time ago, you might have not set the short URL stuff.
By default, the twitter plugin use these short URLs to post the links to your blog… This is sad…
Here is how to fix this, getting the twitter plugin posting the whole URL to the post.
On line 148 of file plugins/twitter_plugin/_twitter.plugin.php, replace
'url' => $params['Item']->get_tinyurl(),
by
'url' => $params['Item']->get_url('public_view'),
You’re done!
KVM and PXE boot
September 24th, 2011Once a KVM guest has been installed, it usually boots on the hard drive, that’s a fact ![]()
But if for some reason this guest crashes and needs to be booted in rescue mode, on the network, then here is how to make it boot on the network using the command line (I know, if you’re using virt-manager, a couple of mouse clics and you’re done!
)
1/ Modify the KVM guest definition
Edit the KVM guest definition file that is located in /etc/libvirt/qemu/. This file is usually named KVMguestname.xml
Add the entry <boot dev='network'/> in the <os> element, right before the hd entry:
<os>
<type arch='x86_64' machine='rhel5.4.0'>hvm</type>
<boot dev='network'/>
<boot dev='hd'/>
</os>
2/ Stop the KVM guest if running
If the KVM guest is not running, then you can skip this step.
Otherwise, if the guest is supporting acpi (and acid daemon is installed and running if the guest is running Linux) then:
[root@kvmhost:~ ]# virsh shutdown KVMguestname
You can also shut the KVM guest down using virsh destroy or init 5 within the KVM itself
3/ Redefine the KVM guest
As the KVM guest definition has been modified, the definition must be reloaded.
[root@kvmhost:~ ]# virsh define /etc/libvirt/qemu/KVMguestname.xml
4/ Start the KVM guest
It is now time to boot the guest on the network!
[root@kvmhost:~ ]# virsh start KVMguestname
I would recommend that you get a connection to the guest console to see what happens
[root@kvmhost:~ ]# virt-viewer KVMguestname
Enjoy!
processes, ps and grep
September 23rd, 2011Here is a simple way to get rid of grep processname showing up in the output of
[user@server ~]# ps aux | grep nsrexec root 2611 0.0 0.2 162416 7856 ? Ssl 17:37 0:00 /usr/sbin/nsrexecd root 3228 0.0 0.0 61180 732 pts/0 S+ 18:09 0:00 grep nsrexec
You can simply use square brackets as shown below.
[user@server ~]# ps aux | grep nsre[x]ec root 2611 0.0 0.2 162416 7856 ? Ssl 17:37 0:00 /usr/sbin/nsrexecd
This is happening because the expression /nsre[x]ec/ does not match the string "nsre[x]ec"
Enjoy!
