teleren/devto huggingface dataset:
Useful Splunk search functions
Published: 2021-03-29 12:03:49

*We always are looking for a way to do specific searches, and it seems complicated when we don't know all the possibilities of the Tool.*

*So here we are to explore some of them!*

---

# Stats functions
## First
> *[search]* | stats first() by *[parameter]*

The first() command will retrieve you all the first logs it founds for each value of the parameter.
So if you use "sort time asc", you will find your the earliest log linked to the parameter... If you sort by alphabetical order, you will retrieve the first element of the list.

*Exemple*
```
index=info | stats first() by id
```
<br/>

## Last
> *[search]* | stats last() by *[parameter]*

Like first, but take the last element of the list.

*Exemple*
```
index=info | stats first() by id
```
<br/>

## Earliest
> *[search]* | stats earliest() by *[parameter]*

Like first and last, but will always take the earliest log.

*Exemple*
```
index=info | stats earliest() by id
```
<br/>

## Latest
> *[search]* | stats latest() by *[parameter]*

Like earliest, but take the latest log.

*Exemple*
```
index=info | stats latest() by id
```

[Splunk Stats function documentation](https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Stats)

<br/> 

---

<br/> 

# Rename
In a lot of moments, it can be really interesting to rename a variable.

A perfect example is after **"| stats first() by id"**. If you check the name of the parameters returned by the function, they all look like "first(xxx)" except id. But keep "first(xxx)" won't help you do other treatments. So you need to rename variables.

> *[search]* | rename *[variable to rename]* AS *[new name]*

*Exemple*
```
index=info | rename id AS id_element
```

[Splunk documentation](https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Rename)

<br/>

---

<br/>

# Dedup
Removes the logs that contain an identical combination of values for the fields that you specify.

> *[search]* | dedup *[list of fields]*

*Exemple*
```
index=info | dedup id name
```

