Brad Lucas

Programming, Clojure and other interests

Ethereum Upgrade Geth

July 17, 2017

If you are running geth on OSX and you need to upgrade to the latest version here are the simple steps to follow:

$ https://github.com/ethereum/homebrew-ethereum
$ brew update
$ brew upgrade ethereum

For Example

blucas.home:~/Library/Ethereum$ brew upgrade ethereum
==> Upgrading 1 outdated package, with result:
ethereum/ethereum/ethereum 1.6.7
==> Upgrading ethereum/ethereum/ethereum 

Continue reading →

Ethereum Testnet Faucet

July 16, 2017

While developing for Ethereum and using the testnet you'll need Ether to get things done. You can mine for it of course but there are sites called faucets that will send you Eth for free.

I found the following one today and used it a few times to get my balance in shape to do some testing.

B9Lap Academy

Throttled Testnet Faucet


Continue reading →

Ethereum Reset Local Blockchain Geth

July 15, 2017

Returning to some Ethereum work I wanted to reset my old local blockchain by deleting it an starting from scratch. Here are notes to describe what to do.

Ethereum Installation Directory

On OSX Ethereum installs in $HOME/Library/Ethereum. The public data is in geth while the testnet directory contains the testnet data.

Remove blockchain and state databases


Continue reading →

Programming Competitions

July 14, 2017

The other week I saw this post about programming competitions and how they supposedly correlate negatively to job performance. This was according to Peter Norvig.

I found this interesting because as most will know the typical work of a programmer is very different from a programming competition.

After looking around a bit I found a Hacker News post for the same blog page with some interesting comments.


Continue reading →

Replace

July 13, 2017

An old Perl script for replacing a string within multiple files.

replace.pl

#!/usr/bin/perl
#
# Replaces a string within multiple files
# specified on the command line
#

$mv = '/bin/mv';

$op = shift || die("Usage: $0 perlexpr [filenames]\n");
print "$op\n";
print "@ARGV\n";

if (!@ARGV) {
  @ARGV = <STDIN>;
  chop(@ARGV);
}

foreach $file (@ARGV) {
  if (!-f $file) { print "Skipping non-regular file: $file\n"; next; }
  if (-B $file) { print "Skipping binary file: $file\n"; next; }

  $outfile = "/tmp/$file.$$";

  open(FILE, $file) || die("Couldn't open $file: $!\n&quot;");
  undef $/;
  $_ = <FILE>;
  close(FILE);

  if (eval $op) {
    open(OFILE, "> $outfile") || die("Couldn't open $outfile: $!\n");
    print OFILE;
    close(OFILE);

    system($mv, '-f', $file, "$file.bak");
    system($mv, '-f', $outfile, $file);

    print "File changed: $file\n";
  }
  else {
    print "No change to file: $file\n";
  }
}

exit(0);


Continue reading →