teleren/devto huggingface dataset:
Setup Headless WiFi on Re4son's Kali Pi
Tags: kali, pi, linux
Published: 2017-08-03 10:00:00

---
title: Setup Headless WiFi on Re4son's Kali Pi
tags: kali, pi, linux
published_at: 20170803T10:00Z
canonical_url: https://ladvien.com/kali-pi-headless-wifi
main_image: https://ladvien.com/images/kali-pi-splash.png
series: Raspberry Pi
published: true
---

I bought a few Raspberry Pi Zero W's for $10. It was happenstance I also purchased the Udemy course Learn Ethical Hacking from Scratch.  I figure, I might as well put these things together.

* [Raspberry Pi Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/)
* [Learn Ethical Hacking from Scratch](https://www.udemy.com/learn-ethical-hacking-from-scratch/)

I also discovered the Sticky Fingers Kali Pi kernel and distros put together by Re4son.

* [Kali Pi](https://whitedome.com.au/re4son/sticky-fingers-kali-pi/)

It has worked well so far.  However, I've not fully tested the Bluetooth LE hardware on the custom kernel.

One of the issues I've had is not being able to connect to new hotspots headlessly.  Usually, you'd boot the rp0w connected to a monitor, keyboard, mouse, and edit wpa_supplicant.conf directly.  But what if you want to go into a new location with only your laptop and the rp0w.  How would you add the wifi credentials to the rp0w without a monitor, etc.

For awhile, I tried to get the ethernet gadget setup to work on the rp0w without any luck.  I think the problems relates to trying to use the gadget hardware on a Mac rather than a Windows machine.

In the end, I decided I would add a script which would do the following:

1. Mount the /boot partition (which is editable through PC's SD card reader).
2. Look for a file on the /boot called "wpa_supplicant.txt" and copy it to the /etc/wpa_supplicant.conf 
3. Look for a file on the /boot called "interfaces.txt" and copy it to the /etc/networks/interfaces
4. Unmount /boot
5. Remove the /boot directory

I saved this script in `/root` as `wifi_setup.sh`.  I then added a call to it in `/etc/rc.local`

```bash
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/root/wifi_setup.sh || exit 1
exit 0
```

Here's the `wifi_setup.sh`

```bash
#!/bin/bash

if [ ! -d "/boot" ]; then
        echo 'Mounting /boot'
        cd ..
        mkdir /boot
        mount /dev/mmcblk0p1 /boot
fi

if [ -f "/boot/wpa_supplicant.txt" ]; then
        echo 'Applying wpa_supplicant'
        cp /boot/wpa_supplicant.txt /etc/wpa_supplicant.conf
        mv /boot/wpa_supplicant.txt /boot/wpa_supplicant.applied.txt
fi

if [ -f "/boot/interfaces.txt" ]; then
        echo 'Applying intefaces'
        cp /boot/interfaces.txt /etc/network/interfaces
        mv /boot/interfaces.txt /boot/interfaces.applied
fi

umount /boot
rm -r /boot
```

This has let me add a new network from my laptop with merely an SD card reader.
Continuous deployment of a webpack app to multiple environments using Travic CI
Tags: ci, travisci, javascript, github
Published: 2018-02-10 22:32:40

---
title: "Continuous deployment of a webpack app to multiple environments using Travic CI"
published: true
tags: ci,travis-ci,javascript,github
canonical_url: 
---

### TL;DR

I set up continuous deployment of a [webpack](https://webpack.github.io/) app with tests in [Jest](https://facebook.github.io/jest/) hosted on [Firebase](https://firebase.google.com/) using [GitHub](https://github.com/) and [Travis CI](https://travis-ci.org/). Deploys to the DEV environment are done on every commit to master. Deploys to the PROD environment are done on every tag to&nbsp;master.

Check out the code&nbsp;[here](https://github.com/bartw/multi_env_webpack_travis_app).

### How to?

In code I use a default&nbsp;value:

```javascript
var text = __CONFIG__ || “default”;
```

That value can be overridden in a webpack config&nbsp;file:

```javascript
plugins: [
  new webpack.DefinePlugin({ 
    __CONFIG__ : JSON.stringify("override")
  })
]
```

In my&nbsp;.firebaserc file I defined multiple Firebase projects:

```javascript
{
  "projects": {
    "prod": "prod-multi-webpack-travis",
    "dev": "dev-multi-webpack-travis"
  }
}
```

This allows me to setup ci for each project by executing the following commands:

```
firebase use dev
firebase login:ci
travis encrypt "1/xxx"
```

In the&nbsp;.travis.yml file I defined multiple&nbsp;deploys:

```
deploy:
  - provider: firebase
    project: dev
    token:
      secure: "encrypted stuff"
    skip_cleanup: true
    on:
      branch: "master"
  - provider: firebase
    project: prod
    token:
      secure: "encrypted stuff"
    skip_cleanup: true
    on:
      tags: true
```

Now I can also use the environment variables that Travis defines in my webpack config&nbsp;file:

```javascript
plugins: [
  new webpack.DefinePlugin({ 
    __CONFIG__ : JSON.stringify(
      process.env.TRAVIS_TAG ? "override on tag" : "override"
    )
  })
]
```

If I do a push to GitHub the dev deploy is triggered and if I update the version then the dev and prod deploy are triggered:

```
npm version patch
git push --follow-tags
```

To get Jest tests working on files where the environment files are used I added some Jest configuration to my package.json file:

```javascript
"jest": {
  "globals": {
    " __CONFIG__": null
  }
}
```

### Conclusion

It took me way too long to get this working so I decided to write this blog post. This setup makes it very easy to have different configurations for each environment.

A downside is that the code needs to be bundled again every time you change environment.

* * *
If you were hit by a bus tomorrow would your project be dead in the water?
Tags: busfactor, softwareproject
Published: 2017-08-03 08:10:25

---
title: If you were hit by a bus tomorrow would your project be dead in the water?
published: true
description: Shortly about bus factor and your attitude
tags: bus factor, software project
cover_image: https://spmjumpstart.files.wordpress.com/2017/08/busfactor1.png?w=2924
---
*Originally posted on my [blog](https://jumpstart.blog/2017/08/01/if-you-were-hit-by-bus-tommorow-would-the-project-be-dead-in-the-water/)*

##If you were hit by a bus tomorrow...

If you were hit by a bus tomorrow (knock on wood) would your project get stuck?

I still remember when one I worked on did.

Well, I wasn't exactly hit by the bus, but from the project standpoint, it was close enough.

We worked on an important security change and I was the only dev assigned to the module. The job could be done within acceptable time frame by a single developer.

But I got keratitis (eye's cornea inflammation) and had to take three-weeks-long sick leave (with no option to work on the computer).

##Yikes! We’reÂ dead in the water

There was no developer to take over my tasks. When I got back the project was late. The new functionality was delivered on time only because we pulled quite serious overtime later on. It almost got me sick again.

##if(busFactor == 1)

The bus factor is the number of people on the team who have to be hit by a bus to get the project in serious trouble.

Take a look at your team.

Is there a person you can't complete the work without? Will you be able to function when the most experienced developer leaves or will you miss your commitments?

If the answer is, “Yikes! Without him/her we’d be dead in the water, your bus factor is one. Prepare for a project delay or sprint failure in the near future.

##fix(busFactor);

There is no quick fix or simple solution to the low bus factor.Implementing certain practices, though, will help:

Implementing some practices, however, will help:

- Work in a shared space and/or daily stand-upsÂ (*communication gets better*).
- Regular code reviews (ideally real-time) and pair programming (*you share your knowledge about the module you work on*).
- Test-driven development (*if someoneÂ gets stuck, she/he can check the intent of the code in tests*)
- Team focused on one project at a time (*team focus shifts fromÂ specific specializations (such as “being the SQL guy”) to how to work together to deliver a specific set of changes*)
Recomendations in choosing a Linux distro
Tags: discuss, beginners
Published: 2017-08-03 03:04:05

---
title: Recomendations in choosing a Linux distro
published: true
description: 
tags: discuss,beginners
---

So, last semester I took a class about Bioinformatics (Python Programming) and the professor made us to use Fedora, we really didn't learn like a lot of Linux, just the basics.

Since I'm studying computer science I think that learning Linux (In a more complete way) will be very usefull for my career. So, with your experience, which distro do you recommend me to get started? (I will be very gratefull if you recommend a book or a online course to learn about it).

Thank you for your time guys, and sorry for my english, greetings from Mexico!
Postgresql and Lisp (DAO)
Tags: lisp, postgres, example
Published: 2017-08-02 21:32:03

---
title: Postgresql and Lisp (DAO)
published: true
description: Postmodern is a Common Lisp library for interacting with PostgreSQL databases.
tags: #lisp #postgresql #example
canonical_url: http://www.huuii.com/people/juan/3868
cover_image: http://www.huuii.com/wwwroot/files/juan/lisp.png
---
http://www.huuii.com/people/juan/3868

Postgresql and Lisp

There is a project called postmodern.

Postmodern is a Common Lisp library for interacting with PostgreSQL databases.

see for more information: http://marijnhaverbeke.nl/postmodern/#quickstart

First I am going to create the user and  database into postgresql:

create user foo with password 'foobar';

create database bar owner foo ;

Now we need to load the library by quicklisp

(ql:quickload "postmodern")

To load "postmodern":

  Load 1 ASDF system:

    postmodern

; Loading "postmodern"

("postmodern")

After that, we are going to create a file with:

(in-package :postmodern)

;;; define the var with the values of the database
(defvar *db-parameters* '("bar" "foo" "foobar" "localhost" :POOLED-P T))

;; define the macro to connect to the postgresql server
(defmacro with-database (&body query)
  "This macro creates the connection and disconnection with specified database in *db-parameter* and execute the query."
  `(postmodern:with-connection *db-parameters* ,@query))

Create the table

;;; define a simple table

(defclass fruits ()

  ((id-fruit :accessor id-fruit :col-type serial :initarg :id-fruit)

   (name :accessor name :col-type string :initarg :name :initform ""))

  (:documentation "Dao class for a fruit record.")

  (:metaclass postmodern:dao-class)

  (:table-name fruits)(:keys id-fruit))

;;create the table in postgresql server

(with-database (create-table 'fruits))

Database access objects (CRUD)

;; insert
(with-database
  (insert-dao (make-instance 'fruits :name "apple"))
  (insert-dao (make-instance 'fruits :name "orange")))


;; select
(with-database
  (get-dao 'fruits 1))

(with-database
  (select-dao 'fruits (:= 'id-fruit 2)))

;; define a method to display information
(defmethod read-information ((obj fruits))
  (format t "id= ~a~%name= ~a~%" (id-fruit obj) (name obj)))

;;delete
(with-database
  (delete-dao (make-instance 'fruits :id-fruit 1)))

;;update
(defun the-update (id new-name)
  (let ((record nil))
    ;; first we neet the record
    (setf record (with-database
           (get-dao 'fruits id)))
    ;; the the new value
    (setf (name record) new-name)
    ;; finally update the record
    (with-database
      (update-dao record))))
Hi, I'm Filipe Domingues
Published: 2017-08-02 21:30:47

---
title: Hi, I'm Filipe Domingues
published: true
description: 
tags: 
---
I've been coding for 4 years.
I live in Porto, Portugal.
You can find me on GitHub as [FilipeDominguesGit](https://github.com/FilipeDominguesGit)
I work for [bitmaker-software](http://bitmaker.rocks/)
I mostly program in C#.
I am currently learning more about NodeJS and Elixir.

Nice to meet you.
Solving Imaginary Scaling Issues (at scale)
Tags: meta, scaling, database
Published: 2017-08-02 19:18:07

---
title: Solving Imaginary Scaling Issues (at scale)
published: true
description: I'm exploring the idea of sharding our database and serving the core application from multiple regions across the world to cut down on the latency of database reads when requests hit the origin server.
tags: meta, scaling, databases
---

I am the founder and webmaster of [dev.to](/), a platform where programmers write articles like this one, have discussions and make friends. It is a lot of fun growing the application and growing the business. On the technical side, we've tried to keep things straightforward as the app grows in complexity, but because we've purposefully built a pretty simple solution and have not encountered any serious scaling issues along the way.

The challenges that we do regularly deal with revolve around delivering the right user experience, keeping up our communication on point, and generally picking the right challenges to take on from day-to-day. Our team is up to five devs and one person who focuses mostly on the business side, though we all chip in wherever we can.

In addition to the very real issues of growing the platform and our communication structures, I really like to play around with solutions to potential future issues. I usually do this on weekends, when I don't have to justify the use of my time to anyone, not that we are very heavy handed with this to begin with. So right now, I'm exploring the idea of sharding our database and serving the core application from multiple regions across the world to cut down on the latency of database reads when requests hit the origin server. I've done the research and chosen the libraries we would likely use to make this possible, and generally thought through how we might go about implementing our solution.

_But this is a solution to a problem we don't have, so we won't be implementing any of this. I knew that heading in._

This is an exercise, and a very personal one at that. Eventually we'll probably need to start thinking along these lines as a team, and I'm excited for when we do. But for now, we will keep trying to build simple solutions to problems we have and use our imaginations to come up new features and optimizations that will please our users.

{% tweet 800752571497545729 %}

At the moment, we have a pretty nice monolithic application that makes good use of our CDN, and our users appreciate the effort we've put into performance optimization. And that's about it.
Navigating The Serverless Ecosystem, and Slack Bot Building with Cloud Functions
Tags: serverless, cloudfunctions, bots
Published: 2017-09-25 20:38:16

---
title: "Navigating The Serverless Ecosystem, and Slack Bot Building with Cloud Functions"
published: true
tags: Serverless, Cloud Functions, Bots
canonical_url: https://www.heavybit.com/library/blog/navigating-the-serverless-ecosystem-and-slack-bot-building-with-cloud-functions/
---

_On July 26th, Heavybit member company [Serverless](https://serverless.com/) held their regular meetup in our San Francisco Clubhouse. The event featured talks from Brian Leroux and David Wells. [Sign up here](https://www.meetup.com/Serverless/) to attend the next event in person._

## Brian Leroux: Slack Bot Building with Cloud Functions

Functions as a service is a recent conclusion of cloud computing. The iron age of compute racked physical servers. Early cloud compute evolved past physical servers with virtual machines. And most recently, in what appears to be an ever tightening cycle, containers have given rise to cloud functions.

Each age taught new lessons for building software architectures and this most recent iteration changes the shape of the challenges we face. In this talk Brian LeRoux shares how his team creates and deploys their bot using AWS Lambda, API Gateway, SNS and DynamoDB.

<iframe src="https://www.youtube.com/embed/MW5zh7eb5lA" width="800" height="257" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

## David Wells: Navigating the Serverless Ecosystem

In this talk David takes us on a journey through the Serverless ecosystem, touching on where to start, how to choose a provider, where to find examples, where to find community resources, and finishing with a look at where the industry is heading. If you’re new to serverless technology, look no further than this!

<iframe src="https://www.youtube.com/embed/pej8jUYTVXE" width="800" height="257" frameborder="0" allowfullscreen="allowfullscreen"></iframe>


## Subscribe For Heavybit Updates

[Join our mailing list](https://heavybit.typeform.com/to/o2fjMn) to receive the latest updates in&nbsp;the developer startup community. After subscribing, tell us your preferences to receive only the emails you want.


_This post was originally published on [heavybit.com](https://www.heavybit.com/library/blog/navigating-the-serverless-ecosystem-and-slack-bot-building-with-cloud-functions/)_
Welcome Thread - v1
Tags: welcome
Published: 2017-08-02 18:20:19

---
title: Welcome Thread - v1
published: true
description: Introduce yourself to the community!
tags: welcome
---

Welcome to dev.to! ðŸ‘‹

![WELCOME TO THE INTERNET](https://slack-imgs.com/?c=1&url=http%3A%2F%2Fmedia0.giphy.com%2Fmedia%2FzhbrTTpmSCYog%2Fgiphy-downsized.gif)

Our [last welcome thread](https://dev.to/thepracticaldev/dev-welcome-thread---v0) was pretty successful, and it's grown a bit long. Let's get this going again!

Please introduce yourself to the community! You can start by sharing your favorite programming languages, what you're interested in learning next, or your latest and greatest side project. No rules, just make yourself at home! ðŸ˜€

Leave a comment below to introduce yourself! âœŒï¸

Also, here's a random question to get you started: what's a non-dev thing you're doing lately?
Quick tip: Check Out the Code Review Stack Exchange
Tags: quicktip, codereview, community
Published: 2017-08-02 17:57:25

---
title: "Quick tip: Check Out the Code Review Stack Exchange"
published: true
description: If you're a programmer, you've likely used Stack Overflow. You might also know that Stack Overflow is part of a large network of Q&A sites called Stack Exchange. I'm finding one of their sites incredibly useful, and I think more people should know about it.
tags: quicktip, code review, community
---

If you're a programmer, you've likely used Stack Overflow. You might also know that Stack Overflow is part of a large network of Q&A sites called [Stack Exchange](https://stackexchange.com). I'm finding one of their sites incredibly useful, and I think more people should know about it.

The site is called [Code Review](https://codereview.stackexchange.com), and it uses the Stack Exchange question and answer format for code review.

To better understand what kind of community this is, here's an excerpt from their [help center](https://codereview.stackexchange.com/help/on-topic)

>  If you are looking for feedback on a specific working piece of code from your project in the following areas…
>
>    - Best practices and design pattern usage
>    - Security issues
>    - Performance
>    - Correctness in unanticipated cases
>
>  then you are in the right place!

Give it a try.
How do you use each of the emoji reactions on dev.to?
Tags: discuss, meta
Published: 2017-08-02 17:27:16

---
title: How do you use each of the emoji reactions on dev.to?
published: true
tags: discuss, meta
---

The heart emoji clearly says "I like/love this"
The thinking face indicates "this made me think",
I ended up googling for the hands emoji because I was not sure what it meant, but according to emojipedia, it's [Two hands raised in the air, celebrating success or another joyous event.](https://emojipedia.org/person-raising-both-hands-in-celebration/)
The unicorn seems similar in intent to the heart, in my opinion, saying something like "this is so cool`.
Make yourself more precise and quick to compete with Machines
Tags: ai, bot, machinelearning
Published: 2018-02-10 22:31:49

---
title: "Make yourself more precise and quick to compete with Machines"
published: true
tags: AI,Bot,Machine Learning
canonical_url: http://blog.mandarbadve.com/2017/08/02/make-yourself-more-precise-and-quick-to-compete-with-machines-machinelearning-ai-bots/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/r83p5zrqvwgdpb8bal2b.jpg
---

_This post was originally published on [blog.mandarbadve.com](http://blog.mandarbadve.com/2017/08/02/make-yourself-more-precise-and-quick-to-compete-with-machines-machinelearning-ai-bots/)_


Everyone saying Machine will overcome humans. Well that might be true. But you have chance to overcome machines. This is right time to compete with them.

Let’s start secret battle with Machines by making them friend. Let’s keep ourselves more precise and quick to solve the problems with the help of machines.

Here are some resources for AI and Machine Learning.

https://hackernoon.com/index-of-best-ai-machine-learning-resources-71ba0c73e34d

Here is the stunning bot framework from Microsoft.

https://dev.botframework.com/


#### Stay tuned for more knowledge and resources.
So you switched to Vim - Don't forget to install Vimium for Chrome!
Tags: vim
Published: 2017-08-02 14:58:13

---
title: So you switched to Vim - Don't forget to install Vimium for Chrome!
published: true
description: Short intro to a plugin for Vim key bindings in Chrome
tags: vim
---

A few months ago I wrote about my first steps with Vim. Now I can finally say: I am faster with Vim than I ever have been with RubyMine 🎉 As soon as you get used to the Vim key bindings you demand them from every other program as well. In my mail program for example I try doing the most things with shortcuts now, too.

And recently I started using [the Chrome Plugin Vimium](https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb). It makes surfing the web much more efficient if you are used to the Vim key bindings already.

The equivalent plugin for Firefox is [VimFx](https://addons.mozilla.org/en-US/firefox/addon/vimfx/).

Here are my top 3 Vimium features

_J_/_K_ lets you go to the previous/next tab (Way easier to type compared to _&lt;Ctrl-Tab&gt;_/_&lt;Ctrl-Shift-Tab&gt;_).

![fzf-like tab switcher](https://store2be.github.io/images/vimium/tab-switcher.jpg)

_T_ gives you an [fzf](https://github.com/junegunn/fzf)-like tab switcher. With _&lt;Ctrl-j/k&gt;_ you can go up and down in the results (like in fzf). Similarly, o gives you an fzf-like menu for your history and bookmarks.

![fast link opener](https://store2be.github.io/images/vimium/link-opener.jpg)

_f_/_F_ gives you letters in overlays for every link of the page and opens the link in the same tab/new tab.

***

Vimium has even more features. [So check it out :)](https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb)

***

_Hi there, we’re [store2be](https://www.store2be.com), a Berlin based startup that builds a SaaS enabled marketplace for short term retails space. If you like what we are posting you might wanna check out [the store2be tech page](https://tech.store2be.com) or follow our [Medium channel](https://medium.com/store2be-tech)._