AuthorShaun

How to CPU Mine Monero on AWS

Disclaimer: This is not a profitable way to mine so only do this if you’re interested in learning as it will cost you money.

First of all you’ll need to get yourself a Monero wallet, you can do this in one of two ways:

  1. Go to https://mymonero.com and get yourself a free wallet
  2. Go to https://getmonero.org and download the software to set yourself up a local wallet

For the purposes of this tutorial option one would be the easiest, alternatively feel free to use my address for testing:
41neyamL4393wWmKAEUryViAkdKC9bjgYep4ahVAqSpWfC5Be717UC8NKKQGTQgaz3XbFoaQS7Cb9hZ1sBANKUVY93QM5qF

Continue reading

Vivobarefoot Discount Code

For £10 off from vivobarefoot.com click on the below link to get a £10 off discount code. For complete honesty, this is part of their refer a friend scheme so I also get £10 off, but you save money so who cares?

https://goo.gl/8Pf9hW

 

Hack This Site: Programming 2

Quite enjoyed this one, not something I do everyday

<?php
	// Set width of image
	$x = 100;
	$y = 30;

	$col = 0;
	$row = 0;
	
	$index = 0; 
	$last = 0;
	
	$string = '';
	
	$trans = array(
				".-" => "a",
                "-..." => "b",
                "-.-." => "c",
                "-.." => "d",
                "." => "e",
                "..-." => "f",
                "--." => "g",
                "...." => "h",
                ".." => "i",
                ".---" => "j",
                "-.-" => "k",
                ".-.." => "l",
                "--" => "m",
                "-." => "n",
                "---" => "o",
                ".--." => "p",
                "--.-" => "q",
                ".-." => "r",
                "..." => "s",
                "-" => "t",
                "..-" => "u",
                "...-" => "v",
                ".--" => "w",
                "-..-" => "x",
                "-.--" => "y",
                "--.." => "z",
                "-----" => "0",
                ".----" => "1",
                "..---" => "2",
                "...--" => "3",
                "....-" => "4",
         "....." => "5",
       "-...." => "6",
        "--..." => "7",
        "---.." => "8",
        "----." => "9"
	);
	// Set image
	$im = imagecreatefrompng("download.png");
	
	// for every row...
	while($row < $y):
		// iterate over cols...
		while($col < $x):
			$rgb = imagecolorat($im, $col, $row);
			
			if($rgb == 1):
				$string .= chr($index - $last);
				$last = $index;
			endif;		
			$index++;
			$col++;
		endwhile;
		// reset col
		$col = 0;
		$row++;
	endwhile;
	
	$chrs = explode(" ",$string);
	
	foreach($chrs as $chr):
		echo $trans[$chr];
	endforeach;
	
?>

Hack This Site: Programming 1

Quick and dirty solution…

<form method="post" action="">
	<textarea name="words"><?php echo $_POST['words'];?></textarea>
	<br>
	<input type="submit">
</form>
<?php
if($_POST):
	$dict = file('wordlist.txt');
	$list = array();
	$res  = array();
	
	foreach ($dict as $word):
		$word = str_replace("\n", "", $word);
		$word = str_replace("\r", "", $word);
		$tmp = str_split($word);
		sort($tmp);
		$tmp = implode('', $tmp);
		$list[$tmp] = $word;
	endforeach;
	
	$input	= $_POST['words'];
	$words	= explode("\n", str_replace("\r", "", $input));
	
	foreach($words as $word):
		$tmp = str_split($word);
		sort($tmp);
		$tmp = implode('', $tmp);
		echo $list[$tmp].",";
	endforeach;
	
endif;

Codefights: Kill K-th Bit

function killKthBit($n, $k) {
  return $k > strlen(decbin($n)) ? $n : (substr(decbin($n), -$k, 1) == 0 ? $n : bindec(substr_replace(decbin($n), '0', -$k, 1))) ;
}

© 2018 Shaun Gill

Hosted by Five50Up ↑