teleren/devto huggingface dataset:
Setup Wordpress On Ubuntu Server | Install Wordpress On Ubuntu Server
Tags: wordpress, ubuntu, apache2, php
Published: 2018-09-17 21:04:02

---
title: Setup Wordpress On Ubuntu Server | Install Wordpress On Ubuntu Server
published: true
description: Here i have explained how to setup wordpress on ubuntu server
tags: wordpress,ubuntu,apache2,php
---

#Setup Wordpress On Ubuntu Server Is Quit Easy :-)

#Install PHP7, Mysql, Apache2
1. Install Apache Web Server

    sudo apt-get install apache2 apache2-utils

We need to enable Apache2 web server to start at system boot time, as well start the service as follows:

    sudo systemctl enable apache2
    sudo systemctl start apache2

Check status :
sudo service apache2 status
2. Install MySQL Database Server

Next, we need to install MySQL database server by running the command below, You will be prompted to set the root user password for mysql

    sudo apt-get install mysql-client mysql-server

3. Install PHP and Modules

    sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd

To test if php is working in collaboration with the web server, we need to create a info.php file inside /var/www/html.

$ sudo vi /var/www/html/info.php

And paste the code below into the file, save it and exit.

<?php 
phpinfo();
?>

When that is done, open your web browser and type in the this address http://localhost/info.php.
4. Install WordPress CMS

Download the latest WordPress package and extract it by issuing the commands below on the terminal:

$ wget -c http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz

Now move the WordPress files from the extracted folder to the Apache default root directory, /var/www/html/:

    sudo rsync -av wordpress/* /var/www/html/

Give CHMOD permissions, Set the correct permissions on the website directory, that is give ownership of the WordPress files to the web server as follows:

    sudo chown -R www-data:www-data /var/www/html/
    sudo chmod -R 755 /var/www/html/

5. Login to mysql, create user and database

Execute the command below and provide the root user password, then hit Enter to move to open mysql shell:

mysql -u root -p

// Create Database

mysql> CREATE DATABASE wp_myblogs;

//Grant Access

mysql> GRANT ALL PRIVILEGES ON wp_myblogs.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';

mysql> FLUSH PRIVILEGES;
mysql> EXIT;
Go the /var/www/html/ directory and rename existing wp-config-sample.php to wp-config.php:

sudo mv wp-config-sample.php wp-config.php

Then update it with your database information under the MySQL settings section


define('DB_NAME', 'database_name');
define('DB_USER', 'username');
define('DB_PASSWORD', 'password'); 
define('DB_HOST', 'localhost'); 
define('DB_CHARSET', 'utf8'); 
define('DB_COLLATE', '');

At the last, restart the web server and mysql service using the commands below:

sudo systemctl restart apache2.service 
sudo systemctl restart mysql.service
Representation of a Data Structure Like an Array of Hash Tables in Bash Using jq
Tags: bash, jq
Published: 2018-09-17 20:41:55

---
title: Representation of a Data Structure Like an Array of Hash Tables in Bash Using jq
published: true
description: 
tags: ["bash", "jq"]
---

Have you ever needed a Hash Table in Bash?
I needed it when I was writing a deploy script.

I found that Bash 4 has a data structure called Dictionary.
https://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash

But the version of Bash in my laptop is 3.2.57 and I couldn't use it.
Of course, it's easy to update the Bash.
But we may need to work on environments with an older version of it.
So I thought up about the other way.

## How to

```bash
#!/bin/bash -eu

# A data structure like an array of hash tables
# Strictly, it's a stream of JSONs
PARAMETERS=$(cat <<_EOT_
{
  "foo":"FOO 1",
  "bar":"BAR 1"
}
{"foo":"FOO 2","bar":"BAR 2"}
{
  "foo": "フー",
  "bar": "\u30d0\u30fc"
}
_EOT_
)

# Transform into a line-delimited JSONs
PARAMETERS=$(echo "${PARAMETERS}" | jq . --monochrome-output --compact-output)

# Enumerate JSONs and output foo and bar of each item
while IFS='' read -r param || [[ -n "${param}" ]]; do
  foo=$(echo "${param}" | jq .foo -r)
  bar=$(echo "${param}" | jq .bar -r)

  echo "foo=${foo}"
  echo "bar=${bar}"

  echo "---"
done < <(echo "${PARAMETERS}")
```

```
$ bash json_stream.sh
foo=FOO 1
bar=BAR 1
---
foo=FOO 2
bar=BAR 2
---
foo=フー
bar=バー
---
```

* Build a JSON as a string using heredoc
* Transform the JSON into a line-delimited JSONs
* Read a JSON from each line
  * https://stackoverflow.com/a/10929511
* Retrieve each property like `jq .foo` in the loop

Hope you enjoyed it!
Create Bitcoin address | bitcoin HD wallet
Tags: bitcoin, btc, blockchain
Published: 2018-09-17 20:20:10

---
title: Create Bitcoin address | bitcoin HD wallet
published: true
description: Here i am sharing some code snippets written in nodejs, This how we can create bitcoin address
tags: bitcoin,btc,blockchain
---

/*
BIP39: Mnemonic code for generating deterministic keys , BIP39 - used to manage your recovery seed and recovery words. Abstract. This BIP describes the implementation of a mnemonic code or mnemonic sentence – a group of easy to remember words – for the generation of deterministic wallets. It consists of two parts: generating the mnemonic, and converting it into a binary seed
*/
let bip39 = require("bip39");

