Add New EBS Volume to EC2 Instance

add-ebs-volume-to-ec2
A short, 3 step guide on how to add a new volume to your EC2 Instance.

Replace #### with your volume and #folder# with your folder path.

1. Format the disk

[ubuntu ~]$ sudo mkfs -t ext4 /dev/####

2. Mount the disk

[ubuntu ~]$ sudo mount /dev/#### #folder#

3. Auto-mount the volume on restart

[ubuntu ~]$ sudo vim /etc/fstab

fstab config

/dev/#### #folder# ext4 defaults 0 1

Update MySQL Database to general utf-8 encoding for backwards compatibility

Fix script for #1273 – Unknown collation: ‘utf8mb4_unicode_ci’

 

$ mysqldump --compatible=mysql4

Or


<!DOCTYPE html>
<html>
<head>
  <title>DB-Convert</title>
  <style>
    body { font-family:"Courier New", Courier, monospace;" }
  </style>
</head>
<body>

<h1>Convert your Database to utf8_general_ci!</h1>

<form action="db-convert.php" method="post">
  dbname: <input type="text" name="dbname"><br>
  dbuser: <input type="text" name="dbuser"><br>
  dbpass: <input type="text" name="dbpassword"><br>
  <input type="submit">
</form>

</body>
</html>
<?php
if ($_POST) {
  $dbname = $_POST['dbname'];
  $dbuser = $_POST['dbuser'];
  $dbpassword = $_POST['dbpassword'];

  $con = mysql_connect('localhost',$dbuser,$dbpassword);
  if(!$con) { echo "Cannot connect to the database ";die();}
  mysql_select_db($dbname);
  $result=mysql_query('show tables');
  while($tables = mysql_fetch_array($result)) {
          foreach ($tables as $key => $value) {
           mysql_query("ALTER TABLE $value CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
     }}
  echo "<script>alert('The collation of your database has been successfully changed!');</script>";
}

?>

How to add an alias to .bash_profile

To add an alias (shortcut) to your terminal use:

alias your_terminal_shortcut='the command the alias should do'

 

Example:

alias ll='ls -la'

 
To update the current terminal window type source followed by your ‘profile file’:

$ source ~/.bash_profile

Slow Motion at the Meadows

I got new iPhone the other day and decided to try the hi frame rate video capture. Love the simplicity of this new feature and how much value it can add to videos taken using it.

This is a video I took at the Meadows park in Edinburgh last weekend.

New Lamp Stack Icons

These lamp stack icons are leftovers from one of the projects I worked on. Feel free to use them however you want. It would be nice to get some links of where they’ve been used.

EPS | SVG

new-lamp-stack-icons