teleren/devto huggingface dataset:
Run a cron job with Docker 🤖
Tags: cron, docker, code, programming
Published: 2021-04-09 19:35:25

---
title: Run a cron job with Docker 🤖
published: true
date: 2021-03-25 23:15:00 UTC
tags: cron, docker, code, programming
canonical_url: https://www.benjaminrancourt.ca/run-a-cron-job-with-docker
cover_image: https://www.benjaminrancourt.ca/temp/run-a-cron-job-with-docker.2274.jpg
---
I recently had to create a `Dockerfile` for a small application and since we had to run it periodically, I chose to integrate it with the native **cron** available on Linux distributions.

Unfortunately, it took a little longer than I initially expected, but I finally managed to get it working correctly with the help of an [old Stack Overflow response](https://stackoverflow.com/a/37458519). 📚

Since I think it won't be the last time that I need to do a similar task, I decide to write this quick post as a reminder for myself. 🧓

I hope it will helps you as well! 😎

## Dockerfile

```dockerfile
# https://hub.docker.com/_/debian?tab=tags
FROM debian:stable-20210311

# Copy the cron file into our image
COPY synchronization.cron /etc/cron.d/synchronization.cron

# https://packages.debian.org/search?suite=buster&keywords=cron
# Install packages for our application
RUN apt-get update && apt-get -y install \
    # Cron to periodically run our application
    cron=3.0pl1-134+deb10u1 \
    # Give execution rights on the cron job
    && chmod 0644 /etc/cron.d/synchronization.cron \
    # Apply cron job
    && crontab /etc/cron.d/synchronization.cron

# Copy the JAR file into our image
COPY build/libs/sherby.synchronization.example.jar /opt/service/sherby.synchronization.example.jar

# Start cron in the foreground
CMD ["cron", "-f"]
```

## Cron file

Instead of a normal log file as `/var/log/cron.log 2>&1`, I redirect the output directly to `stdout`/`stderr` as they are automatically collected by another tool in our infrastructure. 🏭

```cron
# Execute our application every minute (https://crontab.guru/#*_*_*_*_*)
* * * * * /opt/java/openjdk/bin/java -jar /opt/service/sherby.synchronization.example.jar > /proc/1/fd/1 2>/proc/1/fd/2
# An empty line is required at the end of this file for a valid cron file.

```
<figcaption>Code of the <code>synchronization.cron</code> file</figcaption>
Day 337 : Delay
Tags: hiphop, code, coding, lifelongdev
Published: 2021-03-25 22:26:50

_liner notes_:
- Professional : Whew...what a day! Had a meeting. Did a little coding, but most of the day was working the virtual booth at a conference. Like yesterday, my laptop really didn't not like the website. haha It really pushed the limit of my laptop. My laptop's fan normally comes on during video calls, but this time the whole computer got slow. There was a delay in my video. Even when I typed, there was a delay. haha Got to talk to a few folks. When brainstorming with someone, they got an idea to build a demo for work. These are the things I really like doing at conferences. Talking with people and seeing what their needs are and how we can help achieve their goals. Totally lost track of time. haha

- Personal : Didn't get too much coding done last night. I went down a rabbit hole buying things I'll need to put together the pieces I finally have coming this week to build out the inside of my van. Had to do a bunch of research so things will fit the pieces coming. That's one of the most difficult thing with buying online, you never really know it will fit until after you buy it. For the more common items I'll need, I think I'll go to a local hardware store so I can make sure things fit. I did get to go through some tracks for the radio show.

![Redwood tree trunks with a branch with green and purple flowers in Redwood State Park, CA, USA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/golkwwsdf3gqg6wsshpo.jpg)

Super tired. haha Conferences always take a lot out of me. Been uploading old tracks for most of today on the park WiFi. 
There's a meetup I'm going to get out later while I eat dinner. After that, thinking I'll do some coding and maybe start putting together tracks for the radio show this week. This week has flown by. I'm off next week! Woo-hoo!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 7RLuJD4Sq3E %}
My Experience with Flatiron School
Published: 2021-03-25 22:11:57

