Skip to content

Instantly share code, notes, and snippets.

View PartTimeLegend's full-sized avatar

Antony Bailey PartTimeLegend

View GitHub Profile
@PartTimeLegend
PartTimeLegend / recursion.cs
Last active January 29, 2018 10:06
Recursion
public string recursion()
{
var = "to understand recursion, you must first understand recursion.";
recursion();
return var;
}
//don't try coding at 2 am when you have an important day ahead of you
@PartTimeLegend
PartTimeLegend / gist:5170990
Last active January 29, 2018 10:05
Bitcoin Mining On Raspberry Pi

Bitcoin Mining On Raspberry Pi

This is a quick and dirty guide to Bitcoin Mining on your Raspberry Pi. It's not going to be fast or efficient and may cause damage. I'm not responsible if you break anything, kill a cat or your wife leaves you as a result of this.

The following commands are to be run via either Terminal on the Pi or via SSH. If you are looking for a Windows SSH client, I recommend PuTTY


@PartTimeLegend
PartTimeLegend / vboxdrvfix.md
Last active September 24, 2019 01:44
/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

#/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

When setting up Virtual Box I was faced with the immortal error telling me to run sudo /etc/init.d/vboxdrv setup. Simple enough, until you're told it doesn't exist.

Thus began my fight to get it working. The fix is here in the hope that it helps someone else.

To follow this guide you need to have a basic understanding of shell commands. If you don't, then just be careful.

First off I like aptitute so let's install it.

@PartTimeLegend
PartTimeLegend / buildbfgminerforminera.sh
Created September 11, 2014 16:59
Example to upgrade BFGMiner for Minera
#!/bin/sh
# Copyright 2014 - Antony Bailey
# Upgrade BFGMiner for Minera
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@PartTimeLegend
PartTimeLegend / seedbox.sh
Created November 13, 2014 20:38
Seedbox Config
#!/bin/sh
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
@PartTimeLegend
PartTimeLegend / encryptfiles.cs
Created November 13, 2014 20:44
Encrypt Files C#
public void EncrpytFiles(IList<Documents> documentsList)
{
foreach (var document in documentsList)
{
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Padding = (PaddingMode.ISO10126);
tdes.Mode = CipherMode.CBC;
tdes.GenerateIV();
tdes.GenerateKey();
tdes.CreateEncryptor();
@PartTimeLegend
PartTimeLegend / findxls.cs
Created November 13, 2014 20:46
Find all .xls files in C#
public IList<Documents> FindDocuments()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
IList<Documents> documentsList = new List<Documents>();
foreach (DriveInfo d in allDrives)
{
foreach (var file in Directory.GetFiles(d.ToString(), "*.xls", SearchOption.AllDirectories))
{
# Add and Enable SSL 3.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force
# Add and Enable TLS 1.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0' -Force
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -name
for line in `testdb | cut -d: -f2 | sed s"/ //g"`; do
pacman -S $line
done;
DECLARE @BatchSize INT
SET @BatchSize = 100000
WHILE @BatchSize <> 0BEGIN
DELETE TOP (@BatchSize) t
FROM [MyTable] t
INNER JOIN [Ids] d ON d.ID=t.ID
WHERE ????
SET @BatchSize = @@rowcount
END