Ubuntu Tips

查看ubuntu已经安装的包(How to list all installed Ubuntu packages)

To get a list of packages installed locally do this in your terminal:

dpkg --get-selections | grep -v deinstall

To save that list to a text file called packages on your desktop do this in your terminal:

dpkg --get-selections | grep -v deinstall > ~/Desktop/packages

(you don’t need to run this as the superuser, so no sudo necessary here)

Source

把当前的ubuntu安装精简到ubuntu-minimal. (Remove all packages from Ubuntu except ubuntu-minimal)

It’s fairly easy with aptitude. First, make sure you have it and ubuntu-minimal installed:

sudo apt-get install aptitude ubuntu-minimal

Then, mark all packages as being automatically installed, except ubuntu-minimal:

sudo aptitude markauto '~i!~nubuntu-minimal'

After that, you should be left with only ubuntu-minimal, and the things it depends on.

WARNING: This doesn’t include a kernel, so I suggest installing linux-image-generic immediately.

Source

Ubuntu下supervisord的自启动 Automatically start supervisord on Ubuntu

Actually, I found one that works here https://gist.github.com/Gohan/9706689. To install it:

sudo curl https://gist.githubusercontent.com/Gohan/9706689/raw/f8cdee4bb3ca34f43e0fe839850f6cf01fc9b9a7/supervisord.sh -o /etc/init.d/supervisord

to run it

sudo chmod +x /etc/init.d/supervisord

and to automatically schedule it, do

sudo update-rc.d supervisord defaults

Make ensure correct pid in /etc/supervisord.conf which is mapped in /etc/init.d/supervisord
注意要让supervisord配置的pid路径和这个init脚本匹配(修改成如下)

example: pidfile=/var/run/supervisord.pid

Stop and Start work properly

sudo service supervisord stop
sudo service supervisord start

Source

Openvz rsyslogd spins CPU bugs workaround

For those running OpenVZ/Proxmox containers, one simple workaround is to
disable the imklog module using this :

sudo sed -i -e 's/^$ModLoad imklog/#$ModLoad imklog/g' /etc/rsyslog.conf
sudo service rsyslog restart

This fixes the 100% CPU usage of rsyslog in Natty, Oneiric and Precise
containers.


You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rsyslog in Ubuntu.
https://bugs.launchpad.net/bugs/523610

Title:
rsyslogd spins CPU on some kernels

Status in “rsyslog” package in Ubuntu:
Fix Released
Status in “rsyslog” source package in Lucid:
Fix Released

Bug description:
While running 20100218 EC2 image (ami-0512fe6c) rsyslog is constantly
the following message (found in /var/log/kern.log):

Feb 18 05:01:52 ubuntu kernel: imklog 4.2.0, log source = /proc/kmsg started.
Feb 18 05:01:52 ubuntu kernel: Cannot read proc file system: 1 – Operation not permitted.
Feb 18 05:02:22 ubuntu kernel: last message repeated 643668 times
Feb 18 05:03:22 ubuntu kernel: last message repeated 1865459 times
Feb 18 05:04:22 ubuntu kernel: last message repeated 1327321 times
Feb 18 05:05:22 ubuntu kernel: last message repeated 1644146 times
Feb 18 05:06:23 ubuntu kernel: last message repeated 1826234 times
Feb 18 05:07:23 ubuntu kernel: last message repeated 1817861 times
Feb 18 05:08:23 ubuntu kernel: last message repeated 1807415 times
Feb 18 05:09:23 ubuntu kernel: last message repeated 1813151 times
Feb 18 05:10:23 ubuntu kernel: last message repeated 1857271 times
Feb 18 05:11:23 ubuntu kernel: last message repeated 1810173 times
Feb 18 05:12:23 ubuntu kernel: last message repeated 1826654 times
Feb 18 05:13:23 ubuntu kernel: last message repeated 1825384 times

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/523610/+subscriptions

source

This entry was posted in Useful Tips and tagged , . Bookmark the permalink.

Leave a Reply