I've now completed my final project review, and am starting to look for jobs. It seems like so long ago and also only yesterday that I started the Flatiron School Software Engineering program. I've learned so much, met some wonderful people, and developed a passion for development and the ability to solve problems and build solutions that I have been able to acquire so far.

The curriculum can be frustrating at points, parts almost seemed out of order. The majority of it, though, is good. Most lessons were well written, with good supplementary information linked in case the student is struggling. The curriculum did a great job teaching concepts, which, I've been told by people I know in the field some bootcamps miss on. It sounds cheesy, but I really do feel the curriculum did a good job of teaching how to think like a software engineer and not just someone who can only regurgitate the patterns they've seen before.

I know a lot of bootcamps have moved to 100% javascript, but I am very happy to have learned Ruby and Rails on the way. Seeing how similar concepts are handled by different languages helps peel back the layers and see the workings with more context. Rails is also an incredibly streamlined back-end for personal projects that I'm sure I'll use again even if I land in a shop with a different stack.

I know that this is just the start of a career, and there's so much left to learn and to explore, but I feel I have been well prepared to continue that exploration on my own, or in the context of a professional team.
100 Bytes Of Wisdom: Day 34
Tags: career, journey, advice
Published: 2021-03-25 22:08:50

---
title: 100 Bytes Of Wisdom: Day 34
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

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

The rewarding part of being a mentor is hearing that your advice was both used and went well. If you're being mentored or even casually chatting to a friend, let them know how you got on. Closing that loop builds the relationship and keeps people engaged with your problems, meaning they'll likely help you more in the future.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
Make your terminal awesome using PowerLine fonts
Tags: terminal, powerline, bash
Published: 2021-03-25 22:04:49

https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup

https://www.hanselman.com/blog/how-to-make-a-pretty-prompt-in-windows-terminal-with-powerline-nerd-fonts-cascadia-code-wsl-and-ohmyposh
Useful resources to learn more about Agile and Scrum
Tags: agile, scrum
Published: 2021-04-10 15:06:34

---
title: Useful resources to learn more about Agile and Scrum
published: true
date: 2021-03-25 22:00:00 UTC
tags: agile, scrum
canonical_url: https://www.rossanodan.me/useful-resources-to-learn-more-about-agile-and-scrum/
---

If you work into software development - if you don’t, I have no idea how you ended up here - and especially in medium/big sized companies, you surely heard about **Agile** and **Scrum**. So probably you don’t need what follows.

For all the others instead, here’s a list of useful links where you can read about Agile, Scrum, Scrum roles and sprint ceremonies.

