teleren/devto huggingface dataset:
How to get a free Google server forever
Tags: devops, googlecloud, webdev, tutorial
Published: 2020-11-08 20:22:50


> NOTE: GOOGLE HAVE CHANGED THEIR FREE TIER FROM F1-MICRO TO E2-MICRO. PLEASE USE E2-MICRO TO GET A FREE SERVER. YOU CAN UPGRADE YOUR CURRENT INSTANCE [LIKE THIS](https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance#before-you-begin).

I first heard you could get a free Virtual Private Server instance on the Google Compute Engine from a random person on Twitter.

{% twitter 1284414043449511937 %}

So here's how to do it.

1.  Go to the [Google Cloud Platform Console](https://console.cloud.google.com) and sign up/in if you have to and go to the [Compute Engine](https://console.cloud.google.com/compute) section using the hamburger menu top left.
2.  Enable Compute Engine if it's not already enabled and then set up billing (you need to add a credit card or PayPal but don't worry you won't be charged).
3.  Create a new instance in one of the free tier locations (Iowa, Oregon, or South Carolina) with machine type `f1-micro`.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ilidqjs8kh3gelslxchx.png)

Finish the server config (make sure you add the max 30GB free disk space) and spin up the server.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ri2rlac53dzk7k290mju.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hw8agt33isxibhzztc4y.PNG)

Click the **Connect via SSH** button to log in.

And that's about it for now. Enjoy your free server forever!

> If this post helped you please consider <a href="https://github.com/sponsors/phocks">sponsoring my open source projects</a> on GitHub for $1.

---

*NOTE: Even though you can run this server for free, Google may charge if you go over certain ["free tier" limits](https://cloud.google.com/free) etc so just keep a lookout for that in the terms and conditions...*

Update: The free offering from Oracle Cloud is almost certainly better than Google Cloud. See this article 👇

{% link https://dev.to/phocks/how-to-get-2x-oracle-cloud-servers-free-forever-4o22 %}
Hacktoberfest Challenge Completed
Tags: hacktoberfest
Published: 2020-11-08 20:15:04

### Intro  
I'm new to the DEV community, just started my career as a software engineer. And as a programming geek, I willing to contribute to FOSS for a long time. So Hacktobterfest is a great opportunity to start within the FOSS world. I participated for the first time in hacktoberfest. And completed the challenge successfully.
 

### Progress
I raised 5 PR in total. All are merged now, Yayyy!!!✨
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9wc3yxey8r5cl6ikfwuo.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1fqc4k1zqq655nu8s7g4.png)

### Contributions
I contributed to two projects one related to the chrome extension frontend, I choose this project because these days I'm mostly working on the frontend and the other is related to Linux process tree visualization written in python. I choose this project because I'm in love with the intuition of python, learning it from the beginning of academics.

#### PR list
Feat/ayah history
https://github.com/hasanhameed07/ayat-today/pull/7

Feat/prefetch ayah
https://github.com/hasanhameed07/ayat-today/pull/10

Fix/output-file-name
https://github.com/smithandrewl/py_process_graph/pull/7

Feat/build documentation
https://github.com/smithandrewl/py_process_graph/pull/8

Feat/cli-args-for-filename
https://github.com/smithandrewl/py_process_graph/pull/9

### Reflections
Hacktoberfest 2020 brings an amazing experience and joy to me. surely I will participate again and go beyond and will try to contribute every month!
A CPAN Dashboard
Tags: perl, cpan, dashboard
Published: 2020-11-08 20:03:11

---
title: A CPAN Dashboard
published: true
description: An older project of mine has received a bit of publicity recently. Let me explain a little bit about it.
tags: perl, cpan, dashboard
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/3jy9frs7vqrpi9sgzil1.png
---

The first commit in my [CPAN dashboard repository](https://github.com/davorg/dashboard) is from July 2015. And I mention it in passing in a [blog post from the same month](https://perlhacks.com/2015/07/culling-my-modules/), but it seems to have gone mildly viral over the last few days.

It's not a particularly complicated piece of code. It grabs the list of my CPAN modules from the [MetaCPAN API](https://metacpan.org/pod/MetaCPAN::Client) and then creates a table (using [Bootstrap](https://getbootstrap.com/) - which makes up for my total lack of design skills). Each row of the table represents one of my modules and the columns display badges from the various services that I use to monitor the health of my modules ([Travis CI](https://travis-ci.org/), [Coveralls](https://coveralls.io/) and [Kritika](https://kritika.io/)).

I've talked about the dashboard a few times in the intervening years (here, for example, is [a talk from last year's London Perl Workshop]()) but I've been slightly disappointed that no-one else (as far as I know) has ever used it to monitor their modules.

