Archive | Linux Admin RSS feed for this section

Find newest files recursively on linux

9 Jan

find . -type f -printf “%TY-%Tm-%Td %TT %p\n” | sort -r | less

Advertisements

Kernel panic

25 Aug
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block

On RHEL 6.

This might happen when a yum update is interrupted. You can try booting into any other kernel you have and running:

yum-complete-transaction

Otherwise reinstall your kernel-xx and kernel-firmware-xx packages.

 

 

sudo – PATH/$PATH changes

22 Aug

Pretty annoying, do this to fix:

alias sudo='sudo env PATH=$PATH'

cp all files including hidden or dot files

19 Aug

doing this will not copy . files or directories (e.g. .screenrc, .bashrc, .ssh)

cp -r /var/x/* /y/

you need to do this first:

shopt -s dotglob

When you're finished do this:

shopt -u dotglob

Error: Missing Dependency: libpq.so.4 is needed by package apr-util

10 Aug

RHEL5. I had previously upgraded Postgres to 8.4.x which was in the PGDG repositories but not in the RedHat yum repositories.

Running a ‘yum update’ gave the above dependency problem.

This was fixed by:

  1. Installing the PGDG yum repositories: http://www.pgrpms.org/reporpms/repoview/letter_p.group.html
  2. Installing the compat library as per: http://www.westnet.com/~gsmith/content/postgresql/pgrpm.htm
  3. Excluding the RedHat postgresql repo -edit /etc/yum/pluginconf.g/rhnplugin.conf and add “exclude=postgresql*” to the end of it
  4. Running yum update

top

10 Aug

top in linux

VIRT = how much memory the process can access. Includes memory from other libraries, files on disk, memory shared with other processes. Doesn’t really matter if this is high.

SHR = how much of the VIRT memory is shareable. A library might be mapped in and counted under VIRT and SHR but only a few functions are used and these will be the only bits loaded and counted in RES.

RES = how much physical memory it is actually using. This is important.

PR = priority

NI = nice, negative values are higher priority. positive numbers are lower priority. Range is -20 to +19.

RedHat Enterprise Linux ridiculous virtualization bug

17 Dec

So

I installed RHEL and selected “Virtualization” during the install.

After install I realized the Xen Virtualization stuff actually took control of the serial port which I needed to use.

So I went to “Add/Remove Programs” and deselected “Virtualization”

I then rebooted the machine to find I now had NO kernel, it simply deleted the Xen Kernel and left me with nothing..

Its LOL