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 / Run Mistral AI locally using Ollama.md
Created December 12, 2023 20:19
Run Mistral AI locally using Ollama
❯ ollama run mistral
pulling manifest
pulling c70fa74a8e81... 100% ▕█████████████████████████████████████████▏ 4.1 GB
pulling e6836092461f... 100% ▕█████████████████████████████████████████▏   42 B
pulling 1128f85489e0... 100% ▕█████████████████████████████████████████▏  124 B
pulling 70ded05e7c58... 100% ▕█████████████████████████████████████████▏  381 B
verifying sha256 digest
writing manifest
removing any unused layers
@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.
@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 / 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 / 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

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 / 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

@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
@tyrell
tyrell / docker-install-rpi3.md
Last active December 22, 2023 07:36
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/