[Splunk documentation](https://docs.splunk.com/Documentation/Splunk/8.1.2/SearchReference/Dedup)

<br/>

---

<br/>

# Fillnull
Replace null values with the value given in the parameter.

> *[search]* | fillnull value=*[new value]* *[field name]*

*Exemple*
```
index=info | fillnull value=empty error_code
```

[Splunk documentation](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fillnull)

<br/>

---

<br/>

I hope it will help you!
The 4 H’s for a junior developer
Tags: beginners, programming, codenewbie
Published: 2021-03-29 12:01:34


Happy- ‘Cause I’m happy.
A smile really does go a long way. Yes I know you’re exhausted. Yes working in tech is hard.
Yes you also have personal things going on, but your manager should not know that.
Showing your manager that you are happy to be a part of the team is crucial to make it as a junior developer.
Trust me when I say this, your mood affects your code.
Keeping your morale high will not only improve your work, it will boost your co- workers spirits too.
Be that person who comes to the office and says good morning to everyone.


Hungry- Hungry for success
You're a junior, you have your whole career ahead of you.
How far are you willing to go to prove yourself?
Managers love someone who is motivated. You want to show to them that they didn’t make a mistake in hiring you and you have what it takes. 


Honest- Honesty really is the best policy. 
Managers need someone they know they can trust and don’t have to micromanage. If you’re facing a struggle in an assignment, speak up as early as possible. No one is going to blame you as a junior for not knowing how to solve a problem, but they will blame you for not being honest and asking for help when needed.


Humble- A little humility goes a long way
Yes , I’m sure you think you have great ideas, and I’m sure some of them are good too. But no manager likes a newbie telling them how they should run the show.
Knowing your place on a dev team has great value, be it junior or senior.
Look for opportune time to casually bring up your ideas- but do be prepared to hear, ‘That’s a great idea, but we have other problems to solve first’.
Hey all Blockchain developers!
Tags: blockchain, developers, software, experts
Published: 2021-03-29 11:57:27

Would you mind helping me out with an industry 
question I have? 


I’m curious about the often silent painful 
problems you deal with on a daily basis that 
keep you from enjoying work as a blockchain developer? I’m in the 
research phase of creating products to serve 
this industry and I’m excited to see what you say.
On my family life in the future
Tags: future, family, worklifebalance, life
Published: 2021-03-30 16:24:02

---
title: On my family life in the future
published: true
date: 2021-03-29 11:53:08 UTC
tags: future,family,worklifebalance,life
canonical_url: https://victorleungtw.medium.com/on-my-family-life-in-the-future-ce98fdb7a04e
---

My ideal family would be a place that I can feel recharged after exhausting all my energy at work. On the weekends, I would be able to spend some quality time with my partner to do something we both enjoy doing, learn something new, travel or try out a new experience with happy moments to share. The time that not just physically present, but also mentally together without the distractions from our phones and forget about the worries at work for a short moment.

These moments would remain in our memory, such that it makes our life worthwhile, it’s worth it to work hard and earn money to support this family life, it’s meaningful to live with a soulmate who can support each other’s ambitions and get a shared sense of purpose in life.

There is a lot of work to do to support children, not just financially, but also need to take good care, and educate the kid to be a better person, with a mindset that can grow and demonstrate the positives things of human being, such as kindness. The world is a cruel place and there is no point to have the next generation if all they got in this world is only suffer. My kids would hate me to bring them to our world if I didn’t have a good life and they have to share with me my terrible life.

Therefore I remain optimistic and still believe that there is something good about living and something meaning during the process of suffering. My children are likely to encounter a lot of difficulties in their lives, but I would educate them to stay positive and see the bright sides.

This kind of life attitude is where our energy comes from to recharge and refresh our mind. This makes us more proactive and tries to contribute to our community whenever we could. This family help us to deal with all the difficulties and provides a sense of belonging, instead of a defeated by the hardship in the reality. Our relationship would be improved via communication and we would be able to share this common mission with our family members.

_Originally published at_ [_https://victorleungtw.com_](https://victorleungtw.com/on-my-family-life-in-the-future)_._
On my career in the future
Tags: career, careeradvice, manager, leadership
Published: 2021-03-30 16:23:51

---
title: On my career in the future
published: true
date: 2021-03-29 11:50:54 UTC
tags: careers,careeradvice,manager,leadership
canonical_url: https://victorleungtw.medium.com/on-my-career-in-the-future-5d0ec654a4b3
---

My future career would be in leadership. In the horizon of the next six months, I want to be a good manager, a manager that takes care of the team, is supportive and take ownership of the result.

I had met a lot of terrible managers in my career, someone who blames his subordinates, yell until the whole floor can hear, and scolding at midnight with meaningless blaming. I had a manager who never talks to new members and only work with her favourite old members. These people were capable as followers to complete their tasks, but got promoted and became a terrible person at the top, who is not able to function properly as a leader.

In the horizon of two years, I want to be able to serve a wider team and community as a leader. A lot of people wants to be the leader for the power of their own sake, get people under control and serve to their benefit. People with this mindset should not stay long in their position and it’s unfortunate with no democratic system to turn over this bureaucracy, leading to corruption and the fall of the wider group. We should be servant leader, with the understanding that we are executing our power of the people, by the people and for the people. We are nothing without the people and it’s our purpose to bring everyone a better life and towards better goals.

In five years, I want to be a director and contribute more to society, giving the right decisions for our team with my knowledge, experience and data, making the team effort worthwhile instead of wasted. It would be frustrating when the team is working hard, but going in the wrong direction. It would be meaningful to accomplish something greater than ourselves, build a work culture such that the staffs enjoying going to work, instead of toxic office politics.

I realise that the possibility of contributing to the community with everyone satisfaction is something meaningful to our life more important than personal success in our career.

_Originally published at_ [_https://victorleungtw.com_](https://victorleungtw.com/on-my-career-life-in-the-future)_._
Visual Studio Tips
Published: 2021-03-29 11:47:41

---
title: Visual Studio Tips
published: true
description: Tips and Tricks
tags: 
//cover_image: https://direct_url_to_image.jpg
---
Fun Fact: in Visual Studio, you can press Ctrl-] on your keyboard to jump from any curly brace to its matching brace. :)

More on that:
https://visualstudiomagazine.com/blogs/tool-tracker/2015/08/matching-brackets-c-sharp.aspx
Mastering Python Lists
Tags: python, beginners, tutorial
Published: 2021-03-29 11:45:41

---
title: Mastering Python Lists
published: true
description: 
tags: python, beginner, tutorial
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/83ga7st8206e1vc2x2en.jpg
---

Hi, here are common Pyton List Manipulation methods.

If you like this post and want more follow me on Twitter: <a href="https://twitter.com/justericchapman?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @justericchapman</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

In Python, List are a collection of items is particular order. You can put anything you want into a List.

By convention normally you will make the name your List plural. For example a list of person can be name people.

Python use square bracket [] to indicate a List, and individual elements are separated by commas.

List is zero base. That mean the first position is 0 and the second position is 1, etc.

```python
# Create a list
fruits = ['orange', 'apple', 'melon']

# Accessing a List element
fruits[0]  # first item
fruits[-1] # last item

# Append to List
fruits.append('banana')

# Insert to List at position x
fruits.insert(1, 'banana') # will be insert second in the List

# List length
nb_items = len(fruits) # 4

# Remove from list
del fruits[1]   # remove apple

# Remove and return last element
lastFruit =  fruits.pop()   # remove last and return it's value into lastFruit

# Slice my_list[start:finish:step] ([::-1] reverse list) 
fruits = fruits[1:3]
fruits[:3]  # first 3
fruits[2:]  # last 2
copy_fruits = fruits[:] # copy 

#Create list from string
colors = 'red, green, blue'.split(', ')

#Reverse a List
colors.reverse()

# Array concact
color1 = ['red', 'blue']
color2 = ['green', 'yellow']
color3 = color1 + color2

# Concat by unpacking
color3 = [*color1, *color2]

# Multiple assignment
name, price = ['iPhone', 599]

#Create a Tuple (kind of read only list)
colors = ('red', 'green', 'blue')

# Sort
colors.sort() # ['blue', 'green', 'red']
colors.sort(reverse=True) # ['red', 'green', 'blue']
colors.sort(key=lambda color: len(color)) # ['red', 'blue', 'green']

# Looping in a List
for color in colors:
  print(color)

# Generate a List of numbers
numbers = List(range(1, 10)) # 1 2 3 4 5 6 7 8 9

# List comprehension offers a shorter syntax when you want 
# to create a new list based on the values of an existing list.

# Example of long version
fruits = ["apple", "banana", "cherry", "kiwi", "mango"]
newFruits = []

for x in fruits:
  if "a" in x:
    newFruits.append(x)

print(newFruits)

# Same example with List Comprehension 
fruits = ["apple", "banana", "cherry", "kiwi", "mango"]

newFruits = [x for x in fruits if "a" in x]
# Syntax:   [expression for item in iterable if condition == True]

print(newFruits)
```
You ain't gonna need it
Tags: engineeringmonday, yagni, codequality, productivity
Published: 2021-03-29 11:42:06

I love coming back to a feature that was developed a couple of months ago and seeing that extending it is just a walk in a park. When thinking about a solution, I always ask myself the same question: If I were to change this in a month, how hard would it be?

I find it a great way to catch flaws in my solutions very early, but it can also lead to something called **overengineering**. To put it simple, overengineering is the act of solving a problem that doesn’t exist anywhere besides your mind. 

### Overengineering leads to bad code
It took me a long time to realize that even though my code is nice, clean and easy to extend, it is still a **bad** code. It often introduces unnecessary complexity, being harder to maintain and harder to understand by other devs, while taking a longer time to build.

None of it is a bad thing by itself. If you were to code just to get it done, you can get by, but in a month all you would get is messy, spaghetti code that nobody wants to work with in the future. It becomes a bad thing when that price is paid for a feature that you really don’t need.

### Do you actually need it?
I’m still fighting this battle myself and the thing that is helping me is a principle of extreme programming (XP) called **“You ain’t gonna need it”** (or simply, YAGNI). XP co-founder Ron Jeffries has written: "Always implement things when you actually need them, never when you just foresee that you need them.”

Now, whenever I start overthinking and catch myself wondering “But what if X happens” I just stop and write down my what ifs. Also, I think about **what would happen if that feature is not implemented**. Is the added complexity the price I’m willing to pay just now?

### Making that call is not easy
It is important to differ what is needed and what is not, even though it is difficult to do that. If that is a decision you are having problems with, ask your teammates. A fresh look at the problem is something that always helps. If for whatever reason that is not possible, go with a simpler solution. **Keep the list of what ifs and if they actually happen, choose the more complex solution.** 

This approach helped me with decision making paralysis and I believe it also made me a better developer.

How about you? Do you also sometimes overengineer? What are your tips and tricks for deciding what is needed and what is not?
Why You Should Use Web Components 
Tags: webcomponents, html
Published: 2021-03-26 18:19:41

# What is a web-component?
It's quite literally what it sounds like, a component that's on the web!...That's not exactly the whole gist of it but essentially its a block of code that works pretty much anywhere because of the fact that certain web standards pertaining to web-components have finally been met.

Around 2018-2019 Era of WebDev all 5 Major Browsers (Chrome, Firefox, Edge, Safari, and Opera) all came to a consensus on the web-standards surrounding web-components allowing for an increased modularity of code.

WC are essentially lego bricks that you can put into any build on the web and just have them fit. They don't run on frameworks or libraries, so no installations are required. Nor does it's functionality change due to the platform its on. ah the bliss of using vanillajs am I right?

WCs use Custom Elements and Shadow DOM and HTML Template in tandem to create some of the most creative modular code blocks we've seen in WebDev history.
Here's a short list of super convenient WCs:
1. A video player with a built in transcript scanner
2. A midi to sheet-music converter
3. to-do lists
4. Gallery Carousels
5. Anything you can come up with?

Some of the benefits of using WCs:
1. They can be deployed in any environment
2. They are modular and reusable infinitely
3. Versatile and Flexible
4. Communities can share/ship components to be used elsewhere

So what are you waiting for? Get out there and make some Web-Components!

Here are some extra links to help you get going.
https://www.webcomponents.org/
https://developer.mozilla.org/en-US/docs/Web/Web_Components

Shameless plug:
https://youtu.be/_ZG1Jh3CDRs
How to setup kubectl from scratch with existing clusters
Tags: kubernetes, kubectl, devops
Published: 2021-03-29 11:05:25

If you are just starting to use kubectl or Kubernetes, before you can interact with the Kubernetes clusters, you will need to setup gcloud and kubectl. This quick post explains how to do that. It could also be of use if your kubectl stopped working for unknown reasons, which it might do from time to time.

I wrote this quick post because all the instructions you get online assume you are working with a toy project and want to create your test kubernetes cluster. That is not what most people need in my opinion, so I thought I'd write this. Hopefully this is useful to at least another person out there :-)

## Step by step instructions

Setup GCloud SDK if you haven’t yet. Follow the instructions here: https://cloud.google.com/sdk/docs/install

Typing `gcloud --version` should output something like this:

```
$ gcloud --version
Google Cloud SDK 291.0.0
alpha 2020.05.01
beta 2020.05.01
bq 2.0.57
core 2020.05.01
gsutil 4.50
kubectl 2020.05.01
```

Install `kubectl` by following instructions here: https://kubernetes.io/docs/tasks/tools/

Typing `kubectl --version` should output something like this:

```
$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", 
  GitCommit:"6b1d87acf3c8253c123756b9e61dac642678305f", GitTreeState:"clean",
  BuildDate:"2021-03-18T01:10:43Z", GoVersion:"go1.15.8", Compiler:"gc",
  Platform:"linux/amd64"}
```

Backup any existing `~/.kube/config` file you might have from before and move it to a temporary directory.

Type the following command to fetch the kubernetes configuration for your existing clusters:

    $ gcloud container clusters get-credentials <cluster-name> --region <region> --project <kubernetes-project>

and repeat that for each project and cluster you want to manage.

If the step above fails, you likely don’t have the necessary permissions to access the desired kubernetes cluster. Ask someone to help if possible :-)

