CategoryDevelopment

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

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))) ;
}

How to extend WI-FI signal

My home office is in an old converted coal shed and all of my connectivity out here is achieved using powerline network adapters, so everything is wired through ethernet. WiFi is limited and can be pretty much classed as limited at best and my wife has moaned that she gets poor signal on her phone when she comes in here, and to be honest I want signal out in the garden so that I can connect Spotify up!

So the challenge; extend WiFi for free recycling old parts….

Continue reading

© 2018 Shaun Gill

Hosted by Five50Up ↑