teleren/devto huggingface dataset:
I want to fix the diversity on my event, help me!
Tags: communities, feminism, freedom, event
Published: 2020-10-06 14:59:01

---
title: I want to fix the diversity on my event, help me!
published: true
date: 2019-07-07 19:34:16 UTC
tags: Communities,Feminism,Freedom,event
canonical_url: 
---

If someone linked you this post is probable you are organizing an event where diversity and inclusivity is an issue and they want to help you fix that. If you want, you can jump to the subsection that better adjust to your case. Remember: diversity is not a TL;DR, you probably need to read the … [Continue reading "I want to fix the diversity on my event, help me!"](http://delawen.com/2019/07/i-want-to-fix-the-diversity-on-my-event-help-me/)

The post [I want to fix the diversity on my event, help me!](http://delawen.com/2019/07/i-want-to-fix-the-diversity-on-my-event-help-me/) appeared first on [Délawen](http://delawen.com) written by [María Arias de Reyna Domínguez](http://delawen.com/author/delawen/).
A geek-style Vue UI library
Published: 2019-07-07 18:24:52

[@zeit-ui/vue](https://github.com/zeit-ui/vue) is an unofficial Zeit UI implementation, the design prototype comes from ZEIT's design team.



## Short:

1. support dark mode.
2. it's really cool.
3. several projects are already using it.


## About 2.0

1. refactoring multiple components, higher expressiveness.
2. simplify the code and better implement.
3. easier-to-use document site.


## Preview:
(any suggestion can be left a message, we are willing to improve together.)

![](https://thepracticaldev.s3.amazonaws.com/i/pevk6zd2dage14g3m2yy.png)
What is like to build a dev community and where to start?
Tags: discuss, opensource, contributorswanted
Published: 2019-07-07 18:01:47

I've waited too long before committing to this.
I've always dreamed about what's like to build a community, a movement of people, around an initiative.

Turns out, the best way to understand, is to start doing something.
_Planting the seed that is needed to let an idea find its first roots._

The history of this website have intrigued me, how it came to be, where it started, why...

I find myself wondering a lot during my days, thinking about projects I would like to start, things I would like to create, experiences I would like to experience and, most of all, how could I share all of this with someone else.

Now it's time to stop thinking.

This post it's pretty much a letter to myself. A recap, a black and white (depending on the theme you're reading :joy:) statement that I've to write down, to last.

It's the beginning of something, a change.

Among all the ideas and goals I've, somewhere I had to start.

*Splitbit*!
[Splitbit](https://splitbit.webflow.io) is what I came up with :joy:, an "expense" manager between friends.

I would like Splitbit to be a Flutter project where beginners and learners can make their first steps with open source, maybe even development.

This project could become something that can have a great impact on many others. On the people that will eventually decide to work on it, on the people that may have the chance to try and use the _thing_ that has been created.

This, I think, is a great way to start, a project, an idea, a commitment that could involve another person, just like me, that share the same spirit. _Isn't it at the foundation of a community?_

But, beside an idea, what are the next steps? How do you meet and stay in contact with developers?

Just a Slack channel? Is that really what it's all about?
Another mailing list?

What are your thoughts?

I want to share my journey, so keep in touch :smile:

**p.s.**
If you're interested in the project.. follow it on [github](https://github.com/OpenOfficina/splitty)
What people think programming is vs. how it actually is
Tags: jokes
Published: 2019-07-07 17:00:44


<blockquote class="twitter-tweet" data-lang="de"><p lang="en" dir="ltr">What people think programming is vs. how it actually is<a href="https://t.co/c310YOm6b2">https://t.co/c310YOm6b2</a></p>&mdash; Tobi Obeck (@tobiobeck) <a href="https://twitter.com/tobiobeck/status/1147912726246805504?ref_src=twsrc%5Etfw">7. Juli 2019</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Working with awesome tool oi.flyimg.io Fetch an image from anywhere; resize compress cache and serve...
Tags: cacheandserve, compress, resize
Published: 2019-07-07 16:49:20



Flyimg: Working with awesome tool oi.flyimg.io, Fetch an image from anywhere; resize, compress, cache and serve... and serve, and serve...


Features: 
Get images from anywhere in the internet and store them locally for further operations.
Resize an image and serve it compressed (Jpeg for JPEGs)
Crop images to given coordinates
Convert between some formats (Webp, JPEG, PNG, GIF)
It can restrict the domains or IPs from where it pulls images to transform.
It's a bunch of well know open source projects packed together for convenience.
It includes face detection, cropping, face blurring, image rotation and many other options.
Simple and easy to extend (our main goal).


Face detection cropping:
https://oi.flyimg.io/upload/fc_1/https://oi.flyimg.io/faces.jpg

Face detection blurring + resize:
https://oi.flyimg.io/upload/fb_1,w_600/https://oi.flyimg.io/faces.jpg
What to do when productivity hits level 0?
Tags: discuss
Published: 2019-07-07 16:35:27

I have been working on a personal project, I tried to continue its development today but it seems my productivity hit level 0. I usually solve this with an hour break, music and maybe a couple of podcasts for motivation, today it's kinda hard. So I sort to ask advice from the DEV community. Anything to get me more productive in a jiffy.
Keyword make with map & slice
Tags: go
Published: 2019-07-07 16:32:17

Go provides a built-in map type that implements a hash table.


There are a few advantages of using the keyword `make`
  * can creates *slices*, *maps* and *channels*
  * create a *map* or *slice* with space pre-allocated
  * *slice* can be with len != capacity
  * zero value of a map is `nil`


<br />
<br />

### **CRU** a map with make
```go
  // instantiate a map implicit
  // this will allocated and initialize a hash map
  myMap := make(map[string]string)

  // adding key and value to map
  myMap["city"] = "Miami"

  // retrieving value base on key
  city := myMap["city"]
  // fmt.Println(city) // == "Miami"
```

<br />
<br />

### **CRU** a slice with make
```go
  // instantiate a slice implicit
  // this will allocated and initialize a slice with 5 spaces
  mySlice := make([]int, 5) // len(mySlice) == 5

  // you can specify a capacity, pass a third argument to make:
  myCapSlice := make([]int, 3, 5) // len(myCapSlice) == 3, cap(myCapSlice) == 5
```

<br />
<br />
Bleeding Edge PHP on ZEIT Now
Tags: php, static, deployment, serverless
Published: 2019-07-07 16:11:03

---
title: Bleeding Edge PHP on ZEIT Now
published: true
description: Deploy PHP apps running on ZEIT Now Platform and latest PHP.
tags: php, static, deployment, serverless
---

Today I would like to show you ZEIT Now platform. Well, you've probably heard about it. There are many blogposts about this awesome piece of technology (https://dev.to/search?q=zeit%20now).

But, I have some good news for PHP devs. Since June (06/2019) I am working on the enhanced PHP builders for ZEIT Now.

These builders support:

- multiple PHP versions (7.2.20, 7.3.7, 7.4.0alpha2) 🚀
  - official PHP builder is 7.1.22
- multiple running modes (server, cgi, cli, fpm) 🧙‍♂️
  - just pick whatever you like
- many preinstalled PHP extensions 📦
- install dependencies via Composer 🤩


The updated builders you can find at the Github [juicyfx/now-php](https://github.com/juicyfx/now-php) and I would appreciate any feedback.

How to test it? Take a look at [examples](https://github.com/juicyfx/now-php/tree/master/examples)

-----

How to deploy under 1 minute? Create `index.php` and `now.json` in your project's folder. If you're not familiar with ZEIT Now, [take a look](https://zeit.co/now) at official website.

```php
<?php 

phpinfo();
```


```json
{
    "version": 2,
    "builds": [
      { "src": "old.php", "use": "@now/php" },
      { "src": "new.php", "use": "now-php" }
    ]
}
```

Yep, that's all. And now call `now`. 🤓

You should saw something like that.

![](https://thepracticaldev.s3.amazonaws.com/i/oyvm8n1l6m360q2b2bfn.png)

-----

At the end, some examples.

- official - https://php.now.sh/
- phpinfo - https://php.jfx.cz/
- extensions - https://php.jfx.cz/ext/
- ini - https://php.jfx.cz/ini/
- JSON API - https://php.jfx.cz/api/users.php
- test - https://php.jfx.cz/test.php

I'm also testing Caddy server with FPM and [Bref.sh](http://bref.sh). There are many features you might be looking for.

-----

PHP builder was separated from zeit/now-builders to solo repository - https://github.com/juicyfx/now-php. Take a look.

-----


Happy testing,
Felix
Download Docker Images without Docker Pull
Tags: docker, devops, scripts, hacks
Published: 2019-07-07 16:09:41

---
title: Download Docker Images without Docker Pull
published: true
description: 
tags: Docker, DevOps, Scripts, Hacks
---

__Docker pull__ is the basic command for using Docker images. It works most of the time but sometimes it freezes in the middle of the download. Lots of people have raised issues about this with hacks that involve killing a process or restarting the docker-machine several times.

All these hacks aren't an issue with small image sizes like the _alpine_ distribution or an _nginx_ image but, what about the large images? Images that weight like 500 MB or 2 GB?

These hacks aren't useful because they involve downloading large layers over and over again.

A better workaround is to download the images manually and load them to the docker-machine. This is a much better solution as the manual download has much lower chances to fail than restarting the docker-machine hoping that docker pull starts working.

To download a docker image manually, there is a script called 'download-frozen-image-v2.sh' in the Moby project that lets us do that:

https://github.com/moby/moby/blob/master/contrib/download-frozen-image-v2.sh

{% github moby/moby %}

This script only needs three things installed:
- Curl
- Jq
- Go

To use the script we only need to specify the image to download and the location relative to the current:

```Bash
$ ./download-frozen-image-v2.sh "example" hello-world:latest
```
In this example we are downloading the image "hello-world:latest" in the "example" directory.

Note: be sure to specify the version tag. If not specified, the script will return Not Found (404)

This will download several files into the "example" directory:
- manifest.json
- repositories file
- json with details of the image
- folder for each layer in the image

The only thing next to do is load it into the docker-machine. The script outputs the command necessary to do it:

```Bash
$ tar -cC 'example' . | docker load
af0b15c8625b: Loading layer [==================================================>]     977B/977B
Loaded image: hello-world:latest
```

__Congratulations__! You have pulled a docker image without the _docker pull_ command!
Create an AKS cluster
Tags: azure, azuresecurity
Published: 2019-07-07 16:03:07

---
title: Create an AKS cluster
published: true
description: Create an AKS cluster
tags: Azure , Azure Security
---

1. Open the Azure portal.
2. Select the Cloud Shell icon next to the search box.
3. Select PowerShell, and then create the Azure file share.
4. Create a resource group by using Azure PowerShell:

**Note**: To find a location near you, refer to https://azure.microsoft.com/regions/services.

**PS Azure:&gt;** az group create –name AZ500 –location westus

Azure outputs the following:

Azure:/

“id”: "/subscriptions/61f927e9-94e6-4f6d-a737-5d482c6f4316/resourceGroups/AZ500",

“location”: "westus", “managedBy”: null,"name": “AZ500”,"properties": {

“provisioningState”: "Succeeded" },“tags”: null, "type": null}

5.Create the Kubernetes cluster, which is a three-node cluster. The –no-wait returns to your command-line interface (CLI) window while the cluster is being built:

**PS Azure:&gt;** az aks create –resource-group AZ500 -name alamo -node-count 3 –generate-ssh-keys –no-wait

Azure outputs the following:

Azure:/

SSH key files ‘/home/philip/.ssh/id_rsa’ and '/home/philip/.ssh/id_rsa.pub' have been generated under ~/.ssh to allow SSH access to the VM. If using machines without permanent storage like Azure Cloud Shell without an attached file share, back up your keys to a safe location

Finished service principal creation[##################################] 100.0000%

Azure:/

6.Review your resource groups in the Azure portal to find the Kubernetes service you created.
Show me your deployment
Tags: discuss, javascript, webdev, devops
Published: 2019-07-07 14:39:12

## Hey folks!

last week I published my own opinionated & minimalist JavaScript full-stack starter-kit on GitHub:

[JavaScript Full-Stack Starter Kit](https://github.com/mi-kas/fullstack-starter-kit) 🚀


The one final missing part of my starter-kit is the deployment. I know that there is no one-fits-all solution for deployments, but I am looking for an easy way to deploy my containerized application to a MVP-ready cloud environment.

Looking forward to hearing your ideas on that!

Cheers,
Michael ✌️
Image scraping with Python
Tags: python, image
Published: 2019-07-07 14:29:14

---
title: Image scraping with Python
published: true
description: python, image 
tags: python, image
cover_image: https://cdn.pixabay.com/photo/2017/06/22/12/19/tiger-2430625_960_720.jpg
---
The web has many different types of content: images, video, text, audio and more. You can use Python to download data from the web.

The program below downloads image from search engines Google and Baidu.

Why these? Because they are large image archives.

<img src="https://media1.giphy.com/media/EygmkPVoSH3pu/giphy.webp?cid=790b76115d220083746c444a45aa92d4&rid=giphy.webp">


It can be called like this with the keyword:

    download_baidu(word)
    download_google(word) 

Code to scrape images:


    #!/usr/bin/python3
    #-*- coding:utf-8 -*-
     
    import re
    import requests
    from bs4 import BeautifulSoup
    from urllib.parse import urlparse
    import os
    
    def download_baidu(keyword): 
        url = 'https://image.baidu.com/search/flip?tn=baiduimage&ie=utf-8&word='+word+'&ct=201326592&v=flip'
        result = requests.get(url)
        html = result.text
        pic_url = re.findall('"objURL":"(.*?)",',html,re.S)
        i = 0
    
        for each in pic_url:
            print(pic_url)
            try:
                pic= requests.get(each, timeout=10)
            except requests.exceptions.ConnectionError:
                print ('exception')
                continue
     
            string = 'pictures'+keyword+'_'+str(i) + '.jpg'
            fp = open(string,'wb')
            fp.write(pic.content)
            fp.close()
            i += 1
    
    def download_google(word):
        url = 'https://www.google.com/search?q=' + word + '&client=opera&hs=cTQ&source=lnms&tbm=isch&sa=X&ved=0ahUKEwig3LOx4PzKAhWGFywKHZyZAAgQ_AUIBygB&biw=1920&bih=982'
        page = requests.get(url).text
        soup = BeautifulSoup(page, 'html.parser')
        
           for raw_img in soup.find_all('img'):
               link = raw_img.get('src')
               os.system("wget " + link)
    
    if __name__ == '__main__':
        word = input("Input key word: ")
        download_baidu(word)
        #download_google(word)

This downloads the images into the same directory. The downside of this implementation is that it does not use threading. Threading speeds up the download process.

If you want to download lots of images, you should use threading. Speed with threading, ok maybe not this fast.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.Ju9a67iumuw7jEw-upQNDwHaET%26pid%3DApi&f=1">

Either-way it's interesting to compare search results for Google and Baidu.

Python resources:
* https://pythonprogramminglanguage.com
* https://www.tutorialspoint.com/python/
* https://pythonbasics.org
* https://python.org
JS Game engine to create simple puzzle game?
Tags: help, javascript, html
Published: 2019-07-07 14:27:47

Greeting everybody, I'm a full-stack web dev with a very little exposure to game development at all. (I've tried to hack an HTML canvas game before, thanks to that I knew what a particle system is.)

Now I need to create some puzzle game quickly. They require dragging puzzle pieces around, which is an advanced topic for me.

Can you recommend any game engine dedicated to puzzle game with a simple API?

Thanks in advance!
Running Ruby on iOS?!
Tags: ruby, ios, showdev
Published: 2019-07-07 14:07:52

---
title: Running Ruby on iOS?!
published: true
description: I got embedded Ruby working in an iOS app!
tags: ruby, ios, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/d3ngkc9934mjzfxdurvd.jpeg
---

I've been hacking around with iOS over the weekend and managed to embed Ruby into an iOS app. This is the first time I've managed to successfully embed a programming language into anything!

I think it's pretty cool, it can run ruby on the device without requiring an internet connection. Everything is contained within the app!

*If the video on dev.to isn't as high res as you'd like, take a look at my tweet of the app in action and watch the video!*

{% twitter 1147864653776793600 %}


**Let me know what you think and if you'd like to see me develop it further. Feel free to ask questions or make some suggestions!**
Configuring SSL Bumping in the Squid service
Tags: squid, ssl, tls, https
Published: 2019-07-07 14:04:03

---
title: Configuring SSL Bumping in the Squid service
series: squid-cache
published: true
description: Configuring SSL Bumping in the Squid service
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gb0c98rrinzghg13f39f.png
tags: squid,ssl,tls,https
---

_repost from https://help.kaspersky.com/KWTS/6.0/en-us/166244.htm, whose Last review was on Jan 18, 2019_

To configure SSL Bumping in the Squid service:

1. Make sure that the utilized Squid service supports the necessary options. To do so, execute the command:  
`squid -v`  
The configure options parameter must contain the `--enable-ssl-crtd` and `--with-openssl` values.

1. Go to the Squid service folder. To do so, execute the command:  
`cd /etc/squid`

1. Create a self-signed SSL certificate. To do so, execute the command:  
`openssl req -new -newkey rsa:2048 -days <certificate validity period in days> -nodes -x509 -keyout squidCA.pem -out squidCA.pem`  
You will be prompted to fill in the fields of the self-signed SSL certificate.

1. Please fill in the fields of the self-signed SSL certificate.

1. Create a trusted certificate to be imported into a browser. To do so, execute the command:  
`openssl x509 -in squidCA.pem -outform DER -out squid.der`

1. Import the squid.der file into the browsers of local computer users.
The method used to import the squid.der file into a browser depends on the type of browser.

1. Configure the permissions to use a self-signed certificate file. To do so, run the following commands depending on the utilized operating system...  
_. . . Details omitted. For this and the next two steps, i.e. steps 7,8,9, refer to the original article. . ._


Finally, restart the Squid service. To do so, execute the command:  
`service squid restart`

Configuration of SSL Bumping in the Squid service will be complete.
Daily Challenge #10 - Calculator
Tags: challenge
Published: 2019-07-07 14:03:08

---
title: Daily Challenge #10 - Calculator
published: true
series: Daily Challenge
description: Build a calculator!
tags: challenge
---

We're back with another code challenge, [this one comes from user obrok](https://www.codewars.com/kata/5235c913397cbf2508000048) on Codewars:

> Create a simple calculator that given a string of operators (+ - * and /) and numbers separated by spaces returns the value of that expression
> 
>Example:
```
Calculator().evaluate("2 / 2 + 3 * 4 - 6") # => 7
```
>Remember about the order of operations! Multiplications and divisions have a higher priority and should be performed left-to-right. Additions and subtractions have a lower priority and should also be performed left-to-right.

_Thank you to [CodeWars](https://codewars.com/), who has licensed redistribution of this challenge under the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause)!_
Squid Proxy with SSL Bump
Tags: squid, proxy, server, ssl
Published: 2019-07-07 13:58:31

---
title: Squid Proxy with SSL Bump
series: squid-cache
published: true
description: Squid Proxy with SSL Bump
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gb0c98rrinzghg13f39f.png
tags: squid,proxy,server,ssl
---


_Reposted from [Squid Proxy with SSL Bump](https://smoothnet.org/squid-proxy-with-ssl-bump/) (26 JANUARY 2014), with slight editing_.

The squid proxy is an amazingly powerful web proxy that can be used from anything to captive portals, redirection, user authentification, logging, and so on; but Squid has always had a limitation where SSL was concerned. Prior to version 3.2, Squid’s method of handling SSL was to simply pass through SSL encrypted traffic as it was un-able to do anything with it with out invalidating the SSL chain of trust, alerting the user for every SSL connection. 

However post 3.2+ versions allow a bit more control, allowing creating a local certificate authority and generating chained certificates on the fly, but be aware this method still invalidates the SSL chain of trust.

This how-to is about getting squid running with SSL Bump. The first thing we need to do is make sure that the version of squid you are using is greater than 3.3. While 3.2 is capable of this method, the SSL Bump directive has changed as of version 3.3. 

The next thing we need to do is generate a local ssl certificate.

```sh
# Generate Private Key
openssl genrsa -out example.com.private 2048  

# Create Certificate Signing Request
openssl req -new -key example.com.private -out example.com.csr
```

Now we need to sign our Certificate Signing Request.

```sh
# Sign Certificate
openssl x509 -req -days 3652 -in example.com.csr -signkey example.com.private -out example.com.cert  
```

Once that is finished,

- copy the private key and the certificate to some location where squid can access it, 
- make sure to keep your private key some place secure. 
- The certificate will need to be accessible to the squid proxy user, and installed as a Trusted Root Certificate Authority. 

As squid generates certificates it stores a copy of each in a cache directory so that it only has to do it once every so often. So we need to set up it’s certificate cache.

```sh
# Generate certificate cache
/usr/lib64/squid/ssl_crtd -c -s /var/lib/ssl_db
# Change ownership of the certificate cache
chown squid: /var/lib/ssl_db 
```

That should take care of most of the external squid stuff, lets move into the squid configuration... 

_Detail of the configuration and their explanations omitted in the post. Check the original if you will._