Your `~/.kube/config` file will now contain references to clusters configuration. Each cluster will have an endpoint URL, like `https://11.22.33.44`. If you access your kubernetes or work environment via a VPN, ensure your routes are setup to access those endpoints via the VPN itself, or your kubectl command won’t be able to connect your Kubernetes clusters!

You can confirm that everything is working by using a sample command like `kubectl get pods`. That command should return a list of pod names, like the following:

```
$ kubectl get pods
NAME                           READY   STATUS    RESTARTS   AGE
somestuff-7bbd5fd8bf-bb27k   1/1     Running   0          36d
...
```

Congratulations! You can now do some real damage with random kubectl commands. Have fun! :-)
Can any one help me in Unconfirmed Transactions Blockchain APP development
Tags: blockchain, api, unconfirmed, help
Published: 2021-03-29 11:03:13

Can any one help me in Unconfirmed Transactions Blockchain APP development.

I need to know which API i need to use for that fucntion

also i need to built that using "HTML5 APP" Web based app and Desktop based .
Don’t take this programming tips seriously
Tags: programming, webdev, codenewbie, discuss
Published: 2021-03-29 10:57:17

Tips that will help you to become a toxic programmer. I’ll keep adding more but feel free to share with anyone

1. Stop learning basics, that's for a noob. We are masters, we'll start by creating things
2. Keep watching tutorials, make it like a Netflix show. One after another
3. Stop commenting on code, that looks disgusting
4. Try copy-pasting code from StackOverflow
5. Bugs are feature, stop fixing them
6. Feel free to break keyboards when code doesn't work
7. Stop asking for help, that makes you look noob
8. Documentation is boring, skip that
9. Stop reading error, copy and paste that on google or maybe on bing
10. Push codes only in the master branch, because it's cooler
11. Stop refactoring, that takes a lot of time
12. Code isn't working? That's a computer issue. Try restarts
13. Learn multiple programming language, because this give changes to fight in online
14. Stop following patterns, we love freedom
15. Writing test is writing more codes, stop that thing
16. Copy-paste code as possible

