Skip to content

Instantly share code, notes, and snippets.

View Krailon's full-sized avatar
🔮

NOP-Gate Krailon

🔮
View GitHub Profile
@Krailon
Krailon / FastaMLtoSL.py
Last active May 23, 2020 05:47
Modified version of Lee's script to convert multiline FASTA to single-line. A "coverage threshold" option has been added to allow discarding of low-coverage sequences.
#!/usr/bin/env python
# Created by: Lee Bergstrand
# Modified by: Matt McInnes
# Descript: Converts multiline FASTAs to single line FASTAs
#
# Usage: FastaMLtoSL.py <sequences.faa>
# Example: FastaMLtoSL.py mySeqs.faa
#----------------------------------------------------------------------------------------
#===========================================================================================================
#Imports:
@Krailon
Krailon / csvgen.py
Created July 15, 2015 02:25
Python2 CSV Test Data Generator
#!/usr/bin/env python2
#
# CSV Random Test Data Generator
# "Allow me to algorithmically test your algorithm with algorithmically-generated test data..."
# Written by Kerberos/Krailon
#
import sys, argparse
from random import SystemRandom
@Krailon
Krailon / binary_perms.py
Created May 21, 2016 23:23
Binary Permutation Generator
def gen_bins(bit_count):
bins = []
indx = 0
bin = [0] * bit_count
while bin != [1] * bit_count:
while bin[indx]:
indx += 1
del bin[indx]
bin.insert(indx, 1)
if indx > 0:
@Krailon
Krailon / downgrade-kernel.sh
Created May 24, 2016 04:28
Ubuntu 16.04 Kernel Downgrade for ASUS Zenbook UX501VW
# Downgrade kernel from 4.4.0 to 4.3.5 to fix...everything really
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3.5-wily/linux-headers-4.3.5-040305-generic_4.3.5-040305.201601311533_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3.5-wily/linux-headers-4.3.5-040305_4.3.5-040305.201601311533_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3.5-wily/linux-image-4.3.5-040305-generic_4.3.5-040305.201601311533_amd64.deb
sudo dpkg -i linux-headers-4.3.5*deb linux-image-4.3.5*deb
sudo apt remove linux-image-4.4.0* linux-headers-4.4.0*
@Krailon
Krailon / fix_boot.bat
Created June 1, 2016 07:30
Rebuild Windows 10 EFI Boot Sector
REM Start diskpart to assign the boot partition a drive letter to allow access
diskpart
REM Replace X with the number of the listed Windows disk
list disk
sel disk X
REM Replace Y with the number of the listed boot volume (type: SYSTEM)
list vol
sel vol Y
@Krailon
Krailon / gridcoin.js
Last active January 5, 2018 15:53
Javascript functions for assisting in informed Gridcoin BOINC project selection
function highlight_gpu_projects(gpu_projects) {
if (location.hostname != 'gridcoinstats.eu' || location.pathname != '/project') {
throw 'This function is designed to run only on https://gridcoinstats.eu/project'
}
for (var index in gpu_projects) {
$('td a[href*="gridcoinstats.eu/project/"]').filter(function() {
return $(this).text().toLowerCase() == gpu_projects[index].toLowerCase()
}).parent().parent().css('background-color', 'rgb(96, 255, 80)')
//$('a:contains(' + gpu_projects[index] + ')').parent().parent().css('background-color', 'rgb(96, 255, 80)')
@Krailon
Krailon / stress.sh
Created January 9, 2018 22:54
CPU Stress Test Bootstrapper
#!/usr/bin/env bash
apt install stress lm-sensors
# TODO: check install succeeded
sensors-detect
tmux new -d -s StressTest -n Stress 'stress --cpu 2 --verbose'
tmux split-window -v 'watch uptime'
tmux split-window -h 'watch sensors'
tmux attach
@Krailon
Krailon / excavator-driver.py
Last active April 15, 2018 12:10 — forked from YoRyan/excavator-driver.py
Cross-platform controller for NiceHash Excavator for Nvidia (aka, NiceHash 2 for Linux). Updated for Excavator v1.5.1a (API v0.1.1).
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Cross-platform controller for NiceHash Excavator for Nvidia."""
# Example usage:
# $ excavator -p 3456 &
# $ python3 excavator-driver.py
# History: