I tried mining Vertcoin for 1 month

…And I plan to keep mining.

It has been a fun experience and I would recommend it to anyone who is interested in learning how mining Vertcoin works. I have a gaming PC at home which has a pretty powerful graphics card, the Nvidia 1080Ti. Before I started mining I would turn this beast off to save money on my power bill. However, these days it runs 24/7 as I would save less money by turning it off.

Why start mining Vertcoin?

First of all, only try mining cryptocurrency if you either pay for your own electricity or have discussed this with however does. Mining can get expensive, especially if you have multiple graphics cards.

The reason why I started mining was pretty simple. Over the last year I had taken a greater interest in cryptocurrency and felt the itch to develop something. I had set up my own Bitcoin node and started making applications that would parse and analyse the blockchain. By the way, if you want to get more in depth there is a pretty awesome tutorial on how you can create your own blockchain and cryptocurrency with Go.

I moved from Bitcoin to Vertcoin as the blockchain is much smaller than the 160GB beast that Bitcoin has. It’s just easier to work with and more portable. Vertcoin also follows Bitcoin with implementations like Lightning that will speed up transactions and make them much cheaper. The main difference between Vertcoin and Bitcoin is Vertcoin’s ASIC resistance. Bitcoin is currently very hard to mine and requires an investment of at least a few thousands of dollars for specialized miners to get started. This is not something that the average person can buy. Vertcoin uses more memory heavy algorithms which makes it perfect for mining with a graphics card.

Of course this has also had some negative side effects as miners started buying every graphics card they could get their hands on. This has resulted in much higher prices and a lack of availability for PC gamers. I hope that this is a temporary side effect.

How much did I earn?

I have earned a total of 40 VTC as can be seen on my mining address here: VcMhEJrnYKNjTSrkazwJXgLHVRB5vKuouv. This is about $120 in todays value. Since I am living in Germany at the moment my electricity bill is a bit high but comes in at less than half of my rewards. I did this without mining full time, I paused my mining almost every day and played some games for an hour or two. I plan to keep my VTC to save them or use them to test future projects that I think of. I still have 3 days left before I have actually mined for a full month.

How do you mine Vertcoin?

I run a public node that can be seen here, anyone is free to mine on it http://185.201.144.162:9181/static/. I have also written a guide on how to mine VTC over at VTCPool.io.

The developers have made mining Vertcoin super easy, I run the One Click Miner on my Windows 10 PC without the need to configure anything.

What should go in the HTML head?

Recently i launched my new personal website ma.rkus.io and that gave me the opportunity to redo the entire website including the HTML head. It was a nice review and here is what I came up with.

The minimum header I would recommend is something like this:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Ma.rkus.io - Markus Tenghamn</title>
</head>

Now, this is a very minimum header and you probably want to add more to your own website. The meta tags above should always be included and it’s good if they are always placed at the top of the head section. The charset tag declares the charset of your site, most likely utf-8 unless you are creating a site in a language. Even if it is another language I would recommend trying to use utf-8 when possible. The http-equiv header is used to simulate a header, in this case we want to tell internet explorer that our website should be displayed in Edge mode. You could set this content to be ie=IE9 or something similar depending on what your website supports. Next up we have the viewport meta tag which controls the layout of the website on mobile browsers. Above we have the standard viewport tag but you could customize this if you wanted to. Lastly we have the title tag, this is just the title of the page. It will be displayed at the top of the browser, inside the tab, and should be short a descriptive.

Now that we are through that let’s take a look at what we would like to include in our head section to make our site as social/search engine/whatever friendly.

The Perfect Head

So after looking through two great guides, a list of everything that could go in the HEAD section and we can also take a look at what meta tags Google looks at for SEO. After some work the following is the final head section that I come up with for Ma.rkus.io.

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta http-equiv="Content-Security-Policy" content="default-src 'self' fonts.googleapis.com html5shiv.googlecode.com www.googletagmanager.com 'sha256-yLOInxBc4CwSRE31rZlC61JnPqxxvnZx8qxapo3Zfhk='">
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker."/>
    <meta name="keywords" content="markus tenghamn, markus, tenghamn"/>
    <meta name="robots" content="index,follow">
    <meta name="google-site-verification" content="9eFWWHuUuoi_nrT071F-xYQsekK2ZkRFfSsEwjiKt7Q" />
    <meta property="og:url" content="https://ma.rkus.io">
    <meta property="og:type" content="website">
    <meta property="og:title" content="Markus Tenghamn - Programmer, Team lead, Thinker">
    <meta property="og:description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
    <meta property="og:site_name" content="Markus Tenghamn - Programmer, Team lead, Thinker">
    <meta property="og:locale" content="en_US">
    <meta property="og:image" content="https://ma.rkus.io/img/markustenghamn.jpg">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@markustenghamn">
    <meta name="twitter:creator" content="@markustenghamn">
    <meta name="twitter:url" content="https://ma.rkus.io">
    <meta name="twitter:title" content="Markus Tenghamn - Programmer, Team lead, Thinker">
    <meta name="twitter:description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
    <meta name="twitter:image" content="https://ma.rkus.io/img/markustenghamn.jpg">
    <meta itemprop="name" content="Markus Tenghamn - Programmer, Team lead, Thinker">
    <meta itemprop="description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
    <meta itemprop="image" content="https://ma.rkus.io/img/markustenghamn.jpg">
    <meta name="theme-color" content="#383a3c">

    <title>Markus Tenghamn - Programmer, Team lead, Thinker</title>

    <base href="https://ma.rkus.io">

    <link href="css/normalize.css" rel="stylesheet" type="text/css"/>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <link href="css/component.css" rel="stylesheet" type="text/css"/>
    <link href='://fonts.googleapis.com/css?family=Raleway:200,400,800' rel='stylesheet'>
    <link rel="author" href="humans.txt">
    <link rel="me" href="https://ma.rkus.io" type="text/html">
    <link rel="me" href="mailto:m@rkus.io">
    <link rel="me" href="sms:+491746240636">
    <link rel="archives" href="https://archives.tenghamn.com">
    <link href="https://plus.google.com/+MarkusTenghamn" rel="publisher">


    <!--[if IE]>
    <script src="://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>

Now, that’s a lot of code to just dump at one time. Don’t worry though we will break it down. I have tried to organise the different types of tags into different sections, keeping my meta tags grouped above my link tags for example. So our first tag is the Content Security Policy tag:

<meta http-equiv="Content-Security-Policy" content="default-src 'self' fonts.googleapis.com html5shiv.googlecode.com www.googletagmanager.com 'sha256-yLOInxBc4CwSRE31rZlC61JnPqxxvnZx8qxapo3Zfhk='">

This tag is not as important as it might have been in the past but it can still be good to add. CSP is a tag that makes sure that any stylesheets, images, scripts and such that you add externally or directly on your page is allowed. If a source is not allowed the browser should not load the script and thus protecting your site from someone adding external scripts and such to your page. Doing it in a meta tag doesn’t add much security but better than not having it at all, doing it in a header would be even better.

Next up we have the charset, http-equiv and viewport tags.

<meta charset="UTF-8"/> 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1">

These tags deal with how your page should be displayed. I almost always recommend going with UTF-8 as your charset unless you absolutely have to use another charset. http-equiv allows us to tell Internet Explorer or Edge the browser that we have optimised our content for. And finally, the viewport tells mainly mobile browsers how to render our page.

Up next is our keywords, description and robots tags:

<meta name="description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker."/>
<meta name="keywords" content="markus tenghamn, markus, tenghamn"/>
<meta name="robots" content="index,follow">