- [https://www.atlassian.com/agile](https://www.atlassian.com/agile) - if you don’t know what Agile is, please read this first
- [https://www.atlassian.com/agile/scrum](https://www.atlassian.com/agile/scrum) - Scrum framework. Here you can learn all about Scrum (sprints, agile ceremonies, standup, roles, etc)
- [https://agilemanifesto.org/principles.html](https://agilemanifesto.org/principles.html) - twelve general principles of the Agile Manifesto
- [https://www.youtube.com/watch?v=9TycLR0TqFA](https://www.youtube.com/watch?v=9TycLR0TqFA) - Short but very useful video about Scrum

You can thank me later.

![You're welcome](https://media.giphy.com/media/kmQREsvNQrhrHdkN7G/giphy.gif)
Learning RenPy for Visual Novels or Choose Your Own Adventures
Tags: python
Published: 2021-03-25 21:34:38

I'm learning RenPy for creating Visual Novels and I'm documenting the process on my website. Follow along as I create a family friendly swashbuckling pirate game. Visual Novels are kind of like "Choose Your Own Adventure" for 2021. Let me know if it's helpful! [Learning RenPy the Fun Way](https://www.iceorfire.com/post/our-renpy-game-part-1-planning)

We start with planning our game in part 1. Then we [outline our story](https://www.iceorfire.com/post/our-renpy-game-part-2-storyline) and in part 3 we [start our coding](https://www.iceorfire.com/post/our-renpy-game-part-3-beginning).

# Support Me
If you find these tutorials helpful, please consider [buying me a coffee](https://www.buymeacoffee.com/z4F8QVS6w). Thanks!
Humble Opinion vs Impostor Syndrome, how to perform a code review?
Tags: codereview, leadership
Published: 2021-03-25 21:29:50

###Programer's Ego
Ego is a common topic among programmers, we all know that one who thinks of himself above the rest because he is capable of implementing a `Red-Black tree`, while there is no issue with this alone, you need to be mindful of not creating a toxic environment around you.

###Impostor Syndrome
Many of us try to balance this being Modest or Humble by never allowing compliments get to our heads. At the same time, we should be careful not to suffer the **Impostor Syndrome** in which we cannot measure our capabilities.

###When not to be Humble?
You must walk that thin line between those 2 extremes when a co-worker asks for your opinion
> Could you review my Pull Request?

That's not the moment to doubt or be humble `Comment`, `Approve`, `Request Changes` are three valid options which we should evaluate, review, and sincerely provide feedback based on our previous knowledge and experience.

The good practices that apply, flows, code and algorithms optimizations, all those little things that give us comfort on the weekly releases.


###When to be human?
That shyness and humble has their place, you must grab to it while you are performing the review,
* Evaluate the code, not the developer
* Be reasonable on why each change
* Highlight those clever solutions

###Summary, be Proud of your Opinion, be Humble expressing it
Be proud of what you have accomplished, was built from your experience, reading, writing, doing, living those **Eureka moments** fixing bugs, and solving complex issues.

Be humble the way you communicate your opinion, be human, connect with the people you want to share your knowledge with. Remember you were also the new guy who had leaders to look up. You want to be listened not just heard.
Debugging and monitoring
Tags: monitoring, cloud, question, ask
Published: 2021-03-25 21:25:55

I recently struggled with monitoring FE application.
I had no idea how to monitor errors in your SPA, so I made some research of cloud monitoring tools, but I was not able to decide which one to choose.
You are also able to listen window events, but is it good enough?
Every tool has pros and cons.
Could you help me with your experience and how do you monitor you application?
I will appretiate your comments.

I have just one more thing to ask, if you debug node.js application do you use just console.log to understand what is going on, or do you use debugger?
Testing Email Designs - Building SaaS #86
Published: 2021-03-25 20:17:56

{% youtube m8JLQd4CSQQ %}

In this episode, I worked on the sign up confirmation email design. We customized the template and used MailHog to test the flow and see how the email appeared. After working on the email design, we switched to the landing page of the site to work on the pricing information.

I started the stream by explaining that I'm working through some final tasks before launching the app more publicly. I covered why I am planning to send a sign up email and why I want to customize it.

While building the email, I made a mistake in the file naming and had to dig through the django-allauth source code to try to figure out what went wrong. Sometimes exploring source code of other projects is what you need to do.

Once I corrected the mistake, I showed how to use MailHog to act as a local email receiver with a web-based viewer. By using MailHog, we checked the styling of the email to make sure it matched my expectations.

Before moving on, I made sure to build the plain text version of the email as well as the HTML version.

After finishing the email, I switched over to the landing page and turned my attention to the pricing section. I spent the rest of the stream trying to style the pricing section to my liking.
Shortest way to swap two numbers in java.
Tags: java, android, algorithms
Published: 2021-03-25 20:12:22

Here I'm mentioning what I use to swap two numbers.

y = x-y+(x=y);

Complete code get from here.

https://www.javaoneworld.com/2021/03/shortest-way-to-swap-two-number-in-java.html?m=1

If anyone have some more easy and short way to perform this action, please comment your thoughts.
TIL: VSCode + Vim MultiSelect
Tags: todayilearned, linux, vscode, vim
Published: 2021-03-25 20:09:01

---
canonical_url: https://blog.justinhager.codes/til-vscode-vim-multiselect/
---

## Context:
- VS Code IDE
- [Vim Extension](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim)

## Problem:
![problem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5h79mjk7c0vwbfra36e.gif)
- `Ctrl+d` keybinding does not work as expected.
- Expecting multi-select of highlighted word. Instead, get some type of chunk selection.

## Solutions:

1) Play a Vim melody combo: `viw` + `gb`
- `viw` to select the word
- `gb` to grab next occurrence
![using viwgb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2pjduk5krgikkxz9mt0.gif)

2) Enable the `Ctrl+d` keybinding:
- Edit VS Code's `settings.json` to include the following:

```json
"vim.handleKeys": {
    "<C-d>": false
  }

```
![modifying settings and usting ctrl+D](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/egkxda2czl3fygnq8ds6.gif)

## Reference:
https://github.com/VSCodeVim/Vim/issues/2144

## Extra:
Gif screen recordings created in Linux with [Peek](https://github.com/phw/peek)
y = x-y+(x=y);
      What is this?
Tags: java, android, algorithms
Published: 2021-03-25 20:06:12

So are you thinking like what is the purpose of this line of code?

So let's break the curiosity...

I'll use this single line of code to swap two numbers. 

How? Let's try.

https://www.javaoneworld.com/2021/03/shortest-way-to-swap-two-number-in-java.html?m=1
Minimalistic way to create cloud image from ISO with QEMU
Tags: cloud, image, alpine, qemu
Published: 2021-03-25 20:02:53

---
title: Minimalistic way to create cloud image from ISO with QEMU
published: true
description: Using example Alpine Linux
tags: cloud, image, alpine, qemu
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osrjhyvt2cs1ylu1y52i.jpeg
---

#### Install qemu
This snippet for Mac OS, at Linux dists replace `brew` to `apt/apk/yum/pkg`
```
brew install qemu
```

#### Create empty hard disk raw image
Specify explicit image format (couse choosing `qcow2` is minimal result image size), 1-st argument **image name** and 2-nd arg **size**.
```
qemu-img create -f qcow2 raw_hdd_10.qcow2 10G
```

#### Create virtual machine
After `qemu-system-` you can press *tab* and choose your cpu architecture, in my case is `-x86_64`. Then specify `-boot` disk `d` (it's cdrom), `-cdrom` image path and main hdd (`-hda`) image path.
```
qemu-system-x86_64 -boot d -cdrom ~/Downloads/alpine-virt-3.13.2-x86_64.iso -hda hdd10.qcow2
```

#### Install OS from bootable iso to hdd
In Alpine case:
```
setup-alpine
exit
```

Shutdown VM, and
#### Load installed OS from hdd image
```
qemu-system-x86_64 -hda hdd10.qcow2
```
Now you can make any your custom changes in OS.
At finally..
Filling nulls all free space for better compress hdd image, showing count nulled blocks (`-v`), From root mount point `/`
```
fstrim -v /
exit
```

#### Compress resulted image
Specify input `-f` and output `-O` image format, compression flag `-c`, then input and output image paths (they may be equal, if you don't need backup)
```
qemu-img convert -f qcow2 -O qcow2 -c hdd10.qcow2 hdd10-compressed.qcow2
```
Voila!
Tommorow we'll upload your custom image `hdd10-compressed.qcow2` to cloud using ***openstack***.
Show me your best Open Source project
Tags: github, opensource, showdev
Published: 2021-03-25 19:07:56

# Hi everyone ! 

Show your best open source project on GitHub and describe it in a few words. What is/are your favorite part(s)?

____
Check with `{% github thomasbnt/awesome-web-monetization %}` give this :
{% github thomasbnt/awesome-web-monetization %}
Building a Cookery Blog with Bulma Clean Theme
Tags: showdev, opensource, webdev
Published: 2021-03-25 20:23:38

---
title: Building a Cookery Blog with Bulma Clean Theme
published: true
date: 2021-03-25 19:00:07 UTC
tags: showdev,opensource,webdev
canonical_url: https://www.csrhymes.com/2021/03/25/building-a-cookery-blog-with-bulma-clean-theme.html
cover_image: https://www.csrhymes.com/img/recipe-example.jpg
---

Version 0.11 of Bulma Clean Theme has a new recipe layout you can use in your posts or pages. This post will explain how to use the new layout and build your very own cookery blog.

To make it as easy as possible to create a recipe page, the recipe is generated from page’s front matter. This means that you only have to enter the information once and it will be used to create the page content, but it will also be used to generate [recipe schema data](https://developers.google.com/search/docs/data-types/recipe) for the recipe to help your site show up in search engines for recipe searches.

If you add any additional content to the page, such as the story behind the recipe, it will appear below the recipe details.

Start by using the recipe layout in your page or blog post’s front matter and add a title and an image

```yaml
layout: recipe
title: My recipe title
image: /path/to/recipe-image.jpg
hero_image: /path/to/recipe-hero-image.jpg
```

Then create a list in the front matter for the ingredients:

```yaml
ingredients:
    - 1tsp vegetable oil
    - 2 Carrots, finely diced
    - 1 Onion, finely diced
```

Next add the method steps:

```yaml
method:
    - Heat the vegetable oil in a large pan on a medium heat, then add the carrots, onion and celery and cook for five to ten minutes to soften, stirring occasionally
    - Add the crushed garlic and cook for 2 more minutes, stiffing occasionally
```

Then specify the additional information about your recipe, such as the prep time, cook time, keywords, etc. The times need to be in a specific format for the recipe schema which uses [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), basically P for period, T for time, 1H for one hour and 1M for one minute.

```yaml
prep_time: PT0H10M
cook_time: PT1H
total_time: PT1H10M
keywords: recipe,cooking
recipe_yield: 4
recipe_category: Main course
recipe_cuisine: Italian
calories: 500 calories
```

When you build the page, this data will be inserted into the recipe template and the schema will be generated in the background.

More information and an example page can be found on the [Bulma Clean Theme demo site](https://www.csrhymes.com/bulma-clean-theme/example-recipe/).

Have fun and enjoy building your cookery blog!

Photo by [Janko Ferlic](https://stocksnap.io/author/36317) from [StockSnap](https://stocksnap.io)
Best tip for GoLang programmers learning TypeScript
Tags: jokes, go, typescript
Published: 2021-03-25 18:06:28

I've been playing with GoLang recently, pretty cool language actually, but comming from a TypeScript world it was quite weird to me to use the `nil` keyword instead of `null`. I figured out that it could also be weird for Go devs learning TS, so here goes a little something to make the transition smoother:

```ts

const nil = null;

```

With that in place, Go devs are now able to use the familiar keyword instead of the longer alternative.
Difference btw px,em and  rem 
Tags: beginners, css
Published: 2021-03-25 17:51:17

Some Beginners do have  issue of understanding the difference between px , em and rem and they get confuse. Well, honestly This also happened with me:).I want to  share it in a very easy simple way maybe somebody will get benefit from it.

px:
px is an absolute unit. Changing value of another element does not effect the value of absolute units.
It's a kind of fixed value.

em:
em unit is relative to the font-size of the element being styled. This is also effected by inherited values from the parent until it is overridden by a px unit which is not subject to inheritance.

rem: 
rem unit is  relative to the font-size of root(html) element. It mean's that only if you make changes in root element then rem will be changed. It's not effected by  inherited values from the parent.
Setting up the C# Coding Environment
Tags: codenewbie, beginners, csharp
Published: 2021-03-25 17:45:12

## Setting up your C# coding environment

For the sake of this series, we're going to be developing using the .Net Framework, I will discuss this further into the series (for now it's not essential to know just what it is).

#### **Downloading your prefered IDE**

If you're completely new to coding, I suggest downloading the **Visual Studio IDE** (Integrated Development Environment) from [MS VS download page](https://visualstudio.microsoft.com/vs/community/)

You could also use VS Code Editor, but it's suited for more experienced developers, allowing you to code in multiple languages. In terms of C# VS Code is more utilised for .Net Core development (again more on this further on in the series).

[VS Code Download](https://code.visualstudio.com/download)

### **IDE or Editor**?

An IDE is an Integrated Development Environment, in essence, it's a code editor with many extra features (code editor, compiling, debugger). Think of an IDE as an all singing all dancing editor.

A text editor is just that, it's a text editing application. However, nowadays they're beginning to branch out with the ability to install extensions, and support languages other than programming languages , such as Markdown and SQL.