/*
A lightweight wallet implementation. At the moment it supports key creation and conversion between various formats.
To use BIP32 HD wallets, first include the hdkey submodule,
For the seed i suggest to use bip39.
*/
let hdkey = require('ethereumjs-wallet');

/*
bitcoinjs is a proven library and ecosystem for Bitcoin development using javascript.
*/
let bitcoin   = require('bitcoinjs-lib');

    let wallet_hdpath = "m/44'/0'/0'/0/0";
    hdwallet =  bitcoin.HDNode.fromSeedBuffer(bip39.mnemonicToSeed(seed));
    let wallet = hdwallet.derivePath(wallet_hdpath + index)


Now from wallet you can get privatekey and address both
Create ethereum address | Ethereum HD wallet
Tags: ethereum, eth, blockchain
Published: 2018-09-17 20:12:18

---
title: Create ethereum address | Ethereum HD wallet
published: true
description: Here i sharing some code snippets written in nodejs, This how we can create ethereum address
tags: ethereum, ETH, blockchain
---


/*
 BIP39: Mnemonic code for generating deterministic keys , BIP39 - used to manage your recovery seed and recovery words. Abstract. This BIP describes the implementation of a mnemonic code or mnemonic sentence – a group of easy to remember words – for the generation of deterministic wallets. It consists of two parts: generating the mnemonic, and converting it into a binary seed
*/
let bip39     = require("bip39");

/*
A lightweight wallet implementation. At the moment it supports key creation and conversion between various formats.
To use BIP32 HD wallets, first include the hdkey submodule,
For the seed i suggest to use bip39.
*/
let hdkey     = require('ethereumjs-wallet');


     let wallet_hdpath = "m/44'/60'/0'/0/";
     let hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(seed));
     let wallet = hdwallet.derivePath(wallet_hdpath + index).getWallet();
   
Now from wallet you can get privatekey and address both
IndexedDB, something to rely upon?
Tags: indexeddb, help, pwa
Published: 2018-09-17 18:46:02

---
title: IndexedDB, something to rely upon?
published: true
description: Should we be building great/pervasive apps that can rely solely on local storage in the browser?
tags: #indexedDB, #help, #pwa
---
# Could I build a Progressive Web App using IndexedDB as my sole form of storage? 

My supposition is to build a suite of apps that work together and are local; calendar, tasks, contacts, etc that run exclusively inside the browsers domain. They don't need to install an 'app', they don't need a web service to function. Just go toa webpage, click add to desktop an like Dev.to and voila it works.

Can this be done? Why hasn't this become common? What are the risk factors? 

**More specifically**, I'm clearly going to rely on IndexedDB, right? Is that bad/good? Why?

I'm sure there are reasons for why this hasn't happened, but if I could I'd like to aggregate all the feedback into this one article for myself and others who may be considering the same thing.

Your assistance is greatly appreciated!!
What are your goals?
Tags: discuss, career
Published: 2018-09-17 18:06:33

---
title: What are your goals?
published: true
description: What are your goals?
tags: 
  - 'discuss'
  - 'career'