These tags used to be more important in the past when search engines put more weight on them. However, keyword stuffing and other blackhat tactics has made them less important. Some SEO experts even recommend removing the keywords tag. Keywords and description are pretty self explanatory but remember to keep them fairly short. Maybe 5 keywords and the description should fit in a Google search result. The robots tag just tells search engines like Google that we would like to get indexed. You could modify the robots tag to try to prevent getting indexed if that is what you wanted to do.

A simple tag to verify ownership of my website is done with the Google site verification tag like so:

<meta name="google-site-verification" content="9eFWWHuUuoi_nrT071F-xYQsekK2ZkRFfSsEwjiKt7Q" />

You can get your own tag to tell Google that you own your site and also hope that this will get you indexed faster by going to the Google Search Console.

Next we will take a look at social tags:

<meta property="og:url" content="https://ma.rkus.io">
<meta property="og:type" content="website">
<meta property="og:title" content="Markus Tenghamn - Programmer, Team lead, Thinker">
<meta property="og:description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
<meta property="og:site_name" content="Markus Tenghamn - Programmer, Team lead, Thinker">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://ma.rkus.io/img/markustenghamn.jpg">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@markustenghamn">
<meta name="twitter:creator" content="@markustenghamn">
<meta name="twitter:url" content="https://ma.rkus.io">
<meta name="twitter:title" content="Markus Tenghamn - Programmer, Team lead, Thinker">
<meta name="twitter:description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
<meta name="twitter:image" content="https://ma.rkus.io/img/markustenghamn.jpg">
<meta itemprop="name" content="Markus Tenghamn - Programmer, Team lead, Thinker">
<meta itemprop="description" content="Official website of Markus Tenghamn. A Programmer, Team lead, Thinker.">
<meta itemprop="image" content="https://ma.rkus.io/img/markustenghamn.jpg">

Now this is a big block of code but you will see that it is basically the same thing over and over for different social networks. We start with the og: properties which Facebook’s open graph. Then we have Twitter’s twitter: property finishing with Google’s own itemprop. These tags mainly make it easier for Social networks to display your page properly when it is shared on social networks. You can set a title, description and image for these tags. Some even let you define the authors username and more. If you expect users to share your content on social networks you should put a lot of thought into how you write these tags.

Next we have the theme-color tag for android that simply changes the browser header color. It’s a nice touch in my opinion.

<meta name="theme-color" content="#383a3c">

The title tag, one of the most important tags, will define what is displayed in the users browser tab:

<title>Markus Tenghamn - Programmer, Team lead, Thinker</title>

Keep the title short and simple. Generally you want to add the brand name and some major keywords that relate to that brand.

Next up is the base tag which simply defines the base page for our website. You should set this to your index page.

<base href="https://ma.rkus.io">

We load a few stylesheets here and a font. Nothing really special about style tags other than the fact that you might want to keep the href tag as close to the beginning of these tags as possible to improve load speed.

<link href="css/normalize.css" rel="stylesheet" type="text/css"/>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/component.css" rel="stylesheet" type="text/css"/>
<link href='://fonts.googleapis.com/css?family=Raleway:200,400,800' rel='stylesheet'>

Next up is the author related tags:

<link rel="author" href="humans.txt">
<link rel="me" href="https://ma.rkus.io" type="text/html">
<link rel="me" href="mailto:m@rkus.io">
<link rel="me" href="sms:+491746240636">
<link rel="archives" href="https://archives.tenghamn.com">
<link href="https://plus.google.com/+MarkusTenghamn" rel="publisher">

These tags are for the person who created the page. In my case this person is obviously me and some tags might seem redundant. I also squeeze in a link to my archives on my old website archives.tenghamn.com. One pretty cool thing that I added was humans.txt, if you don’t know what this is then head over to humanstxt.org, it is basically a robot.txt for authors and let you give credit to the team who created your website.

Finally we end the head with our conditional IE tag:

<!--[if IE]>
<script src="://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

