Took www.genesis-mining.com for a ride

Ok so the reality is https://www.genesis-mining.com. took me for a ride, a ride I willingly stepped onto but crazy! To be sure this is not a typical story and your results maybe very very different. As I can assure my other contract was a total loss.

First what is genesis-mining you ask? Well its a cloud bit miner, meaning they setup crypto mining hardware, mine coins, sell you a shares in those miners, and then pay you out the coins mined. Sound like a interesting deal, well its all speculation but here is out it worked out on one of my test.

From https://www.genesis-mining.com/pricing I chose the Dash Gemini package mainly because bitcoin was so high there was zero chance of making anything. In May of 2016 this package cost me .06 BTC ~27.6 USD, given the value of bitcoin was around $460 on the date of my purchase. So its been 9 months of a 24 month contract and due to a 10x increase in Dash I have recovered $26.2446565848 USD or 0.28400789 DASH at todays value of $92.40819537 USD/Dash. While this seems like a good thing given I have 15 months left on the contract, lets look at another investment I made in Dash in Dec.

On Dec 04, 2016 I invested $9.92 ($10 – exchange fees ) 0.01302497BTC for 1.13682797 DASH that $10 purchase is today valued at $105.0522211500.

While the Genisis contract looks like it may payout well, the reality is if I had taken that same .06 BTC (27.6 USD) and simply bought Dash coins it would be a net gain of nearly $270 USD vs the $0 USD gain I have with Genesis. Sure there is 15 months left on my contract but again even if it maintained the trend of 0.28400789 DASH every 9 moths I and Dash valuation stayed flat I would end up with a net gain of maybe $41 USD vs the $270 USD for just buying the coin. Pretty simple to see where I should place my money in the future. Even with Coinbases massive fees you still end up way ahead by buying crypto currency vs using Genisis.

I knew when I went into the the deal I was likely going to loose, but I was learning and am luck enough that loosing $30 bucks will not set me back. What I do worry about is all those suckers they are preying on, who think they are getting a good value. I would go as far as saying they are scam, they are a legitimate business model and you “could” make money if you use them. All I am saying is you could make a lot more just buying coins directly and you never need to recover your upfront fees. That said if you looking for a business model where you always win … cloud mining might not be a bad company to start.

Docker for that old software you can not update!

So I host a few websites for friends and family and as always you have one person who runs old software that they just do not want to update. The software in question this time is Gallery http://galleryproject.org a php photo gallery that stopped producing updates 2014-06-20. Every time I updated by Ubuntu server I worried about how much trouble it was going to be to make sure it still worked. The fix run the damn thing in docker! Starting with a backup of the gallery web directory from my old server I put it into /home/websites/gallery_example-com/gallery/html.

Ok first decided that the old php version in Centos 5 would be a good fit and decided to start from there and to make it easier I decided to look at the CentOS-Dockerfiles from

https://github.com/CentOS/CentOS-Dockerfiles/blob/master/httpd/centos6/Dockerfile

Knowing I wanted to run CentOS 5 I decided to rebuild the Docker image using this updated Dockerfile in my project directory ~/Development/gallery_docker/Dockerfile

FROM centos:5.11
MAINTAINER Joshua Miller
LABEL Vendor=”CentOS” \
License=GPLv2 \
Version=2.4.6-40

RUN yum -y update && \
yum -y install httpd && \
yum clean all

EXPOSE 80

# Simple startup script to avoid some issues observed with container restart
ADD run-httpd.sh /run-httpd.sh
RUN chmod -v +x /run-httpd.sh

CMD [“/run-httpd.sh”]

I also need the file run-httpd.sh that I put into ~/Development/gallery_docker/run-httpd.sh

#!/bin/bash

# Make sure we’re not confused by old, incompletely-shutdown httpd
# context after restarting the container. httpd won’t start correctly
# if it thinks it is already running.
rm -rf /run/httpd/* /tmp/httpd*

exec /usr/sbin/apachectl -DFOREGROUND

Now I had to build the the docker image in ~/Development/gallery_docker/ with the tag jassinpain/gallery_example:1 so we can version this sucker.

docker build . -t jassinpain/gallery_example:1

And run the image, exposing container port 80 via host 8080 for now as we do not have our haproxy configured yet at this point.

docker run -d –name gallery_example -p 8080:80 jassinpain/gallery_example:1

At this point I was able to browse to http://server_ip:8080/ and see the sample webpage was up and running

Next I decided to clean up, then restart with a bind to my gallery directory to the Apache DocRoot.

docker stop gallery_example
docker rm gallery_example
docker run -d –name gallery_example -p 8080:80 -v /home/websites/gallery_example-com/gallery/html:/var/www/html jassinpain/gallery_example:1

I was luck there was a simple README.html in my /home/websites/gallery_example-com/gallery/html directory so once the image was up I was able to test Apache was still working by browsing to http://server_ip:8080/README.html

From here I needed to do some debugging so I needed to drop into the container console with the following command.

docker exec -i -t gallery_buckhornskinners /bin/bash

I quickly realized I forgot to add php, oops I decided to make quick fix by installing php and some supporting software that I know gallery want and exited the image shell.

yum -y install php53 php53-cli php53-common php53-mysql ImageMagick gd
exit

I needed to restart Apache and since this image does not have a init system the quickest way was to just restart the Docker container.

docker restart gallery_example

At this point I was able to browse to http://server_ip:8080/ and presented with the config page of gallery. As I stepped through I realized that the mysql server details needed to be updated. The wonderful thing about using the bind volume meant I could just use vi to update the /home/websites/gallery_example-com/gallery/html/config.php and update the hostname which is really the DB server.

$storeConfig[‘hostname’] = ‘172.17.0.1’;

From here I was able reload http://server_ip:8080/ and was good to go!

The final steps was to make a clean Docker image by updating the Dockerfile to add the php packages.

FROM centos:5.11
MAINTAINER Joshua Miller
LABEL Vendor=”CentOS” \
License=GPLv2 \
Version=2.4.6-40

RUN yum -y update && \
yum -y install httpd php53 php53-cli php53-common php53-mysql ImageMagick gd && \
yum clean all

EXPOSE 80

# Simple startup script to avoid some issues observed with container restart
ADD run-httpd.sh /run-httpd.sh
RUN chmod -v +x /run-httpd.sh

CMD [“/run-httpd.sh”]

And then rebuild the image:

docker build . -t jassinpain/gallery_example:2

Stop the old image, clean it up, and start with the new image

docker stop gallery_example
docker rm gallery_example
docker run -d –name gallery_example -p 8080:80 -v /home/websites/gallery_example-com/gallery/html:/var/www/html jassinpain/gallery_example:2

And then verify by browsing to http://server_ip:8080/

I then put it behind a haproxy image to allow me to add more projects like may flask-sample, but thats another post!

Its been a while

Was applying for jobs a while back trying to step back into IC roles but keep hitting the problem with my resume having to much manager experience. I keep tying to figure out how to get past that problem so until then I just keep working at the current job. Pushing ahead learning what I can until I can get that resume back to a good place and move to Austin. Fun stuff ahead!