Postgresql: show tables, show databases, show columns, describe table

PostgreSQL is one of the best database engines for an average web project and many who moves to psql from MySQL (for example) often ask the following questions: What is the analog of “show tables” in Postgres? How can I get the list of databases in Postgres like “show databases” in MySQL? In this quick tutorial, we’ll answer these questions, along with some other common commands which are useful. PostgreSQL […]

Read more →

 

Track file changes using auditd

Most of Linux distributions comes with Linux Auditing System that makes it possible to track file changes, file accesses as well as system calls. It’s pretty useful functionality for sysadmins who wish to know who and when accessed and/or changed sensitive files like /etc/passwd, /etc/sudoers or others. Daemon auditd¬†that usually runs in background and starts after reboot by default logs those events into /var/log/audit.log file (or into other file if […]

Read more →

 

Grub Fallback: Boot good kernel if new one crashes

It’s hard to believe but I didn’t know about Grub fallback feature. So every time when I needed to reboot remote server into a new kernel I had to test it on local server to make sure it won’t panic on remote unit. And if kernel panic still happened I had to ask somebody who has physical access to the server to reboot the hardware choose proper kernel in Grub. […]

Read more →

 

Add physical NIC to XenServer

If you add new physical network interface to the hardware that runs XenServer it won’t appear in XenCenter by default. In order to attach it to VMs or change its settings you’ll need to type in a few commands to XenServer’s CLI. 1. Connect XenServer via SSH using root rights: ssh root@192.168.10.1 -vssh root@192.168.10.1 -v 2. Make sure that new NIC is attached to hardware and detected by Linux, in […]

Read more →

 

Track Cisco BGP peers using Nagios

Few will deny that monitoring of Cisco devices is essential part of sysadmin’s job. I personally use Nagios to track states of BGP neighbors on Cisco routers so if one of peers goes down I’ll receive a phone call from Nagios. You may have redundant network topology but it still makes sense to know when peer goes offline, how often it happens and how fast failover router (if any) pick-ups […]

Read more →