This basically says that if the browser is Internet Explorer then it should load this extra javascript file in order to handle our HTML5 content.

That’s it for this post, I hope it gives some insights into what should go into the HTML head. If I missed something or said something that you disagree with then please do leave a comment and I will update! Stay tuned for my next article.

Facebook – A Free $10 Credit Will Be Applied When …

Recently I have been getting “spam” notifications from Facebook where it says that “A free $10 credit will be applied when you boost a post”. I have not managed any Facebook pages for months and I have not personally posted anything and therefore I found this pretty annoying. See the image below.

It would have been fine if this was a one time notification but it kept popping up every day or so. I decided to click the notification to see where it let. Maybe clicking the notification would make it stop? Clicking the notification takes me to an error page, I have tried this on multiple occasions and it is still the same result shown below.

I would also get the notification in chrome as I had enabled notifications for Facebook in chrome.

Chrome Facebook notification
Chrome Facebook notification

I tried clicking this notification and it simply takes me to a blank white page which never loads.

This made the notification even more annoying, why send me a notification that doesn’t go anywhere. Now I needed to figure out how to turn this off, I checked my page notification settings and they were all turned off (I get invited to “help” administer a lot of pages because friends and family see me as an expert because I work with computers).

Turn off Facebook notifications
Turn off Facebook notifications

All my page notifications had already been turned off so clearly this wasn’t the answer. I was getting the notification anyways. Then I remembered that I tried Facebook ads several years ago and figured the notification was coming from some old account there.

Turning off Facebook Ads Notifications

After some searching I finally found my Facebook ads account and the settings page where I could change my notification preferences. To get there go to your Facebook Ads account. Click the cogwheel in the top right corner and then click notifications on the left hand side. Here you can toggle notifications on or off which should disable the notification above.

Turn off Facebook Ads notifications
Turn off Facebook Ads notifications

I hope that helps anyone else who runs into this problem. Feel free to share your own problems with Facebook notifications below. It’s always interesting to hear.

Edit: The above solution might work but if it does not you might have to just figure out what page is making new posts. Most likely it is a page you are an administrator or editor to. Try changing your role to something lower or remove yourself from this role completely. I wish Facebook made this easier to manage.

I made a simple Bcrypt hash generator website with Golang

Sometimes when I am working with dummy database I might need to change the password of a generated user. The easiest way to do this is to got to google for a bcrypt generator and then paste the generated hash into the database in order to update the password. This is much quicker than having to write a function to do this for me or to create a new user from scratch. It is also useful if I need to reset a password to an account which I have totally lost access to. Turns out I don’t like many of the bcrypt generators that are out there and the domain bcrypt.fun was available so I figured, why not make my own generator since I already created password.fun.

So in one afternoon I sat down, copied most of the code I had used for password.fun and created this new website. The website uses the Revel framework which feels overkill for a small website like this. I also have no frontend design skills. I just went with the old standard bootstrap layout which looks alright. Now that the site is done you are able to paste in one or more strings (one per line) which will turn into a bcrypt hash when you hit generate. That’s all that it really does, so simple. It does have an API which is technically open to anyone to use but I skipped the documentation and FAQ sections for this project as it was probably overkill for the password generator anyways. There is also no mailchimp sign up form, why did I even add that to the password site?

Deploying Bcrypt.fun

Once again I would like to mention that this is all hosted with Caddy. Caddy makes the setup super simple compared to Nginx or Apache that I used to use in the past. The configuration is literally 4 lines which includes the SSL configuration, see below:

www.bcrypt.fun, bcrypt.fun {
    tls markus@tenghamn.com
    proxy / localhost:8005
}

As always, you can find the entire source code for Bcrypt.fun on Github.

CLI Crypto Portfolio Tracker In Go

From what I learned in earlier posts, mostly parsing json from an API endpoint, I created a simple command line program that tracks any cryptocoins and their respective values, you can input the price and amount you bought it for. Colors can be turned on or off, the update interval can be configured and you could have as many or as few coins as you would like. See it in action here:Golang Crypto Portfolio Tracker

