Skip to content

Instantly share code, notes, and snippets.

View reqshark's full-sized avatar
🪂
ridge soaring

Bent Cardan reqshark

🪂
ridge soaring
View GitHub Profile
@reqshark
reqshark / 00-MINING.md
Created January 14, 2018 04:32 — forked from gboddin/00-MINING.md
Mining optimisation under Linux

Mining under linux

Disclaimer

I'm in no case responsible for fried hardware, erased software or burning down houses. Make sure your miners are always well cooled.

General recommendation

Though you can easily mix nVidia and AMD in the same rig with Linux, it's recommended to use a different thread for each platform so a Driver crash doesn't bring the whole rig down. It should be noted however, that some mining software have trouble when both architecture are found on the same rig.

@reqshark
reqshark / jarg626.txt
Created June 16, 2015 08:25
a jarg file
============ THIS IS THE JARGON FILE, VERSION 2.6.2, 14 FEB 1991 ============
Introduction
************
This document is a collection of slang terms used by various
subcultures of computer hackers. Though some technical material is
included for background and flavor, it is not a technical dictionary;
what we describe here is the language hackers use among themselves for
fun, social communication, and techical debate within their communities.

Installation

Installing dependencies

sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \
                       libnotify-dev libgnome-keyring-dev libgconf2-dev \
                       libasound2-dev libcap-dev libcups2-dev libxtst-dev \
                       gcc-multilib g++-multilib \
                       libgtk2.0-0 libgconf-2-4 \
                       libasound2 libxtst6 libxss1 libnss3 xvfb \
@reqshark
reqshark / simple-mongodb-connection.rb
Created July 3, 2012 12:36
connecting to mongo from ruby
#!/usr/bin/env ruby
# ruby_simple_example.rb
#
# A sample ruby script covering connection to a MongoDB database given a
# fully-qualified URI. There are a few additional means, but we prefer the URI
# connection model because developers can use the same code to handle various
# database configuration possibilities (single, master/slave, replica sets).
#
# Author:: Mongolab
@reqshark
reqshark / lxc.sh
Last active January 1, 2022 04:25
set up linux containers with node.js
# update the host
apt-get update && apt-get upgrade -y # && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y
# https://www.stgraber.org/
# install linux containers
sudo apt-get install lxc
# list all containers and view their current status
sudo lxc-ls -f
@reqshark
reqshark / sorcery.rb
Created July 6, 2012 23:05
sorcery config file
Rails.application.config.sorcery.submodules = [:reset_password, :activity_logging, :external, :remember_me]
Rails.application.config.sorcery.configure do |config|
config.not_authenticated_action = :not_authenticated
config.save_return_to_url = true
config.cookie_domain = sorcery.kickr.io
# -- session timeout --
# config.session_timeout = 3600
# config.session_timeout_from_last_action = false
# -- activity logging --
@reqshark
reqshark / ethminer_ubuntu_nvidia.md
Created July 18, 2018 18:40 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

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.

Hardware

@reqshark
reqshark / readme.markdown
Created April 26, 2019 05:18
why i am switching to go from javascript

promises and bloat

javascript got one thing right with callbacks. that got thrown out with promises.

error swallowing and other anonymous/bad syntax conventions

  • who cares about function declarations?
  • named functions provide an informative callstack for debugging/visibility, oops not arrows =>
  • async await is not a coroutine
  • chained promises swallow errors and are complex/unintuitive

go run

@reqshark
reqshark / binary_convert.js
Last active April 9, 2019 00:01
binary math conversion
// take a number 6 -> binary
console.log(convert(10))
function convert(n){
let remainder = []
while (n){
remainder.push(n % 2)
n = parseInt(n/2) // keep dividing it
}
@reqshark
reqshark / primesum.js
Last active March 16, 2019 00:20
summing primes from 2 million
console.log(primesum(2000000))
function primesum(m){
let ret = 7, i = 1 //(ret=7) prepopulate 2 and 5, dropped by optimization
while (i++ < m) {
if (isprime(i))