teleren/devto huggingface dataset:
Clear as the sun explanation of De Morgan's laws
Tags: programming, beginners, react
Published: 2023-04-01 12:38:17

Sometimes, novice developers struggle with basic logic expressions, especially [De Morgan's laws](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). To help with this, I have prepared a simple explanation.

> The following examples were made using a [small React app](https://github.com/altesack/play-with-logic-function) that I created for this article. You can choose to download and play with it or not 😀️. The following text doesn't require the app installation.

### Step 1. Where are we from
Ok. Let start with the basics. How looks `a&&b` result? I think everybody knows:

![a && b](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88q0l439dhvb1a25dopj.png)

### Step 2. Let's play with it
What if we negate `b` in this expression? Just imagine the column where `b` was `true` will changed to `false`, and vice versa. The matrix will be flipped horizontally, like reflection in a mirror! 
![a && b => a && !b](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwu3n5gfp8pvt7bzm94j.png)

And if we negate `a`, it will be flipped vertically:
![a && b => !a && b](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/475dokmjqut14jyuyrsk.png)

### Step 3. Try a little bit harder

What if we negate both `a` and `b` the same time? Right! The matrix will be flipped in both directions - horizontally and vertically:

![a && b => !a && !b](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqxgakh90c7ofq9l1hw1.png)

### Step 4. The Final
Nice, and what if we negate the entire expression after negating `a` and `b`? In that case the values in the matrix will change from  `true` to `false`, and vice versa:

![!a && !b => !(!a && !b)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43l7gvhi8ya964whgts9.png)

But wait! It looks like matrix for `a||b`!

![de Morgan's Law](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xm9ulqjzid9axzw90584.png)


Actually that's the **de Morgan's Law**

`!(!a&&!b) ===  a||b` or `!a&&!b ===  !(a||b)`

I hope this article was helpful.
How to create a vue project using vite
Tags: webdev, javascript, vue, programming
Published: 2023-04-01 12:38:11

In this article we will see how to create a vue app using vite.

First install vite

```
npm install vite
```

To create vue app using vite type below command in terminal and press `Enter`

```
npm init vite <project-name>
```

After the above command we will be prompted with few questions like which framework we want to use and we will choose vue and which language JavaScript or TypeScript.

When vite completes creating vue project for us then we have to install all the dependencies for our project using below command

```
npm install
```

With that we have created our vue app using vite.

To run our project locally:

```
npm run dev // starts development server at localhost/5173
```
HTML CSS PROJECT #4
Tags: beginners, programming, webdev, css
Published: 2023-04-01 12:36:40

HI EVERYONE! Here is the fourth challenge from [**FRONTEND MENTOR**](https://www.frontendmentor.io/challenges/nft-preview-card-component-SbdUL_w0U)!

I learned a bunch of new things and it was perfect!

Solution on **GITHUB**:
https://mckh03.github.io/FEM-NTF-Preview-Card-Component/

Solution on **FEM**:
https://www.frontendmentor.io/solutions/nft-preview-card-component-0iRVLNbFQW

My **TWITTER**:
https://twitter.com/ytmehrshad

My **GITHUB**:
https://github.com/MCKH03

My **FEM PROFILE**:
https://www.frontendmentor.io/profile/MCKH03
Projects Sections in My Website
Tags: projects, nextjs, react, webdev
Published: 2023-04-01 12:29:50

Hello friends, I have now added a projects sections on my personal website. It contains the list of projects that I have contributed. I hope to add more projects after completing it in few months. I've been working as a freelancer for past 3-4 months and it's been a hell of a journey. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b0qmmlwi4g5qo14do1y.png)

Website Link: [https://dipenmaharjan.com.np/](https://dipenmaharjan.com.np/)
Follow me on Twitter: [https://twitter.com/slimpotatoboy](https://twitter.com/slimpotatoboy)
Specialer picoCTF 2023
Tags: cybersecurity, picoctf, beginners, tutorial
Published: 2023-04-01 12:27:54

# Specialer

**300 points**

Description
Reception of Special has been cool to say the least. That's why we made an exclusive version of Special, called Secure Comprehensive Interface for Affecting Linux Empirically Rad, or just 'Specialer'. With Specialer, we really tried to remove the distractions from using a shell. Yes, we took out spell checker because of everybody's complaining. But we think you will be excited about our new, reduced feature set for keeping you focused on what needs it the most. Please start an instance to test your very own copy of Specialer.


*Note:* This challenge launches an instance on demand.

___

Seeing as though I have not solved (maybe yet?) `Special` this challenge was way easier (and thus the point difference bothers me).

Connecting into the shell we're not allowed a lot of things like `cat, ls...`.

My solution was as follows:

```bash
echo "$( < /home/ctf-player/ala/kazam.txt)"
```

> picoCTF{your flag}
Special picoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 12:24:04

# Special

**300 points**

AUTHOR: LT 'SYREAL' JONES

Description
Don't power users get tired of making spelling mistakes in the shell? Not anymore! Enter Special, the Spell Checked Interface for Affecting Linux. Now, every word is properly spelled and capitalized... automatically and behind-the-scenes! Be the first to test Special in beta, and feel free to tell us all about how Special streamlines every development process that you face. When your co-workers see your amazing shell interface, just tell them: That's Special (TM)
Start your instance to see connection details.


*Note:* This challenge launches an instance on demand.

___

This challenge was hard and to come with this bash script it was pain.

```bash
cat flag.txt | cat /home/ctf-player/*/*.txt
```

which gave the flag:

> picoCTF{your flag}
Google Announces Open-Sourcing of Their Ranking Algorithm
Tags: news, opensource, google, community
Published: 2023-04-01 12:23:45

As of today, Google has announced that they will be open sourcing their world-renowned ranking algorithm, PageRank. This move is part of Google's continuous efforts to promote transparency and encourage innovation in the tech industry.

By open-sourcing the algorithm, Google hopes to empower webmasters and SEO professionals to understand better the factors that influence rankings. This, in turn, would lead to higher-quality websites and a more user-friendly internet.

PageRank, which was developed by Larry Page and Sergey Brin in the late 1990s, has been Google's search engine's backbone for over two decades. The algorithm analyzes the links between web pages, determining the relevance and authority of a page, allowing Google to deliver the most accurate search results to its users.

Despite some concerns raised by industry experts about the algorithm's potential misuse, Google assures its users that it has taken appropriate measures to ensure the integrity and security of PageRank.

However, there is a catch. The announcement of the open-sourcing of PageRank is an April Fool's joke. So, don't be fooled by the date, and don't go looking for that PageRank source code just yet!

Happy April Fools' Day!
money-ware picoCTF 2023
Tags: cybersecurity, beginners, picoctf, 2023
Published: 2023-04-01 12:12:34

# money-ware

**100 points**

AUTHOR: JUNI19

Description
Flag format: picoCTF{Malwarename}
The first letter of the malware name should be capitalized and the rest lowercase.
Your friend just got hacked and has been asked to pay some bitcoins to 1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX. He doesn’t seem to understand what is going on and asks you for advice. Can you identify what malware he’s being a victim of?

___

Googling `1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX` I got the [link](https://www.bitcoinabuse.com/reports/1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX) which had reports with descriptions and one of those descriptions points us to:

More information here: [https://blog.avira.com/petya-strikes-back/](https://blog.avira.com/petya-strikes-back/)

This is an article about a vulnerability called `Petya` so our answer should be:

> picoCTF{petya}
38% of Startup 2/10
Tags: startup, webdev
Published: 2023-03-13 03:35:38

In Febuary I decided that I would make 10 startups in 10 months. So far, we are in the second month. I am about 38 percent through this month but I have made signifacant progress, the goal was to create a study platform for people to share their school related questions and make posts about studying tips. Although it has been going great I have reached a problem, I already finished the project. You see, I grinded that project out believing that I would not have any chance of completing it on time but the reverse happened. Now I am drawing a blank on ideas. Tomorrow I'm gonna ask ChatGPT for study app ideas and then figure out how to impliment them into the app. 

I have decided to add a new rule to this project. For each startup that I make, I must use a new libary with it. I decided to do this so that I can learn to adapt to differnet libaries and learn how to read documentation. I get easily overwhelmed when reading documentation, so to overcome I implemented this rule. I know that this will benefit me in the long run an will be a great skill to have in the job force. For this project, I used react-bootstrap. I never heard of react-bootstrap until i ran into an article in dev.to. In this article, they talked about different libaries where I ran into react-bootstrap. So far, it is very easy to use and the documentation is really helpful. I have enjoyed using it and I might use it again in different projects.
useless picoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 12:09:08

# useless

**100 points**

AUTHOR: LOIC SHEMA

Description
There's an interesting script in the user's home directory
The work computer is running SSH. We've been given a script which performs some basic calculations, explore the script and find a flag.
Hostname: saturn.picoctf.net
Port:   //port number given to you
Username: picoplayer
Password: password

*Note:* This challenge launches an instance on demand.

___

That was a tricky challenge, in the home directory there is a file named `useless` that does command line arithmetic, spoiler, it does nothing.

The interesting thing to notice was the code itself, specifically the line:

```bash
else
    echo "Read the manual"
```

Using `man` on the script we get the flag hidden at the bottom of the page.

> picoCTF{your flag}
check ip address in Linux
Tags: linux, cloud, beginners, programming
Published: 2023-04-01 12:02:04


![check ip adddress in Linux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ct744fff4s9osg83gf40.png)


 finding the IP address of a Linux system can be done using the ifconfig command, the ip command, or the ip route command.

- The ifconfig command is a legacy command used to configure and display the network interface parameters. It can also be used to find the IP address of a Linux system.  
- The ip command is the modern and recommended command to configure and display the network interface parameters. It can also be used to find the IP address of a Linux system. 
- The ip route command is used to display the routing table of a Linux system.


If you want to learn more details about finding the IP address of a Linux system, you can refer to our blog post titled "[3 Easy Ways to Find Your Linux System IP Address](https://www.howtouselinux.com/post/check-ip-address-in-linux)". 

In this post, we provide step-by-step instructions for using the ifconfig, ip, and ip route commands to find the IP address of your Linux system. We also discuss some common issues that you may encounter when trying to find your IP address, and provide solutions to these issues. 

Additionally, we provide some tips for troubleshooting networking issues related to IP addresses in Linux. We hope that this post will be helpful to you in finding and using the IP address of your Linux system.
E2E Testing with Jest & Puppeteer
Tags: testing, jest, puppeteer, e2e
Published: 2023-04-01 11:59:50

입사후, 온보딩 프로젝트가 끝나고 정식으로 처음맡았던 일이 바로 **E2E 테스트** 관련 일이었다.

기존에 **nightwatch**로 동작하던 것을 **jest + puppeteer** 환경으로 변경하고 Test case를 추가하는 것!!


- [jest](https://jestjs.io/docs/26.x/getting-started): 테스트 가능한 자바스크립트 라이브러리
- [puppeteer](https://github.com/puppeteer/puppeteer#usage): **headless Chrome** 이나 **Chromium**을 컨트롤하기 위한 Node.js 라이브러리


**headless browser**란?

> A headless browser is a web browser without a graphical user interface.

출처: [Wiki](https://en.wikipedia.org/wiki/Headless_browser)

GUI가 없이 작동되는(= 렌더링) 브라우저 라고 이해하면 된다.

---

jest에 대한 일반적인 내용 보단, Test case를 작성하면서 겪었던 문제와 경험 위주로 작성해보려고 한다.

**이슈1:** test 시작 전, [`beforeAll`](https://jestjs.io/docs/api#beforeallfn-timeout)안의 함수들이 모두 실행되지 않고 테스트가 시작되므로 error발생.


 `beforeAll` 안에 workspace에서 로그인후 해당 상담사의 상태를 체크하고, `online`이 아니라면 `online`으로 변경해주는 함수가 있었다.   

 상담사 상태가 온라인이어야만, 그 다음 test case들이 정상적으로 실행되기 때문에 반드시 beforeAll 함수 안에서 실행되어야만 했는데,
 
**기다려주지 않고 다음 case들이 실행되어 그 이후 case들은 당연히 error가 발생하는 문제**였다.

```javascript
 beforeAll(async() => {
    .....
    await lib.login(AGENT.id, AGENT.password);
    await lib.checkUserState();
 });
```
jest문서에서 해결책을 찾을 수 있었다.

> Optionally, you can provide a timeout (in milliseconds) for specifying how long to wait before aborting. The default timeout is 5 seconds.

default timeout이 5초이기 때문에, 아래와 같이 setTimeout 시간을 명시적으로 설정해주면 해결할 수 있었다.

```javascript
jest.setTimeout(50 * DEFAULT_TIMEOUT);
```

**이슈 2:** 각각 다른 브라우저 2개에서 연관된 테스트 실행시, error 발생.

유저와 상담사간 상담이 진행되는 test case이기 때문에 브라우저 2개가 필요했다. 

workspace와 채팅앱 화면을 왔다갔다 하며 테스트가 진행되어야 하는데, 채팅앱에서 workspace으로 화면에 접근이 되지 않았다.

알고보니, tc를 진행할 **browser에 focus**를 줘야 하는 것이었다.

browser를 컨트롤 하는 부분이므로, puppeteer의 [bringToFront](https://pptr.dev/api/puppeteer.page.bringtofront) method를 이용하면 된다.
(각각 다른 브라우저 뿐만 아니라, 한 브라우저 내의 tab 전환도 가능하다.)

---

 입사전 혼자 프로젝트를 진행할 땐, 테스트의 중요성을 잘 깨닫지 못해서 테스트 코드는 우선 순위에서 밀려나 작성하지 않았던 경우가 대부분이었다.

 서비스 제품을 개발하는 팀에선, 테스트 코드가 필수인 걸 알게 됐다.
특히, 큰 feature들이 추가되는 경우라면 기존 로직이 동일하게 동작하는지 side effect이 없는지 등 에러를 방지할 수 있기 때문이다.

E2E 테스트와 더불어, unit 테스트 기반의 TDD를 실천하는 우리 개발팀이 될 수 있길 바라며...💪🏻
repetitions picoctf 2023
Tags: picoctf, 2023, beginners, cybersecurity
Published: 2023-04-01 11:57:17

# repetitions

**100 points**

AUTHOR: THEONESTE BYAGUTANGAZA

Description
Can you make sense of this file?
Download the file [here]

___


The file itself looks like standard `base64` encoding and decoding it will give you the flag use [cyberchef](https://cyberchef.org/).

> picoCTF{your flag}
Permissions
Tags: cybersecurity, picoctf, tutorial, beginners
Published: 2023-04-01 11:50:33

# Permissions

**100 points**

AUTHOR: GEOFFREY NJOGU

Description
Can you read files in the root file?
Additional details will be available after launching your challenge instance.

*Note:* This challenge launches an instance on demand.

___

Connecting to the server and `cd`ing to `\` I saw a directory named challenge, inside it there was a file which when `cat`ing it game the flag.

> picoCTF{your flag}
Rules 2023 picoCTF
Tags: cybersecurity, tutorial, beginners, picoctf
Published: 2023-04-01 11:47:46

# Rules 2023

**100 points**

AUTHOR: LT 'SYREAL' JONES

Description
Read the rules of the competition and get a little bonus!
[Rules](https://picoctf.org/competitions/2023-spring-rules.html)

___

If you look through the rules under `What are the other rules and terms for picoCTF 2023?` you can see the flag is an image (hence the hint saying `CTRL+f` won't work) and it says:

> picoCTF{your flag}
Who is it PicoCTF 2023
Tags: picoctf, beginners, cybersecurity, linux
Published: 2023-04-01 11:35:12

# who is it

**100 points**

AUTHOR: JUNIAS BONOU

Description
Someone just sent you an email claiming to be Google's co-founder Larry Page but you suspect a scam.
Can you help us identify whose mail server the email actually originated from?
Download the email file [here]. Flag: picoCTF{FirstnameLastname}

___

Looking into the `.eml` file its not very hard to see that the only IP address there is the attackers IP.

I tried for so long with many different websites to lookup either the mail or the IP and only [https://www.whatismyip.com/ip-whois-lookup/](https://www.whatismyip.com/ip-whois-lookup/) had the name of the person with the relevant IP: 173.249.33.206 and it's

```
Wilhelm Zwalina
```

So the answer is:

> picoCTF{WilhelmZwalina}
Chrono picoCTf 2023
Tags: cybersecurity, picoctf, beginners, tutorial
Published: 2023-04-01 11:42:59

# chrono

**100 points**

AUTHOR: MUBARAK MIKAIL

Description
How to automate tasks to run at intervals on linux servers?
Additional details will be available after launching your challenge instance.

*Note:* This challenge launches an instance on demand.

___

When we launch the instance and `ssh` to the relevant credentials given to us we are presented with a shell.

Based on the question prompt it had to be `cron` jobs.

After various attempts to access `crontab` itself, I tried looking inside `/etc/crontab` with the `cat` command and it had the flag prompt for my session:

> picoCTF{your flag}
PcapPoisoning PicoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 11:38:19

# PcapPoisoning

**100 points**

AUTHOR: MUBARAK MIKAIL

Description
How about some hide and seek heh?
Download this [file] and find the flag.

___

I just used strings and oh there was a sus string in the file, what could it be? or just open the file and `CRTL + F` and find `pico` and you will find the flag.

> picoCTF{your flag}
MSB picoCTF 2023
Tags: msb, picoctf, cybersecurity, beginners
Published: 2023-04-01 11:32:48

# MSB

**200 points**

AUTHOR: LT 'SYREAL' JONES

Description
This image passes LSB statistical analysis, but we can't help but think there must be something to the visual artifacts present in this image...
Download the image [here]

___

This type of challenge can be easily solved with [StegSolve](https://stegonline.georgeom.net/) because this site can extract LSB data with pixel order and RGB values. or by using this [github repo may help you ](https://github.com/Pulho/sigBits)

and using `python sigBits.py -t=msb -o=rgb -e=column file.png`


I tried the first default option -> the first row in this site and got readable words, so I downloaded the whole using `sigbits` go in the extracted file and `CTRL+F` the word `pico`  both ways work I found the flag:

> picoCTF{your flag}
How to Choose Your Type: TypeScript Interfaces vs Types
Tags: typescript, webdev, beginners, programming
Published: 2023-04-01 11:31:30

While working with Typescript we have ever thought that if **type** and **interface** works the same then why we have 2 options? Why we need **type** or **interface** even one of them is enough for us?
But actually, even they works similar they are different from each other.
So in this blog I will clear all the doubts regarding type and interface.
So let's get's started.

In Typescript, **type** and **interface** are used to define custom types i.e. shape of object.

There syntax would be written as :

```
// Defining a type
type Student = {
  name: string;
  age: number;
};

// Defining an interface
interface Teacher {
  name: string;
  age: number;
}
```

**How  they are different ?**

1)**Interface Support Declaration Merging**.Declaration Merging means we can declare multiple interfaces with the same name, and Typescript will merge them into a single interface.

**For Example:**

```
interface Teacher {
  name: string;
}

interface Teacher {
  age: number;
}
interface Teacher {
  subject: string;
}
const teacher: Teacher = {
  name: "John",
  age: 30,
  subject:"Mathematics"
};

```
On the other hand, **we can't merge types** in Typescript.

2)**type keyword supports Computed properties but interface doesn't.**

What does Computed Properties mean?

Computed properties are a way of dynamically generating property names in an object literal in TypeScript.

In TypeScript, computed properties are supported by the **type** keyword but not by the **interface** keyword. This is because **interface** is a declaration that describes the shape of an object, and its properties must be known at compile time. On the other hand, **type** is a way of defining a custom type and allows for more flexibility, including the ability to define computed properties.

Here's an example of using computed properties in a **type** definition:

```
type Student = {
  name: string;
  age: number;
  [key: string]: unknown; // Computed property
};

const student: Student = {
  name: "John",
  age: 30,
  address: "123 ABC", // Computed property
  phone: "111-111-1111", // Computed property
};
```

**type** is very useful when we want to store key:value that is coming from API because we don't know exactly about key:vaue that is coming from API response and in future if new keys:values are added or deleted then we don't need to worry about removing it from code.

So I hope this blog will clear the doubts regarding **type** and **interface**.

If you know more interesting one please share in comments !!
Hideme PicoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 11:26:20

# hideme

**100 points**

AUTHOR: GEOFFREY NJOGU

Description
Every file gets a flag.
The SOC analyst saw one image been sent back and forth between two people. They decided to investigate and found out that there was more than what meets the eye [here]

___

The file is a normal `PNG` image with pretty much nothing suspicious other than a hidden file within it accessed by `binwalk -e nameofthefile`.

`cd`-in into the directory named secret generated from the extraction had an image with the flag prompt in it:

> picoCTF{your port}