Skip to content

Instantly share code, notes, and snippets.

View tyrell's full-sized avatar
💭
“Those who can imagine anything, can create the impossible.” ― Alan Turing

Tyrell Perera tyrell

💭
“Those who can imagine anything, can create the impossible.” ― Alan Turing
View GitHub Profile
@tyrell
tyrell / git.migrate
Last active August 29, 2015 14:26 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@tyrell
tyrell / Dockerfile
Created May 19, 2016 20:09 — forked from dceejay/Dockerfile
Dockerfile for Node-RED
# Dockerfile for Node-RED - pulls latest master code from git
# Use the node.js v0.10.36 engine
FROM node:0.12-slim
MAINTAINER ceejay
# download latest stable node-red
RUN npm install -g node-red
# use external storage for the user directory
VOLUME /root/.node-red

Permission Cheat Sheet

You will use this one a lot in Wordpress :P

   chown -R www-data:www-data ./
   // set the proper owner
@tyrell
tyrell / django-postgresql-persisted-on-openshift.md
Last active April 3, 2017 01:57
Django + PostgreSQL (Persisted) on Openshift

Introduction

The steps below assume that you are using minishift (https://github.com/minishift/minishift) to run an Openshift cluster locally.

Prefereably, these steps need to be carried out before initiating an application with the template above. If not, the PostgreSQL database pod will not start up and you will have to re-deploy the PostgreSQL pod after carrying out the steps below. It's not a major problem. But why panick unnecessarily? :)

Step 1 : Add Django with PostgreSQL 'persistent' template to Openshift

The Django persistent template can be found at https://github.com/openshift/django-ex

How to Install Linux Bash Shell on Windows 10

These are the steps I followed to get Ubuntu installed in my Window 10 system.

PS> Start-Process powershell -Verb runAs

PS> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

`PS> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

@tyrell
tyrell / a-running-minishift-with-metrics.md
Last active September 29, 2020 19:16
Running Minishift with Hawkular Metrics Installed

Introduction

A minishift openshift cluster can be created with cluster metrics installed. Although I couldn't find a way to add metrics to an already created minishift VM instance, the steps below helped to get a new instance up and running easily.

Steps

Step 1 - Initialise minishift with metrics.

Create a fresh minishift VM with an openshift cluster using the below command. The --metrics parameter is the only additional thing I had to provide for minishift to start installing cluster metrics and Hawkular.

 $minishift start —metrics
@tyrell
tyrell / rpi-airprint-hp-printer.md
Last active April 1, 2021 06:08
Raspberry Pi AirPrint Server with HP Printer

I have an old HP Officejet 2620 printer that works perfectly. Unfortunately Apple and HP do not support this printer in Big Sur onwards.

Instead of throwing away a perfectly working printer, I re-purposed one of my old Raspberry Pi 2 units and plugged the printer to it using the USB cable. Below are the steps I ended up following to convert the setup into an Air Print server.

  1. Follow instructions from https://pimylifeup.com/raspberry-pi-airprint/ to set up your Raspberry Pi.

  2. Before adding your HP Printer using the ttps://192.168.0.40:631 web UI, install HP Cups Drivers as below;

    sudo apt update

@tyrell
tyrell / mac-osx-samba-tips.md
Last active April 18, 2021 03:09
Tips to make Samba netowrk shares work better

Speed up browsing on network shares

To speed up SMB file browsing, you can prevent macOS from reading .DS_Store files on SMB shares. This makes the Finder use only basic information to immediately display each folder's contents in alphanumeric order. Use this Terminal command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

Then log out of your macOS account and log back in.

To reenable sorting, use this command:

@tyrell
tyrell / vim-cheatsheet.md
Created May 29, 2021 05:19
A VIM Cheatsheet

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@tyrell
tyrell / metasploit-on-m1-macbook-air.md
Last active August 20, 2022 01:49
Installing Metasploit on an M1 Macbook Air

Introduction

This method installs Metasploit from the official OSX installer found at https://osx.metasploit.com/metasploitframework-latest.pkg

Run the installer

  1. Download the installer from https://osx.metasploit.com/metasploitframework-latest.pkg
  2. Run the installer.
  3. You should get it blocked from running.
  4. Go to OSX System Preferences -> Security & Privacy and tell OSX to "Open it anyway".
  5. The installer will start.
  6. At some point you will have to type your password to give the installer elevated privileges to continue.