cover_image: 'https://images.unsplash.com/photo-1520492943297-59dc5f2d0fe6?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5e3905c2e58dffa1ec0490e292f29c59&auto=format&fit=crop&w=1957&q=80'
---

_Cover Photo by [rawpixel](https://unsplash.com/photos/yN4O7XwWoyY?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash_

Every year at my company, we set goals for ourselves as part of our twice-yearly performance reviews. Having our goals written down and checked as part of our review encourages us to **actively** pursue these goals, helping us become better developers, better managers, stronger leaders, and better human beings.

So what are your professional goals year, or even for the next few weeks/months? Let's use this thread to not only share your goals, but help others refine theirs!
Module Monday 13: Transparent navbar, Team page, SoundCloud embed & more
Tags: showdev, opensource, webdev, javascript
Published: 2018-09-17 16:59:39

---
title: Module Monday 13: Transparent navbar, Team page, SoundCloud embed & more
published: true
description: Module Monday 13
tags: showdev, opensource, webdev, javascript
cover_image: https://res.cloudinary.com/component/image/upload/b_rgb:f6f6f6,c_pad,h_370,w_880/v1536962058/team_opnjkk.gif
canonical_url: https://guide.anymod.com/v1/module-mondays/2018-09.html#Module-Monday-13
---

## Five website modules you can use anywhere 📦📦📦📦📦

Everything below is open source and free to use on any website, web app, or anywhere else. [Anymod](https://anymod.com) lets you quickly add features like these.

Click a mod to see it along with its source code.

### Team Page B
Showcase your team with colorful, editable flip cards.
<a class="button" href="https://anymod.com/mod/kboaa?v=20&h1=50&h2=100">View mod</a>
<a href="https://anymod.com/mod/kboaa?v=20&h1=50&h2=100">
  <img src="https://res.cloudinary.com/component/image/upload/v1536962058/team_opnjkk.gif"/>
</a>

### Transparent navbar
Easy-to-add, responsive navbar for any (or every) page on your site.
<a class="button" href="https://anymod.com/mod/bkbnb?v=20">View mod</a>
<a href="https://anymod.com/mod/bkbnb?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1536962058/navbar_ezkxdu.gif"/>
</a>

### SoundCloud embed
Easily add a playable soundcloud song wherever you want.
<a class="button" href="https://anymod.com/mod/mokmr">View mod</a>
<a href="https://anymod.com/mod/mokmr">
  <img src="https://res.cloudinary.com/component/image/upload/v1536962057/soundcloud_sfl9jy.png"/>
</a>

### Mosaic cards
Text and images laid out in a simple mosaic pattern.
<a class="button" href="https://anymod.com/mod/nmbnl?v=20">View mod</a>
<a href="https://anymod.com/mod/nmbnl?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1536962058/mosaic_zclrlb.png"/>
</a>

### Hover caption image
Add & edit your own image and caption, visible on hover.
<a class="button" href="https://anymod.com/mod/rdbdn?v=20">View mod</a>
<a href="https://anymod.com/mod/rdbdn?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1536962057/hover_50_bhrfz6.gif"/>
</a>

<hr>

I post new mods [here](https://dev.to/tyrw) every (Module) Monday -- I hope you find them useful!

Happy coding ✌️
Welcome Thread - v17
Tags: welcome
Published: 2018-09-17 16:48:22

---
title: Welcome Thread - v17
published: true
description: Introduce yourself to the community!
tags: welcome
---
Hey there! Welcome to dev.to!

![An animated penguin shyly waves hello](https://media.giphy.com/media/NCh5G1KuRsXPa/giphy.gif)

Leave a comment below to introduce yourself to the community!✌️
# Welcome!
1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋

3. Or answer this question: what office snacks would you recommend?
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2018-09-17 16:20:33

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

#1. Git It 🔥

Tomer discovers that the top 3 out of 4 questions most voted on Stack Overflow are all related to git. He dives into one of these questions in this post.

{% link https://dev.to/tomerbendavid/the-second-most-voted-question-on-stackoverflow-is-60b %}

#2. `E45: 'readonly' option is set (add ! to override)` 😱

See this annoying message a lot? Jovica shares a trick that'll help you out.

{% link https://dev.to/jovica/the-vim-trick-which-will-save-your-time-and-nerves-45pg %}

#3. Sound Suggestions 💗

Helen shares how she's facing new feelings at work. This is a helpful post for anyone who's dealing with imposter syndrome, stress, or both. 

{% link https://dev.to/helenanders26/how-im-dealing-with-imposter-syndrome-and-stress-4fdm %}

#4. Stupid Simple ✅✅✅

A story of how one company caused all their users to be hacked, and how you can prevent this sort of attack from happening.

{% link https://dev.to/dotnetcoreblog/three-steps-for-increasing-the-security-of-your-web-apps-3clg %}

#5. Unique appearance > Package Size? 🎨

From installation to an assessment of pros & cons, Natalia shares a step-by-step guide on building a desktop app with `electron-vue`.


{% link https://dev.to/vuevixens/building-a-desktop-app-with-vue-electron-3pl %}

#6. "There is no cloud, it's just someone else's computer" 🌩

Instead of having your file syncing be in the hands of another company's terms and conditions (and ability to be secure), Rémi introduces us to Syncthing. 

{% link https://dev.to/shosta/do-you-care-about-your-privacy-maybe-it-is-time-to-set-up-your-own-dropbox-ncf %}

#7. Listicle ✍️

A list of posts that'll inspire you to start/continue blogging. 

{% link https://dev.to/jess/awesome-posts-to-get-you-writing-53p3 %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Developer Subscription Box
Tags: discuss
Published: 2018-09-17 16:07:22

---
title: Developer Subscription Box
published: true 
description: Developer Subscription Box 
tags: #discuss
---

I was wondering who would be willing to subscribe to a subscription box that offers a variety of items every month, and how much are people willing to pay for it?

The box would include Software keys, Swag, Accessories, and little booklets that come with tutorials for fun projects to build.
Copy Files from and to Kubernetes pods and Docker container
Tags: docker, kubernetes, devops, cloud
Published: 2018-09-17 16:00:35

---
title: Copy Files from and to Kubernetes pods and Docker container
published: true
description: How to get get files from your kuberntes pod to your docker container and back
tags: docker, kubernetes, devops, cloud
---
I often want to have some database dumps from my mongo also in my local Setup. To achieve this is pretty easy.
You can either copy files or whole folders.
What we need is the kubectl command line tool.

### Copy Files from a pod to your machine
```sh
kubectl cp {{namespace}}/{{podname}}:path/to/directory /local/path
eg:
kubectl cp mongo-0:/dump /local/dump
```

### Copy Files to a pod
```sh
kubectl cp /local/path namespace/podname:path/to/directory 
eg:
kubectl cp /local/dump mongo-0:/dump
```

The amazing hint on this is, this works as well with docker.
Just change kubectl to docker and it will work as well.

### Copy Files from a docker container to your machine
```sh
docker cp containerID:/path/to/directory /local/path
eg:
docker cp mongo-0:/dump /local/dump
```

### Copy Files to a docker container
```sh
docker cp /local/path containerID:path/to/directory
eg:
docker cp /local/dump mongo-0:dump
```

Why i write this obvious post? I'm tiered looking up the correct syntax now and then and just looking at my blog post speed things up.
SQLite Types: To Affinity And Beyond
Tags: sqlite, sql
Published: 2018-09-17 15:27:30

---
title: SQLite Types: To Affinity And Beyond
published: true
description: Avoid getting trapped by one of SQLite's little quirks
tags: sqlite,sql
---

_Originally posted at https://hoelz.ro/blog/sqlite-types-to-affinity-and-beyond_

If you haven't checked out [SQLite](http://sqlite.org/), it's definitely worth taking a look at.  It's perfect for a zero-configuration set up when you're doing development, and it's a great database to run a test suite against, especially since you can run a SQLite database completely out of volatile memory.  It's even a great choice for small-to-medium size datasets - I have plenty of projects that store their data in SQLite to keep things simple, and even [Fossil](http://fossil-scm.org), the version control system that SQLite itself uses, stores its data in SQLite!

One of the things that makes SQLite different from other SQL implementations such as MySQL or PostgreSQL (other than the fact that it's serverless) is the way its typing system works.  SQLite's typing system is similar to Perl's in that a column can hold a value of any type.  So even with the following table definition:

```sql
CREATE TABLE number_values (
  value INTEGER NOT NULL
);
```

I can run `INSERT INTO number_values VALUES ('foo')` and SQLite will happily store 'foo' into the value column.  When you do comparisons, SQLite is pretty intelligent about how it treats the types; if you run the following statement:

```sql
SELECT COUNT(1) FROM number_values WHERE value = '5'
```

SQLite will realize that you're looking for a string in an integer column, and automatically coerce the '5' into a 5.  This uses a set of rules that the SQLite documentation refers to as _[type affinity](http://www.sqlite.org/datatype3.html)_.

This is all well and good, but I found an interesting quirk in the type coercion system while working on a side project.  SQLite allows you to add user-defined functions, like so:

```perl
$dbh->sqlite_create_function('is_even', 1, sub {
  my ( $n ) = @_;

  return $n % 2 == 0 ? 1 : 0;
});
```

After defining the `is_even` function, I can use it in a SQL statement:

```perl
SELECT COUNT(1) FROM number_values WHERE is_even(value) = 1
```

...and SQLite will tell me how many even numbers I have in the ''number_values'' table.  Bearing type affinity in mind, what would you expect the following expression to yield?

```perl
SELECT COUNT(1) FROM number_values WHERE is_even(value) = '1'
```

You may expect the same number that was yielded from the previous SQL statement, but unfortunately, that would be incorrect.  The correct answer is '0'.  For some reason, no implicit coercion occurs when comparing the result of a function to a value.  So, please keep this in mind if you decide to make use of SQLite and add your own functions!
How I broke Dev.to on my First PR
Tags: beginners, devops, discuss
Published: 2018-09-17 15:15:06

---
title: How I broke Dev.to on my First PR
published: true
description: A tale of two face-palms
tags: beginners, devops, discuss
canonical_url: https://bennypowers.dev/posts/how-i-broke-devto-on-my-first-pr/
---

Today I made my first PR to dev.to, which lets you [add options to glitch embeds](https://github.com/thepracticaldev/dev.to/pull/680). I struggled to install the requirements and build the app, wrote unit tests for the new features, learned my first bits of ruby, and after a few hours of playtime, submitted the PR. It was quickly accepted, ✨THANKS, @ben!🌟

That's when I noticed that every single glitch embed on the entire site was broken 

![🤦‍♂️](https://media.giphy.com/media/3og0INyCmHlNylks9O/giphy.gif)

Thanks to @rhymes, for pointing the problem out:

{% devcomment 5hgh %}

The solution was as face-palmy as the bug itself: I left out the `#` which designates an interpolation in ruby strings:

```patch
-    src={@uri}
+    src=#{@uri}
```

A fun learning exercise for me. I sincerely hope that my oversight didn't cause any inconvenience.

New PR is in flight, once the fix is live I'll write a regression test.

https://github.com/thepracticaldev/dev.to/pull/683
What makes a good software design document?
Tags: discuss
Published: 2018-09-17 15:04:57

---
title: What makes a good software design document?
published: true
description: 
tags: discuss
---
In my role at work, I do a lot of design work. Not graphical design - or our product would look awful! - but technical design. The documents that describe how to get from where we are now - with feature ABC missing, to where we want to be - with feature ABC present.

I'd like to think I'm quite good at this. But I know for a fact that I could be a lot better. We all could.

So, I ask you, when you produce, or read, these kinds of designs, what makes it good and what makes it bad? How can I do better at this?

(My own thoughts will follow in the comments later on, to avoid leading any discussions...)
Tax on Mutual Fund Dividends
Tags: learn, tax, debtfunds, dividends
Published: 2018-09-17 19:19:29

---
title: Tax on Mutual Fund Dividends
published: true
tags: Learn,Tax,Debt Funds,dividends
canonical_url: 
---

In our previous article on Tax on Mutual Fund Returns, we discussed about how the returns on various fund schemes like equity, debt and ELSS are taxed. In this article we will elaborately discuss about how the tax on dividends earned from mutual funds, often referred as DDT (Dividend Distribution Tax) are charged. One must […]

The post [Tax on Mutual Fund Dividends](http://mfrepublic.com/tax-on-mutual-fund-dividends/) appeared first on [MF Republic](http://mfrepublic.com).