Skip to content

Instantly share code, notes, and snippets.

View johnstcn's full-sized avatar
🏳️‍🌈

Cian Johnston johnstcn

🏳️‍🌈
  • Ireland
  • 02:46 (UTC +01:00)
View GitHub Profile
2024-02-29T10:05:19.7563508Z Current runner version: '2.312.0'
2024-02-29T10:05:19.7566955Z Runner name: 'buildjet.com_535e1c79-ec10-4804-a0c5-6c7449681dc5'
2024-02-29T10:05:19.7567486Z Runner group name: 'Default'
2024-02-29T10:05:19.7567937Z Machine name: 'ubuntu'
2024-02-29T10:05:19.7569309Z ##[group]GITHUB_TOKEN Permissions
2024-02-29T10:05:19.7570290Z Contents: read
2024-02-29T10:05:19.7570543Z Metadata: read
2024-02-29T10:05:19.7570769Z Packages: write
2024-02-29T10:05:19.7571027Z ##[endgroup]
2024-02-29T10:05:19.7573387Z Secret source: Actions
@johnstcn
johnstcn / tree_tmp_coder.txt
Created September 5, 2023 08:40
tree /tmp/coder
coder-b5fcdc954-8ms2s:~$ tree /tmp/coder
/tmp/coder
├── provisioner-0
│ ├── tf
│ │ └── registry.terraform.io
│ │ ├── coder
│ │ │ └── coder
│ │ │ ├── 0.10.0
│ │ │ │ └── linux_amd64
│ │ │ │ ├── LICENSE
// This is lifted directly from https://github.com/gorilla/websocket/blob/master/examples/echo/server.go
// without the build:ignore directives
// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
@johnstcn
johnstcn / foundry-vtt-macro-sfrpg-mass-roll.js
Created May 21, 2022 15:58
Foundry VTT Macro for Starfinder RPG -- Mass Ability, Save, or Skill Roll
/*
* Foundry VTT Macro for Starfinder RPG -- Mass Ability, Save, or Skill Roll
*/
let targetActors = getTargetActors().filter(a => a != null);
function checkForActors(){
if (targetActors.length == 0)
throw new Error('You must designate at least one token as the roll target');
}
checkForActors();
@johnstcn
johnstcn / foundry-vtt-macro-sfrpg-mass-perception.js
Created May 21, 2022 15:54
Foundry VTT Macro for Starfinder RPG -- Mass Perception Check
/*
* Foundry VTT Macro for Starfinder RPG -- Mass Perception Check
*/
// Gets list of selected tokens, or if no tokens are selected then the user's character.
function getTargetActors() {
const character = game.user.character;
const controlled = canvas.tokens.controlled;
let actors = [];
(function() {
game.playlists.filter(p => p.playing).forEach(p => p.playNext());
})()
(function({fadeDuration=5000}={}) {
function fadeOutPlaylist(playlist, fadeDuration) {
if (!playlist.playing) return;
let playingSound = playlist.sounds.filter(s => s.playing).find(_ => true).sound;
if (!!!playingSound) return; // should not happen
let currVol = playingSound.volume;
let globalVol = game.settings.get("core", "globalPlaylistVolume");
if (currVol == 0) return;
playingSound.fade(0, { duration: fadeDuration, from: currVol})
setTimeout(() => playlist.stopAll(), fadeDuration);
@johnstcn
johnstcn / foundry-vtt-macro-crossfade.js
Last active November 10, 2023 21:41
Foundry VTT Macro: Cross-fade Playlists
(function({fadeIn="", fadeDuration=5000}={}) {
function fadeInPlaylist(playlist, fadeDuration) {
playlist.playAll().then(function(p) {
let globalVol = game.settings.get("core", "globalPlaylistVolume");
p.sounds.filter(s => s.playing).find(_ => true)
.sound
.fade(globalVol, { duration: fadeDuration, from: 0});
});
}
@johnstcn
johnstcn / Vagrantfile
Last active April 10, 2021 15:12
provision sumo + veins on ubuntu 20.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2004"
config.vm.provision "shell" do |shell|
shell.privileged = false
shell.path = "provision.sh"
end
end
@johnstcn
johnstcn / ethminer_ubuntu_nvidia.md
Last active October 1, 2022 16:34
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

WARNING: THESE WORDS ARE OLD AND MAY NOT WORK FOR YOU IN THESE NEW AND INTERESTING TIMES.

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.