Check RAID status on Ubuntu

Check RAID status:

/sbin/mdadm --detail /dev/md0

Or check with this:

sudo cat /proc/mdstat

This is what a good status will look like:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 sdb5[0] sdc5[1]
      1485888 blocks [2/2] [UU]
      
md0 : active raid1 sdb1[0] sdc1[1]
      242709888 blocks [2/2] [UU]
      
unused devices:

The [UU] (I think) indicates the status of both drives in the array, and both are Up

Easy steps for Ubuntu server upgrade

sudo apt-get update
sudo apt-get upgrade

Edit /etc/update-manager/release-upgrades, and ensure:

Prompt=normal

(otherwise if its LTS you will only be able to upgrade to the next LTS release if one is available

sudo apt-get install update-manager-core
sudo do-release-upgrade

…and follow the prompts.

Hiding Apache2 header info

Add these to your /etc/apache2/apache2.conf then restart Apache:

LoadModule headers_module /path_to/mod_headers.so
Header unset Server
ServerSignature Off
ServerTokens ProductOnly
Header unset X-Powered-By

Enabling FK support in SQLite with Firefox SQLite Manager

SQLite Manager is an awesome plugin for Firefox that lets you create & manage a SQLite db.

To enable FK support using SQLite Manager:

  • Go to DB Settings, change Foreign Keys to ‘On’, Press ‘Change’
  • Go to Tools, then ‘Use table for extension data’
  • Go to Tools, then ‘Open on-connect SQL’
  • Click on the ‘On connect SQL’ tab – the ‘On-connect SQL statements for THIS database’ textarea is now enabled.
  • In the field enter: PRAGMA foreign_keys=ON;
  • Press Save.

Syntax to create an FK ref:

<tt>CREATE TABLE child_table_name (field_1 INTEGER PRIMARY KEY,
field_2  TEXT,
foreign_key_field INTEGER ,
FOREIGN KEY(foreign_key_field)  REFERENCES parent_table_name(parent_key_field));</tt>