Skip to content

Instantly share code, notes, and snippets.

@benfoley
benfoley / install_elpis_ronin_ubuntu_focal.sh
Last active November 16, 2022 11:38
Elpis startup script for Ronin
# Version 0.4
# Install ubuntu drivers
sudo apt-get install -y build-essential
sudo apt-get install -y linux-headers-$(uname -r)
sudo apt install -y ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
# sudo reboot
# GPU startup script v0.6.3
# Check if this has been done before. Skip driver installation if so, just run Elpis
if [[ -f /etc/startup_installed ]];
then
sudo chmod 666 /var/run/docker.sock
# Run Elpis (non-interactive so that Elpis starts automatically)
docker run -d --rm --name elpis --gpus all -p 80:5001/tcp -p 6006:6006/tcp coedl/elpis:latest
exit 0;
fi
@benfoley
benfoley / hft_download_datasets.py
Created October 19, 2021 13:45
load common_voice tr
from datasets import load_dataset
common_voice_train = load_dataset("common_voice", "tr", split="train+validation", cache_dir='/hft-cache')
common_voice_test = load_dataset("common_voice", "tr", split="test", cache_dir='/hft-cache')
@benfoley
benfoley / gcp-gpu-elpis-install.sh
Last active July 26, 2021 01:50
Google Cloud Platform GPU installation steps for Elpis
# Install gpu drivers
sudo apt install linux-headers-$(uname -r)
curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt update
sudo apt -y install cuda
# Install docker instructions from https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
@benfoley
benfoley / Brewfile
Created May 7, 2021 04:10 — forked from ryanhanwu/Brewfile
New Mac Setup Script 2021
# Taps
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'heroku/brew'
# Install CLI Tools
## Shell Utilities
brew 'coreutils'
brew 'findutils'
brew 'autojump'
@benfoley
benfoley / elpis-deploy.sh
Last active November 28, 2019 00:26 — forked from fauxneticien/elpis-deploy.sh
Elpis deploy script for ICLDC workshop
#!/bin/bash
# Commands taken from https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
# Run using:
# bash <(curl -s https://gist.githubusercontent.com/fauxneticien/159529bf6c071f90b7fd70a481e6083b/raw/47c1d9e7c922797deee9fa2ce16387d6a3ed3624/elpis-deploy.sh)
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
# added new lines for containerd
@benfoley
benfoley / home.ts
Created July 20, 2017 03:32
Trying to play audio with Ionic Native Media plugin
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { File } from '@ionic-native/file';
import { Media, MediaObject } from '@ionic-native/media';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@benfoley
benfoley / angular2 ViewChild ViewChildren.md
Created October 10, 2016 04:09
Angular2 ViewChild ViewChildren

Access DOM elements with Angular2's ViewChild and ViewChildren. I know it's not the preferred way, but sometimes handy.

Add a #label to the element in html.

Access that in the component by setting queries in the component decorator.

Then after the view is initialised we can get the nativeElement.

ViewChildren gives us a QueryList. The children aren't accessed directly through that, but we can filter/map/foreach that to get to the elements.

@benfoley
benfoley / set a bag limit of 1 for ionic2 rc0 dragula.md
Last active October 10, 2016 04:13
ionic2 rc0 dragula bag limit 1

Set up dragula as per the other gist.

When something is dropped, we clear the target's children and then re-append the dropped element.

Should do this more Angular-ey, but ok for now.