But that might be about to change. Recently, Gabor wrote [an article about using Github Actions to test Perl modules automatically](https://perlmaven.com/setup-github-actions) and used that as a prompt to add a basic testing Github Action to all of my modules and then found a simple way to add a Github Action status button to the dashboard.

Adding the Github Action to my modules wasn't entirely successful (I have quite a few issues to fix) but I was pleased with how easy it was to add the new button, so I tweeted about it and posted an image to a couple of Facebook posts. And this time people seemed to notice it and I've seen quite a few people talking about it over the last few days. Then on Saturday morning, I saw that Gabor had [made a video](https://www.youtube.com/watch?v=lejHLAtD23o) discussing it.

So, while people are talking about it I'd like to promote it a bit. If anyone would like help to set it up for their CPAN modules, then I'd be happy to do what I can do get it up and running. I'm also thinking about setting up a site where any CPAN author can easily start seeing the health of their modules - more information on that soon. And in [a Reddit discussion](https://www.reddit.com/r/perl/comments/jpnsh8/cpan_dashboard_of_dave_cross/), Gabor points our that it's really not tied to CPAN or Perl at all and that programmers in any language might be interested in using a dashboard like this. It's certainly something to think about.
Timestream Data Design & Ingestion
Published: 2020-11-06 21:39:20

After the [first introduction](https://dev.to/pblitz/aws-timestream-an-intro-4i1j) to AWS Timestream, let's get into it. 

Let's first spin some data. As an example, let's assume that you have an IoT device that will send you the following event every so often:

````json
{
    "event_id": 123456,
    "created_time": 1604355422089,
    "device_id": "test_device",
    "usecase": "retail",
    "device_battery": 80,
    "temperature": 60.34,
    "weight": 20
}
````

So how do you get this into `AWS Timestream`? 

As with every database, you start with your schema.
AWS Timestream splits its data into `measures` and `dimensions`. How should we break our sample event into these categories?
As the [docs](https://docs.aws.amazon.com/timestream/latest/developerguide/concepts.html) say, fields that "describe" the data should be the `dimensions`. In the event above, I would see the `event_id`, `device_id`, and `usecase` as the *dimensions*. Conversely `device_battery`, `temperature` and, `weight` would be the *measures*. And `created_time` as the *time* dimension of course.

The weird thing about AWS Timestream is that you will add this data as 3 rows, as it contains three measurements: 

| event_id  | device_id | usecase | measure_value::BIGINT | measure_value::DOUBLE | measure_name | time |
|--|--|--|--|--|--|--|
| 123456 | test_device | retail | 80 |   | device_battery | 1604355422089 |
|123456|test_device|retail||60.34|temperature|1604355422089|
|123456|test_device|retail|20||weight|1604355422089|
Certifications - worth it or waste?
Tags: certification, discuss, aws
Published: 2020-11-08 19:51:14

In many areas of the IT industry, there are a lot of certifications to obtain.  Various tools, platforms, ways of working - there are certifications for many things. There are many companies whose core business is to deliver training to people who want to certify themselves in different areas.

Is it worth the effort and time for those who take these certifications? Is it valuable for companies using the services of these persons, or employing them?

In some areas outside of IT, I do think certifications are valuable.
If I want to renovate our bathroom, I would certainly only use a company with a "wet room" certification to perform the work. It would not be my only criteria to choose a company for this work, but it would be one factor.

However, if I would be in the position to interview someone regarding a job at my employer, for example, it would not be a mandatory requirement. There are other factors I would consider more important.

Yet, I do have five certifications with AWS (Associate, Specialty and Professional ones) and my employer works currently 100% with AWS. We are encouraged to get certified also. One reason for this that AWS has requirements on the companies that are AWS partners how many individuals are AWS certified and what type of certifications they have, depending on areas and partner levels. 

For me, I think documented experience trumps certifications. In the IT space, being certified may potentially help if you do not have documented experience before, as a way to geet the foot in the door somewhere. But then the meaning of a certificate is a bit different than in other areas. Certified then means that you may have some expertise in a specific area, but it may not necessarily be practical experience. It is more a certificate of study than anything else.

For me, a certification is more something that I would do if my employer would want me to, for the most part.

What about you, what do you think about certifications?
The Perils of PHP
Tags: codenewbie, beginners, php, career
Published: 2020-11-08 19:33:03

I had an initial assessment with a large company recently. A global financial corporation who advertised their in house "coding academy" or similar. The role was for very junior level devs as it included a few years' of serious training within the company itself.
The wording of the job advert was - and I explicitly checked this - "you should have a base knowledge of coding in any language".

They send you a standard Hackerrank test; it comes with a generic Hackerrank sample test. I did the sample test - it offered the full gamut of languages supported by hr. [I don't know if that's standard abbreviation for Hackerrank but it'll save me typing that out a million times here, so go with it.] I took the test in PHP and it was very straightforward.

Now, perhaps my error was at this point. Perhaps I should have done it in the Javascript setting hr offers - which is Node.js. I have been taught some vanilla Javascript, and for the kind of problems hr provide it would have worked fine. I was put off by the block of code provided in the Node.js option - I haven't yet dealt with Node at all, and didn't know what this chunk of code was representing in the hr environment. 

Still, I double checked the job ad and the email I'd received inviting me to test. "Any language", and no note in the email to say the languages would be restricted from the hr standard.

Well, you guessed it. They knocked about 30% of the available languages off for the company's actual test; and PHP was one of the ones to go. I lost a half hour working out how to get my FizzBuzz (which took all of 3 minutes) to output in Node and considered giving it up as a lost cause, but did eventually get it sorted. Annoyingly I then had a time shortage and questions 2 and 3 got pseudocoded and no more than that. 

I'm under no illusions about how my result will be scored; if the code doesn't pass the hr test cases, it doesn't matter what happened, you don't get the points.

At the start of the test I was assured I would have a chance to give feedback at the end. Maybe they sensed my mood because I didn't ever get to a feedback screen; just the company's global homepage. Insult to injury...

I'm irritated by the way the whole thing was presented, and I'm irritated that my "base knowledge in any language" didn't actually help me here when *any* language didn't mean that. However, if nothing else, it was very good practice.

More so, I am wondering just how out of favour PHP is if it's not even in the top 15 language choices for entry level assessments like this. I understand that I've learned it within my course for more than the obvious reasons; I've learned it in a way that will help me learn other programming languages in the future.

My question is - should that future start right now? Is this likely to be the case on most generic assessments? Shall I set myself to learn Python before I even consider applying to a grad scheme elsewhere? What is the general opinion on PHP - is it dying out?
Are Dart and Java type systems sound?
Tags: programming, computerscience, java, dart
Published: 2020-11-08 18:53:33

---
title: Are Dart and Java type systems sound?
published: true
date: 2020-11-08 18:38:58 UTC
tags: programming,computerscience,java,dart
canonical_url: https://stereobooster.com/posts/are-dart-and-java-type-systems-sound/
---

From Dart docs:

> **Soundness** is about ensuring your program can’t get into certain invalid states. A **sound type system** means you can never get into a state where an expression evaluates to a value that doesn’t match the expression’s static type. For example, if an expression’s static type is `String`, at runtime you are guaranteed to only get a string when you evaluate it.
>
> Dart’s type system, like the type systems in Java and C#, is sound. It enforces that soundness using a combination of static checking (compile-time errors) and runtime checks. For example, assigning a `String` to `int` is a compile-time error. Casting an `Object` to a string using `as String` fails with a runtime error if the object isn’t a string.

This is an interesting point of view - yes type system is sound (based on the provided definition), but at the same time it means that the application can crash due to type error 🤔.

For example, if I would write:

```java
public class HelloWorld{
    public static void main(String []args){
        String[] strs = { 1 };
    }
}
```

It will not compile:

```
$javac HelloWorld.java
HelloWorld.java:4: error: incompatible types: int cannot be converted to String
        String[] strs = { 1 };
                          ^
1 error
```

But this will compile:

```java
public class HelloWorld{
    public static void main(String []args){
        String[] strs = { "1" };
        Object[] objs = strs;
        objs[0] = 1;
        String one = strs[0];
        System.out.println("Hello World");
    }
}
```

and fail:

```
$javac HelloWorld.java
$java -Xmx128M -Xms16M HelloWorld
Exception in thread "main" java.lang.ArrayStoreException: java.lang.Integer
	at HelloWorld.main(HelloWorld.java:6)

```

I feel like something is twisted here.

**Can we say that type system is sound, but static analyzer isn't?**

Or the other way around - if we can say that relying on dynamic type checks is enough to have a sound type system, can we say that Ruby is sound?

```ruby
1 + "0"
// TypeError: String can't be coerce into Numeric
```

See also: [Java is Unsound: The Industry Perspective](https://dev.to/rosstate/java-is-unsound-the-industry-perspective)
Day8 #100daysCode
Tags: javascript, html, css, tailwindcss
Published: 2020-11-08 18:15:02

#So it's my Day8 
and today I though of doing some real work stuffs *project* for my xxx unknown client. So I did a Gym website with framework like Tailwind,tailwind blocks and Animate scrolling are css and javascript frameworks which i used and made some progress building and animating it with js framework. It was kinda good feeling of making something like that. I'll make the full one make a show off soon in my journal journey.
Why doesn't my custom canvas display when using the same Graphics context?
Tags: help, java, gamedev, graphics
Published: 2020-11-08 17:37:12

So, I've slightly changed my custom canvas class (`CPane`), and, it doesn't throw any errors anymore (where, when I tried to keep both `display`, and `ctx` as their own variables, it threw `NullPointerException`).
And, it doesn't display anything.

Why does it do that?

Class (also, I'm excluding some methods so there isn't too much to read):
```java
/**
* Calin Baenen's version of a canvas element.
*/
class CPane {

	// Debug variables.
	private boolean canCatch = true; // See if this canvas can still catch errors.
	private final JPanel canvas; // Canvas.
	private BufferedImage buffer; // Buffer.
	private final Graphics ctx; // Graphics.



	// Constructor.
	public CPane(int width, int height) {
		this(0, 0, width, height);
	}
	public CPane(int width, int height, Color initialColor) {
		this(0, 0, width, height, initialColor);
	}
	public CPane(int x, int y, int width, int height) {
		this(x, y, width, height, Color.WHITE);
	}
	public CPane(int x, int y, int width, int height, Color initialColor) {
		this(x, y, width, height, initialColor, Color.WHITE);
	}
	public CPane(int x, int y, int width, int height, Color initialColor, Color baseColor) {

		this.canvas = new JPanel(); // Make an element to display the drawing on.
		canvas.setBounds(x, y, width, height); // Set the bounds of the canvas.
		canvas.setBackground(baseColor); // Make the canvas white.
		canvas.setDoubleBuffered(true); // Make the canvas double buffered.

		buffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); // Set the buffer.

		ctx = buffer.getGraphics(); // Get the graphics for the buffer.

		// Paint the image with an initisl color.
		ctx.setColor(initialColor); // Set color.
		ctx.drawRect(0, 0, width, height); // Draw.

	}



	/**
	* Draws a rectangle to the screen by filling an area with color.
	*/
	public void drawRect(int x, int y, int width, int height, Color color) {
		ctx.setColor(color); // Set the context's color.
		ctx.fillRect(x, y, width, height); // Draw a rectangle.
		this.update(); // Update the canvas.
	}



	/**
	* Draw an image to the canvas.
	*/
	public void drawImage(Image image, int x, int y, int width, int height) {
		Image shot = image.getScaledInstance(width, height, Image.SCALE_FAST); // Get the scaled image to draw.
		ctx.drawImage(shot, x, y, null); // Draw the image.
		this.update(); // Update the canvas.
	}



	/**
	* Update the graphics, and log the error if it fails.
	*/
	public void update(boolean catcherror) {
		Graphics display = canvas.getGraphics(); // Get the canvas' display.
		try {
			display.drawImage(buffer, 0, 0, null); // Draw the buffer to the canvas.
		} catch(Exception error) {
			if(catcherror && canCatch) {Book.eog(error); canCatch = false;} // Log the error and disable error catching.
		}
		display.dispose(); // Dispose of the display.
	}

}
```
<div>
##<center><b>Thanks!<br/>Cheers!</b></center>
</div>
s3-auto-sync - watch a folder and automatically sync it with an s3 bucket 🎉
Tags: aws, tooling, devops
Published: 2020-11-08 17:25:50

So I wrote this little cli tool that lets you upload files to an s3 bucket, as changes happen.

All you need to do is install it:

```bash
npm install s3-auto-sync -g
```

And use it like so:

```bash
s3-auto-sync -b my-bucket -d ./my-folder -r eu-east-1
```

Make sure you set the region that you're in, otherwise performance will be slow.

That's it, practically your own little dropbox 🚀

The npm package is here: https://www.npmjs.com/package/s3-auto-sync
And the github repo is here: https://github.com/juliankrispel/s3-auto-sync

If you have any suggestions for features or improvements, by all means open an issue or a pr 🙌
My Notion Powered Blog
Published: 2020-11-13 03:01:35

---
title: My Notion Powered Blog
published: true
date: 2020-11-08 17:19:00 UTC
tags: 
canonical_url: https://borick.net/articles/my_notion_powered_blog/
---

Hello! I’ve just finished making some really neat changes to the way my blog works behind the scenes. I want to make sure everything works, so here’s a quick article!

## Notion

I was inspired by this:

[Powering a blog with Notion and Netlify](https://blog.kowalczyk.info/article/a8cf04d756ec4963905960822b004440/powering-a-blog-with-notion-and-netlify.html)

This person took the time to write a golang library that can pull data from notion, and there’s no way I could have gotten this done without it!

I used this library to dump all the pages within a certian notion database to markdown files.

From there I do some massaging on the files. Things like removing unnessessary markdown elements like the title and modifying notion links to be non-notion links. That way I can link to other articles with just the `+` button in notion: [projects](/articles/projects/). Neat!

## Hugo

To make this as easy as possible, I wanted to integrate with my existing website. Luckily Hugo is all powered by markdown, so I can insert my massaged markdown directly into my hugo site.

## Auto updating

The goal is for me to be able to write things in notion, and have it just appear on the internet. I decided to set up a simple cron script that would run every hour.

Of course cron is somewhat difficult to get working, but I found these resources super useful:

[I put a cronjob in /etc/cron.{hourly,daily,weekly,monthly} and it does not run and how can I troubleshoot it? - nixCraft](https://www.cyberciti.biz/cloud-computing/why-is-my-linux-unix-crontab-job-not-working/)

[how can I make cron run a job right now, for testing/debugging? without changing the schedule!](https://unix.stackexchange.com/a/245056)

To summarize:

- Cron scripts have to omit any file extension, no `.sh` can be present
- they also need the shebang in the script
- you can run `run-parts /etc/cron.hourly` to kick off a cron script to see if it works

## Sharing

Through the magic of RSS I can share things automatically also! [Dev.to](http://dev.to) already supports syndicating articles from an RSS feed, so I can automatically share there for no work. To share links to twitter, I set up a simple RSS to Buffer Zap on Zapier, so a tweet can go out at an appropriate time.

## Conclusion

Hopefully this will make it easier for me to write more! At the minimum it was a fun way to spend part of a weekend.
Fullscreen Background Video WIth Text In HTML/CSS
Tags: html, css, weeklyui, uiweekly
Published: 2020-11-08 17:10:35

Fullscreen background video with text is the best user-interface for any kind of portfolio website or business website. Here we made this beautiful background video with a text interface with the help of HTML and CSS.

In this element we use one video in the background and also we used a heading tag to show in the center. Here we use flex display properties and also we used position properties to make this element properly perfect and attractive interfere.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code](https://w3hubs.com/fullscreen-background-video-with-text-in-html-css/)
Let's code a Queue as a linked list (in a nutshell)
Tags: computerscience, javascript, tutorial
Published: 2020-11-08 16:54:49

The shift() method of the Array type in JavaScript is quite an expensive operation, because by removing the first element of an array it needs to reassign all other indexes. If you need to make intensive use of shift(), it's worth considering implementing a queue based on a linked list, which is, what we're going to do today.

{% youtube rS4IdQhNkWU %}

I hope you enjoy this little tutorial about implementing a Queue. Any feedback will be appreciated, just let me know and leave a comment. 🙏