Here Instagram version of the post –

{% instagram CM_vOY9j858 %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/programming-tips-for-not-taking-seriously/).

I’ve started a programming community on discord. Click to join [Discord Channel](https://discord.gg/uDj2JtH)

I've two free PDF for you
- [Learn JavaScript in 30 Days](https://blog.nerdjfpb.com/javascript-in-30-days-free-pdf/)
- [Node JS In 30 Days](https://blog.nerdjfpb.com/node-js-in-30-days-free-pdf/)

You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) or [instagram](https://www.instagram.com/nerd_jfpb/)
Day 24 of 365 Days of Code
Tags: javascript, react, graphql, mongodb
Published: 2021-03-29 10:37:38

Added bcrypt module to my application to encrypt the password before storing it to mongoDB. In addition, added the jwt token code logic and store it to the db.
Next Steps: Make a call from client(react) to submit the form and do the validations on the server(graphQL-express) side
change Jupyter Notebook working directory
Tags: python, jupyter, deeplearning
Published: 2021-03-29 09:42:12

Whenever I tried to open Jupyter notebook it was opening from my C: drive as a working directory 

Now to change your notebook working directory 
I've installed anaconda thru that I got jupyter notebook, jupyter lab, spyder, and various other editors

Step 1: search anaconda prompt in start button 
A command prompt will appear on your screen
Step 2: now from which directory you want to open jupyter notebook
type that directory name
ex: in my computer by default it was from C drive
but i want to open it from D drive
so i simply typed D: enter
Step 3: now type jupyter notebook

Done !!
It's my first article in DEV community
React Multiple domains pointing to one App with different Profile names
Published: 2021-03-29 10:25:20

We have a react app hosted on IIS. We have the following scenario. A shop registers on this site say with a shop name MyShop. Our website will automatically have a landing page called inshopshape.com/MyShop which works fine. Now we want to have shops to have their own domain say for example MyShop.com. Once they go in this URL they should automatically go to inshopshape.com/MyShop WITHOUT changing the address URL on browser. So someone could go  to www.myshop.com/products/test and under the hood it should show inshopshape.com/myshop/products/test

Kindly note the following
1. Website is hosted on IIS
2. This is a single page app done with react
3. If the solution provided is one with rewrite rules on IIS then you should keep in mind that react routes should still work when users navigate to the website
4. I can do a forwarding with masking but that's not good for SEO