Skip to main content

Posts

Showing posts with the label kernel

Useful ansible stuff

inventory_hostname ‘ inventory_hostname ‘ contains the name of the current node being worked on…. (as in, what it is defined in your hosts file as) so if you want to skip a task for a single node – - name: Restart amavis service: name=amavis state=restarted when: inventory_hostname != "boris" (Don’t restart Amavis for boris,  do for all others). You could also use : ... when: inventory_hostname not in groups['group_name'] ... if your aim was to (perhaps skip) a task for some nodes in the specified group.   Need to check whether you need to reboot for a kernel update? If /vmlinuz doesn’t resolve to the same kernel as we’re running Reboot Wait 45 seconds before carrying on… - name: Check for reboot hint. shell: if [ $(readlink -f /vmlinuz) != /boot/vmlinuz-$(uname -r) ]; then echo 'reboot'; else echo 'no'; fi ignore_errors: true register: reboot_hint - name: Rebooting ... command: shutdown -r now "Ansible kernel update applied...

Install Virtualbox on Centos 7

1. Change to root User Bash su - ## OR ## sudo -i 2. Install Fedora or RHEL Repo Files Bash cd /etc/yum.repos.d/ ## Fedora 26/25/24/23/22/21/20/19/18/17/16 users wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo ## CentOS 7.4/6.9 and Red Hat (RHEL) 7.4/6.9 users wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo 3. Update latest packages and check your kernel version Update packages Bash ## Fedora 26/25/24/23/22 ## dnf update ## Fedora 21/20/19/18/17/16 and CentOS/RHEL 7/6/5 ## yum update While executing yum update if you get any dependency errorfor glibc use the following to resolve it: rpm -qa | grep glibc You may see duplicates for either glibc or glibc common. There might be a common version in between any two packages of glibc and glibc-common. Remove the package which has uncommon version. You can also check for duplicates with the following command: yum list --showduplicates glibc rpm -e glibc-common-2.17-196.el7 rpm -qa kernel |...

fswatch – Monitors Files and Directory Changes or Modifications in Linux

fswatch  is a cross-platform, file change monitor that gets notification alerts when the contents of the specified files or directories are altered or modified. It executes four types of monitors on different operating systems such as: A monitor build on the File System Events API of Apple OS X. A monitor based on  kqueue , a notification interface present in FreeBSD 4.1 also supported on many *BSD systems, OS X inclusive. A monitor based on File Events Notification API of the Solaris kernel plus its spin-offs. A monitor based on inotify, a kernel subsystem that shows file system modifications to apps. A monitor based on ReadDirectoryChangesW, a Windows API that records alters to a directory. A monitor that regularly check that status of file system, keeps file modification times in memory, and manually determine file system changes (which works anywhere, where stat can be used). Features of fswatch Supports several OS-specific APIs Allows recursive directory ...

fswatch – Monitors Files and Directory Changes or Modifications in Linux

fswatch is a cross-platform, file change monitor that gets notification alerts when the contents of the specified files or directories are altered or modified. It executes four types of monitors on different operating systems such as: A monitor build on the File System Events API of Apple OS X. A monitor based on kqueue , a notification interface present in FreeBSD 4.1 also supported on many *BSD systems, OS X inclusive. A monitor based on File Events Notification API of the Solaris kernel plus its spin-offs. A monitor based on inotify, a kernel subsystem that shows file system modifications to apps. A monitor based on ReadDirectoryChangesW, a Windows API that records alters to a directory. A monitor that regularly check that status of file system, keeps file modification times in memory, and manually determine file system changes (which works anywhere, where stat can be used). Features of fswatch Supports several OS-specific APIs Allows recursive directory monitoring ...

Pyinotify – Monitor Filesystem Changes in Real-Time in Linux

Pyinotify  is a simple yet useful Python module for monitoring filesystems changes in real-time in Linux. As a System administrator, you can use it to monitor changes happening to a directory of interest such as web directory or application data storage directory and beyond. It depends on  inotify  (a Linux kernel feature incorporated in kernel 2.6.13), which is an event-driven notifier, its notifications are exported from kernel space to user space via three system calls. The purpose of  pyinotify  is to bind the three system calls, and support an implementation on top of them providing a common and abstract means to manipulate those functionalities. In this article, we will show you how to install and use pyinotify in Linux to monitor filesystem changes or modifications in real-time. Dependencies In order to use  pyinotify , your system must be running: Linux kernel 2.6.13 or higher Python 2.4 or higher How to Install Pyino...

Pyinotify – Monitor Filesystem Changes in Real-Time in Linux

Pyinotify is a simple yet useful Python module for monitoring filesystems changes in real-time in Linux. As a System administrator, you can use it to monitor changes happening to a directory of interest such as web directory or application data storage directory and beyond. It depends on inotify (a Linux kernel feature incorporated in kernel 2.6.13), which is an event-driven notifier, its notifications are exported from kernel space to user space via three system calls. The purpose of pyinotify is to bind the three system calls, and support an implementation on top of them providing a common and abstract means to manipulate those functionalities. In this article, we will show you how to install and use pyinotify in Linux to monitor filesystem changes or modifications in real-time. Dependencies In order to use pyinotify , your system must be running: Linux kernel 2.6.13 or higher Python 2.4 or higher How to Install Pyinotify in Linux First start by checking the kernel and Python ...

Docker Security

Docker contaniners share the kernel wth the machine they are running on. If any of the containers starts using up more resources like CPU, RAM the other containers might run ino /do/s issue. The attack can break out from a container into the host  machine or other containers. Make sure that the images coming from dockerhub are from trusted sources. You should be careful with what secrets you store in your containers. You can use the commands: docker network disconnect nh nh is the name of the container. This will disconnect your containers from the network and they will be inaccessible. docker diff Docker diff will show you which files have been modified. If you do not want external invalid/destructive files to modify your containersthen you can make your containers read-only Specify --read-only option while running your container.