Read my original Steemit post here: https://steemit.com/cryptocurrency/@tenghamn/i-made-a-command-line-cryptocurrency-tracker-in-go

See the code on github and download the release: https://github.com/markustenghamn/golang-cryptotracker

How To Make A Simple Go Program To Track The Price Of Steem Via An API

Earlier today I wrote a quick tutorial on how to use golang to track STEEM or any cryptocurrency for that matter. You can find the post on my Steemit account @tenghamn on steemit here https://steemit.com/cryptocurrency/@tenghamn/how-to-make-a-simple-go-program-to-track-the-price-of-steem-via-an-api

The current script is pretty simple and I plan to expand on it to make a tool that will allow you to track any cryptocurrencies along with a gained or lost amount or percentage based on at what price and how much you purchased these coins for.

You can find the entire script on github here: https://github.com/markustenghamn/golang-steem-cryptotracker

Switching From Nginx To Caddy

I am a long time user of Apache, it was the first web server software I learned to use and therefore it felt like a no brainer to always use it. However over the past year I have started using Nginx more and more. It felt foreign at first but once you get a hang of how to configure new hosts and do the initial setup it’s really just as easy to use as Apache and in my current opinion, much better when it comes to memory usage and the amount of requests it can handle. If you want to read more about the differences you can read this post from tutsplus that describes the pros and cons of using either one for a wordpress website (generally the things discussed here applies to most other applications).

There you have some background information, so what’s Caddy and why should I switch to it? Caddy is written in go and is much easier to use compared to Nginx or Apache but I would not claim that it’s better than either of these. There is a pretty good article describing the differences of Nginx and Caddy here. So why use it? Well with Nginx I have the main configuration file and an additional host file. Here is a full example configuration from the Nginx docs.

So let’s take a look at Caddy, here is what my config file might look like if I was setting up a Laravel website.

example.com {
    root ./public
    fastcgi / 127.0.0.1:9000 php
    rewrite {
        to {path} {path}/ /index.php?{query}
    }
}

That’s it. That’s all the configuration I need to write to get my Laravel site up and running. If I want to add another host on my Caddy server I can simply add another host under this one with the same structure.

The best part is you can automatically download, verify and configure ssl certificates from Let’s Encrypt for any domain as long as the domain already points to your server.

Caddy is written in go and supports plugins. To install plugins simply download the Caddy source and import your plugins, you can find a list of plugins on the Caddy forums.

Learning Go

So I have spent the past few weeks trying to get better at Go. I wanted to share a really good resource that I found useful and it’s called Go By Example. I love this site because it provides easy to understand examples for pretty much any of the basic things in Go. As a PHP developer I know how I would like to solve a problem, perhaps I need a for loop and maybe I don’t feel 100% sure how to write this. In that case I can turn to go by example which has a great example of a for loop in go.

So lately I have been working on my side project tournify.io which is a site where you can create tournaments for free. The current site is written in Laravel and contains plenty of bugs. My current goal is to rewrite all the logic with a go backend and use ReactJS for the front end. I have my good friend Alx101 helping me with the frontent. Both Go and ReactJS is pretty new to us so we will see how it goes.

Hello World!

As I start writing on GoPHP.io I find myself a complete beginner to golang. I began using PHP for an ecommerce site when I was 13 and have used PHP ever since. I feel that now is a good time to learn and perhaps master a new language and I picked Go!

So what’s the plan with this website, where will it be heading? I hope to create a useful site with plenty of guides and useful tips based on what I am currently learning and finding as I go. Why would I make such a site? I like teaching and helping others and a site such as this one gives me an outlet and a hobby where I can do those things.

This is just a quick intro post. Hopefully I will complete and finish my first guide soon. If you would like to follow me on a more personal level, feel free to check out my blog at tenghamn.com.