How-to: check what is swapping

Easy check what is swapping:

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

fstab options for ntfs partitions in Linux Mint

I gor errors while tried to mount ntfs partitions in linux mint.
So I checked fstab and fixed things.

This is output from fstab:

# /windows was on /dev/sda3 during installation
UUID=B86E55A46E555C66 /media/windows ntfs   defaults,nls=utf8,umask=000,uid=1000

Continue reading

How to change hostname in Linux Mint

Recently I changed hostname in my Linux Mint desktop and then I got the error each I tried to run something with “sudo”, for example:

$ sudo sed -i 's/maya/nadia/g' /etc/apt/sources.list
sudo: unable to resolve host garage

It means that I didn’t change hostname appropriately.
Continue reading

How to clear memory cache on Linux Mint

I have system cache used a lot of memory after a long time of work with system so I looked for something what might clear the cache.

So these are scripts (available in 2.6.16 Linux core or newer):

  • Clears pagecache
  • sync
    echo 1 > /proc/sys/vm/drop_caches
    
  • Clears dentrie and inode кэши:
  • sync
    echo 2 > /proc/sys/vm/drop_caches
    
  • Clears pagecache, dentrie and inode кэши:
  • sync
    echo 3 > /proc/sys/vm/drop_caches
    

I’m using the last one.