Tag Archives: Linux

Loading Linux on a Mac-Mini

In the intel mac era this has become fairly easy and you can use standard linux Distros.  There are a few little tweaks which I will mention.  I am using Ubuntu 14.04 LTS 64bit for this example.

You will need to acquire a standard (non-mac) iso from ubuntu.com, and write that to a usb key using dd on a Linux or OS X machine, or Universal USB Installer on a windows machine.

*** You should also make an OS X Installer USB key incase you wish to restore your mac mini to normal at a later date ***

Once you have your bootable usb, plug it in to the mac mini and power up holding the Option / Alt key until you see the boot choices screen.  One of the options will be UEFI – this will be your USB key.

From there on, install Ubuntu as normal.   It is safe to remove all partitions – you don’t need to keep any for the mac to boot to Linux.

Once finished, reboot the machine & boot to your USB key as before.  This will present you with an option to Rescue your system.  Follow those prompts, eventually choosing to boot in to a shell.

At the shell you should be able to run the following:

efibootmgr -bootorder 0000

This tells the efi firmware to look for Linux before OS X.  Exit the shell and reboot without holding any keys, and you should finally be in your working Linux system.  Enjoy!

Just incase, if you want to remove Linux and put OS X back later on, run the following from your soon-to-be-removed Linux install:

efibootmgr -bootorder 0080

Configuring phpmyadmin with nginx

Install the php dependencies

apt-get install phpmyadmin php5-fpm

Modify /etc/nginx/sites-available/default and add the following at the end of the server section

location ^~ /phpmyadmin {
    alias /usr/share/phpmyadmin/;
    index index.php index.html index.htm;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

To restrict access to a certain IP, add the following just below the index line that you have just added…

allow 127.0.0.1;
allow 1.2.3.4;
deny all;

enable mcrypt extension

php5enmod mcrypt

restart nginx & php5

service restart nginx
service restart php5-fpm

Installing HHVM on Amazon Linux (AWS)

HHVM

Alternative to PHP, said to increase speed by up to 40%.  Works similar to java in that it pre-compiles PHP automatically to speed up execution time.  Used by facebook.

cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo
echo 'priority=9' >> hop5.repo
echo 'includepkgs=glog,tbb' >> hop5.repo
wget http://yum.sexydev.com/sexydev-amazon.repo
yum install hhvm

 

Usernames for Amazon Linux (AWS) and Ubuntu AMI

For Amazon Linux, the username is “ec2-user”, for ubuntu it is simply “ubuntu”.

To connect to them you need the key file that was generated when the instance was created, and the public DNS address.  Use a command like:

ssh -i myinstance.pem ec2-user@12.34.56.789

Note: Make sure you have opened up ssh (port 22) access to your instance from your IP address.

Social Network

This was a complex social network platform which was heavily based on nested reusable functions.  After 5 months of development it was discovered it was no longer what the client was after, and the project was ended.

  • API hooks with flickr, youtube/google
  • Advanced templating engine allowing on-the-fly modification of CSS rules
  • Real-time efficient multiple thumbnail engine from uploaded & linked media
  • Highly recursive branched functions
  • Customised tools were also developed for the staff.

Some of the technologies used were:

  • google / youtube api
  • flickr api
  • dojo
  • ajax
  • javascript
  • css
  • html5
  • php / codeigniter / MVC
  • mysql
  • ubuntu server
  • bash scripting
  • rsync backups

Due to the policies of the project manager, no screenshots are available.

Systems Administration

Multiple systems administration roles have allowed me to confidently manage & monitor large networks of varying architectures, platforms, & network technologies.  Some of the key areas I have had worked with are:

  • All Mac workplaces, with offsite iPad, iPhone, and Macbook management.
  • Computer labs – 600+ devices ranging from fixed desktops with domain logons, to tablets & laptops. System imaging & Ghost was heavily used along with image creation.
  • SANs – Dedicated hardware appliances with multple drives, linux servers with raid, FreeNAS
  • Servers – Virtualisation (KVM & VirtualBox), Windows server with active directory, Linux servers of varying distributions, OSX Server, Web servers (AWS). High availability clusters with Galera & GlusterFS.
  • Backups – Automated backup shell scripts, rotating failsafe storage methods, complex rsync scripts using comparisons to use minimal bandwidth.
  • Dumb terminals – Linux thin clients connecting to a Windows Terminal Server
  • Data migration – Website transfers, mysql databases, storage upgrades, amalgamation of servers.

Intranets & Remote Support

Previously to support clients there were a mix of different servers & different support technologies, controlled via a complex set of Shell Scripts which was only available to administrators. This was solved by streamlining all the different technologies in to one simple OpenVPN server based on common hardware with pfSense, with a simple graphically appealing interface for all staff to use from anywhere. This also opened up the ability for staff to work remotely, with the added benefit of drastically reduced technical issues & calls.

A second version was developed but never released, written from scratch in Dojo with mobile in mind. This had a few advantages:

  • More efficient in regards to loading speeds, as it only loads what it needs at any one time rather than everything.
  • Mobile-friendly interface, for technicians in the field to get instant feedback on the systems they are working on.
  • More informative at a glance with data arranged more logical to the workflow of support staff

FlexiFi v1

I was brought in to design, build and support a new Digital Media System that was to replace an ageing and extremely buggy PERL system (iDesign) that was currently in use.  FlexiFi was the outcome, written in PHP to be a more solid, supported and easily extendable duplicate of the original system yet with many features implemented that had previously been impossible.

This was successfully sold and deployed to over 100 sites nationwide (200+ systems) which required a custom Intranet development and VPN to keep track of it all.

Each system was a dedicated PC with a highly customised Linux distribution, which contained its own LAMP stack with built in CMS.  This allowed it to be updated both remotely by support staff & locally by clients themselves.

The systems themselves were able to display slideshows consisting of customised text, graphics and videos, along with menus that could accommodate multiple prices – all of which could be scheduled.

It was a highly successful product which was replaced a few years later by the far more advanced FlexiFi2 product.

If you are using FlexiFi (or any digital signage system) please visit signagebank.com for pre-made stock slides and animations for your displays.

Window Shopping Directory Centre

Searchable online business directory built using Perl, where each business had its own editable multi-page profile generated real-time from a mySQL database.

Original version was commercially successful, bringing in advertising revenue from banner ads placed throughout the site.

Pictured is the Third revision which was rewritten using PHP but never released due to management & budget constraints.