teleren/devto huggingface dataset:
How to Disable Overlay Scrollbars in Ubuntu?
Tags: ubuntu
Published: 2021-12-14 05:03:32

---
title: How to Disable Overlay Scrollbars in Ubuntu?
published: true
date: 2021-11-28 05:08:34 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-disable-overlay-scrollbars-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">overlay-scrollbars</span></p>
</header>

It looks like Ubuntu 11.04 will come with [overlay scrollbars](http://design.canonical.com/2011/03/introducing-overlay-scrollbars-in-unity/) by default. I _do_ like them, but I don’t like the current mix of scrollbar types as many applications don’t yet use those overlay scrollbars.

Is there a way to disable overlay scrollbars ( **without** removing the `overlay-scrollbar` package)?

#### Accepted Answer

In **12.04 LTS** there’s a [slightly cleaner way to do it](http://www.liberiangeek.net/2012/03/disable-ubuntu-overlay-scrollbars-in-ubuntu-12-04-precise-pangolin/). Just run

```
gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false

```

in a terminal. Apps opened afterwards will have the non-ayatana scrollbar.

To get the default behavior back, run

```
gsettings reset org.gnome.desktop.interface ubuntu-overlay-scrollbars

```

If you are using **12.10 or later** , run

```
gsettings set com.canonical.desktop.interface scrollbar-mode normal

```

And to return to the default, run

```
gsettings reset com.canonical.desktop.interface scrollbar-mode

```

The post [How to Disable Overlay Scrollbars in Ubuntu?](https://stackallflow.com/ubuntu/how-to-disable-overlay-scrollbars-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
How to fix phpMyAdmin “Login without a password is forbidden by configuration” error?
Tags: phpmyadmin, pma, mysql, errors
Published: 2021-11-28 05:08:31

This is a security measure implemented by phpMyAdmin to block blank password logins. But we can easily disable it by changing the configuration file of phpMyAdmin. Enter the following command in the terminal, it will open the configuration file of phpMyAdmin with a terminal-based text editor, called Nano.

```
sudo nano /etc/phpmyadmin/config.inc.php
```

Then, press `Ctrl + w`. Search for “AllowNoPassword” (without quotes). Then the cursor will be on the required line, uncomment that line by removing the `//` of that line. Now that line should be like this.

```
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
```

Press `Ctrl` + `o` and press the enter key to save the phpMyAdmin configuration file. Then press `Ctrl` + `x` to exit from the Nano text editor.

Go [http://localhost/phpmyadmin](http://localhost/phpmyadmin) and try again to log in. Perhaps, still, you might not be able to log in due to the default MySQL Unix Socket based authentication. You might get a new error called "mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@'localhost'. Under such a case, read [how to fix mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@'localhost' error](https://devtonight.com/questions/how-to-fix-mysqli-real-connect-hy0001698-access-denied-for-user-root-at-localhost-error) question which explains how to fix it.
How to Recover/Reset Forgotten Gnome Keyring Password in Ubuntu?
Tags: ubuntu
Published: 2021-12-14 05:03:09

---
title: How to Recover/Reset Forgotten Gnome Keyring Password in Ubuntu?
published: true
date: 2021-11-28 05:07:58 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-recover-reset-forgotten-gnome-keyring-password-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">12.04</span><span style="font-size: 1.2em; color: initial;">gnome-keyring</span></p>
</header>

I am on Ubuntu and I have forgotten the password for my Gnome Keyring (yes, stupid me, I know). Any way I can get it back? I have already looked at [this link](https://help.ubuntu.com/16.04/ubuntu-help/user-forgottenpassword.html), but it says it’s not possible if my home directory is encrypted and unfortunately my home directory _is_ encrypted.

#### Accepted Answer

**Resetting everything (delete all passwords and start new keyring):**

```
rm ~/.local/share/keyrings/login.keyring

```

Then, log out and log back in. Ubuntu will automatically create a new login.keyring for you.

Or

Navigate to _Places > Home_. Press <kbd>Ctrl</kbd> + <kbd>H</kbd> to view “hidden files”. Navigate to _.local > share > keyrings_ and delete `login.keyring`

**Using the same keyring (resetting keyring password but keeping old passwords in keyring):**

1. Make a backup of the keyring
```
 cd ~/.local/share/keyrings/
 cp login.keyring login.keyring.backup

```

and after that delete `login.keyring` file

```
    rm ~/.local/share/keyrings/login.keyring

```

1. Create a new keyring file from Gnome Keyring with the name `login`
2. Replace the new keyring file with the backup of the old keyring file
```
 cd ~/.local/share/keyrings/
 mv login.keyring.backup login.keyring      

```

* * *

Note: before Ubuntu 12.10 the path to the keyrings folder was `~/.gnome2/keyrings/` instead of `~/.local/share/keyrings/`.

The post [How to Recover/Reset Forgotten Gnome Keyring Password in Ubuntu?](https://stackallflow.com/ubuntu/how-to-recover-reset-forgotten-gnome-keyring-password-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
How to Change the Plymouth Bootscreen in Ubuntu?
Tags: ubuntu
Published: 2021-12-07 18:34:41

---
title: How to Change the Plymouth Bootscreen in Ubuntu?
published: true
date: 2021-11-28 05:07:40 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-change-the-plymouth-bootscreen-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">plymouth</span></p>
</header>

With regards to Plymouth —

Are there alternative boot screens available?

What’s the easiest way to change the boot screen?

#### Accepted Answer

You can get a list of themes available via the repositories through [Synaptic Package Manager](http://www.nongnu.org/synaptic/) or through the command line via `aptitude`:

```
$ aptitude search plymouth-theme
p lubuntu-plymouth-theme - plymouth theme for Lubuntu
p plymouth-theme-fade-in - graphical boot animation and logger - fade-in theme
p plymouth-theme-glow - graphical boot animation and logger - glow theme
i plymouth-theme-kubuntu-logo - graphical boot animation and logger - kubuntu-logo theme
p plymouth-theme-sabily - plymouth theme for Sabily
p plymouth-theme-script - graphical boot animation and logger - script theme
p plymouth-theme-solar - graphical boot animation and logger - solar theme
p plymouth-theme-spinfinity - graphical boot animation and logger - spinfinity theme
p plymouth-theme-text - graphical boot animation and logger - text theme
c plymouth-theme-ubuntu-logo - graphical boot animation and logger - ubuntu-logo theme
i plymouth-theme-ubuntu-text - graphical boot animation and logger - ubuntu-logo theme
p plymouth-theme-ubuntustudio - Ubuntu Studio Plymouth theme
p xubuntu-plymouth-theme - Plymouth theme for Xubuntu

```

You can then install the resulting packages via Synaptic or apt as normal:

```
$ sudo apt install plymouth-theme-solar

```

If you’re looking for something not in the repositories, [UbuntuGeek](http://www.ubuntugeek.com/) has an excellent tutorial on how to [install and create your own custom Plymouth themes](http://www.ubuntugeek.com/quick-tipplymouth-themes-in-ubuntu-10-04-lucid-lynx.html).

The post [How to Change the Plymouth Bootscreen in Ubuntu?](https://stackallflow.com/ubuntu/how-to-change-the-plymouth-bootscreen-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
Polyfill for GetElementsByClassName
Tags: javascript
Published: 2021-11-28 04:57:20

```javascript
document.findByClass = function (requiredClass) {
  const body = this.body;
  function searchClasses(node) {
    let classes = [];
    let classList = node.classList || null;
    if (classList && classList.contains(requiredClass)) {
      classes.push(node);
    }

    let children = node.children;
    if (children.length > 0) {
      for (const element of children) {
        classes = classes.concat(searchClasses(element));
      }
    }
    return classes;
  }
  return searchClasses(body);
};

```
My tailwind automation setup
Tags: tailwindcss, css
Published: 2021-11-28 04:01:58

It can quickly become a long string of classes when it comes to tailwind classes, and you might lose an overview.

While working with Tailwind, I've found two amazing things that really help with this process.

## 1. Headwind opinionated Tailwind order plugin

Headwind is a fantastic visual studio code plugin made by [Ryan Heybourn](https://twitter.com/ryanheybourn).

[Click here to install the plugin](https://marketplace.visualstudio.com/items?itemName=heybourn.headwind)

What this plugin does, is sort classes automatically for you based on a preferred sorting order.

In action it looks like this:

![sort.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1637211075991/ipE6UA6h1p.gif) 

You might think, ok, but why do we need this? And for me, it makes a huge difference to have an opinionated class order. It's a sense of being organized, and it makes it calm to read classes as you know what to expect.

## 2. Tailwind ESLint plugin

If you want to fully make your project rock solid and independent of users' plugins.  You can take it to the next level and use the Tailwind ESLint plugin.

You can find this [Tailwind ESLint plugin on NPM](https://www.npmjs.com/package/eslint-plugin-tailwindcss)

This plugin is created by [Francois Massart](https://twitter.com/FrancoisMassart) and provides a couple of excellent rules we can leverage:

- classname order

Basically, what we see from the Headwind plugin. However, this sorting algorithm is a little bit different. I would suggest if you are using this ESLint plugin, turn of Headwind for that project.

- no custom classname 

Make sure no custom classes are used. You can, however, create a whitelist of classnames that are valid.

- no contradicting classnames 

Which is pretty sick. It can often happen that you accidentally add classes that contract, for example: `p2 p3`. The plugin will fail on this, and let you know.

## Conclusion

Tailwind is great on its own, but when working in teams, it can be a real lifesaver to have tools, like mentioned above, that can help us work uniform.

Perhaps you use other Tailwind helpers? Do let me know as we can always use more.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
So you know strings in golang, hun?😒
Tags: go, challenge
Published: 2021-11-28 03:57:24

---
title: So you know strings in golang, hun?😒
published: true
description: 
tags: go, challenge
//cover_image: https://direct_url_to_image.jpg
---

__Task:__ Iterate over a string and print each character.... Without using external libraries.

```go
func main() {
	var s string = "h👍🏻e"
	for i, c := range []rune(s) {
		fmt.Println(i, string(c))
	}
}
```

> This prints:

```shell
0 h
1 👍
2 🏻
3 e
```

> What it should print instead:

```go
0 h
1 👍🏻
2 e
```

So, can you make this work?

> Hint: The emoji used in string is skin-toned, not default.
Day 22 of #100daysofcode: Inspiration
Tags: 100daysofcode, react, python, beginners
Published: 2021-11-28 01:13:44

I woke up today with fresh ideas and inspiration that really helped solve problems that I ran into yesterday, so I want to take some time to talk about my views on sleep.

## The importance of sleep
Have you ever gone to sleep after working on something, and then woke up with new ideas? The idea is very common, and it is because our brain continues working on problems after we have gone to sleep. I have heard that, while awake, we consciously look for obvious connections between things, or direct connections. While asleep, our brains look for inobvious connections, or indirect connections.

In my experience, this has absolutely been true. It is part of the reason I want to work on a Study Aid app. Sleep helps you create connections between ideas which you wouldn't normally create while awake, and these indirect connections really help solidify ideas and concepts in your mind. 

In the Computer Science and Software Engineering fields, this is especially important. Concepts and ideas in these fields are often hard to picture, so it is very important to let our brains do the heavy lifting at times. 

Try it yourself: next time you're working on a hard problem that you're having trouble find a solution to, try sleeping on it. If you think hard about it as you go to sleep, you will almost definitely wake up with new ideas or approaches!

(results may vary)

## Today
* Made a lot of progress on my school project
* Surfed through a bit more of [Understand Django](https://dev.to/mblayman/understand-django-anatomy-of-an-application-4p1) by Matt Layman

Bit of a rest day other than that!

## Upcoming
* **Finals and final project sprints**: Not much time left!
* Continue reading about Django, 
* Iron out details regarding the Study Aid app (I really need to name this thing) -- May work on this this weekend
  * Flask vs Django - This is still an ongoing discussion. I received some good advice to stick with what I know in Flask, however I am still considering diving into Django, as I will have free time soon. Diving in headfirst has always been my favorite way to learn, however it is often not efficient!
  * Should I change how I deploy? Should Docker get in the picture?
  * Are there any other systems I should think about using as a part of this project?
* Learn more about Material UI, I will probably use Material UI a little bit in my (ongoing) school project. 
* Start the Study Aid app!
* Later in the challenge: AWS Deployment, AWS Certification, and Using Docker!?


Have a great, long weekend everybody, stay safe!

### Resources
[JS Course - FreeCodeCamp](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/)
[Understand Django - Matt Layman](https://dev.to/mblayman/from-browser-to-django-j0l)
Learn Python From Scratch As a Frontend Developer
Tags: python, javascript, beginners, programming
Published: 2021-11-28 02:06:52

As I mentioned in the title, I am a frontend developer who is familiar with JavaScript. Recently, I am going to learn Python from scratch.

## Why do I want to learn Python now?

Because I want to write a web crawler and do some data analysis.

I have two choices for web scraping:

- Use Nodejs-related tech stack
- Use Python-related tech stack

Nodejs is a tool that I have worked with for some years. If I choose Node for web scraping, I can reuse my knowledge and don’t need to learn new things.

But as I know, Python is a more popular language for web scraping. It has a thriving ecosystem in this field. If I choose Python, there are lots of tools, libraries, tutorials, and Stack Overflow Q&A.

Meanwhile, I want to learn a new programming language to refresh my brain. So, I choose Python.

## My Knowledge Background

Actually, I am not totally new to Python. Several years ago, with the popularity of artificial intelligence, I followed the trend and learned Python for a while.

But I didn’t dig into Python. And with time passed, I forget most knowledge about it. Now, Python is truly a new language for me.

## How to learn a new programming language?

In my opinion, programming is an art to imitate the real world. No matter which language, there are always date types such as number, string, boolean, there are always some data structures such as array, map, set. We need keywords such as if , for to control flow, we need libraries to send network requests.

With experience in JavaScript, I have the confidence to learn Python faster.

## Tutoirals about Python

When I search tutorials for Python on Google, there are pretty many results. Um, they are great.

But there all have a problem: Almost all the tutorials assume that learners are totally new to programming.

They will explain what is variable, what is a function, what is a class, etc. These concepts are important for new coders, but it’s meanless for experienced coders.

So I’m trying to use a new way to learn Python.

## The Series

Writing is a great way to save the thought eternally. I plan to start a series to record my experience to learn Python.

I will record:
- How I learn Python
- What are my thoughts on Python (maybe wrong)
- What bugs I have met.
- …

## My Goal

Having a vivid goal is important. I am not learning Python itself, I am learning to use Python to finish real tasks.

My goals:
- Write a robust web crawler in Python
- Analysis data and create sheets by Python

Finally:

**How did you learn Python?**
Write your first React hook
Tags: beginners, react
Published: 2021-11-28 01:07:45

It's possible to go far without writing our own hooks and instead lean on hooks made by third party libraries. However, we shouldn't shy away from it, at worst it will help us understand how other hooks work.

Let's write our own `useFetch` hook to clean up this component.

```js
const SomeComponent = () => {
  const [data, setData] = useState(undefined);

  useEffect(() => {
    const fetchData = async () => {
      const res = await fetch("https://someurl.com");
      const data = await res.json();
      setData(data);
    };
    fetchData();
  }, []);

  return <pre>{data}</pre>;
}
```

The first step to writing our hook is to pretend like it already works. How do we want the API to look like?

```js
const { data } = useFetch("https://someurl.com");
```

Now that we know how we want the end result to be, we can start filling in the details. One trick is to look for hooks (i.e. `useState`, `useEffect`) that can be grouped together, and put it inside a new hook.

In this case the `useEffect` is used with `useState` to set the data. This means we can group them together.

```js
const useFetch = (url) => {
  const [data, setData] = useState(undefined);

  useEffect(() => {
    const fetchData = async () => {
      const res = await fetch(url);
      const json = await res.json();
      setData(json);
    };
    fetchData();
  }, []);

  return { data };
}
```

Now we can use our new hook like this:

```js
const SomeComponent = () => {
  const { data } = useFetch("https://someurl.com");

  return <pre>{data}</pre>;
}
```

Writing our hooks is a great way to clean up our components and create bits of code that can easily be used in other components.
What are the books that changed your career as software developer?
Published: 2021-11-28 00:57:58

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pasu987zsvp91mzpybu.jpeg)
source: [Dreamstime.com](https://www.dreamstime.com/)

Hi folks. I've posted [an article about books that have changed my career as software engineer](https://julianogtz.github.io/my-personal-blog/posts/five-books-that-changed-my-career-as-a-software-engineer) in my personal blog.

Just to bring this context to dev.to I'd like to know which books that have changed your minds about career, technology, things to study, etc.
How to save the entire user session using Python?
Tags: python, machinelearning, ai, programming
Published: 2021-11-28 00:14:39

It is very important to know how to save the entire current session like local variables, objects etc when we are working with AI projects using Python because it is very difficult to run the entire python code every time to initialise the objects, Models, variables etc. 

To overcome this problem we have pickle to take care of it but some times it fails to deserialise the pickled objects so, 
dill library can be implemented to quickly store and retrieve the current session.

## Here is a quick introduction to dill:-

dill extends python’s pickle module for serializing and de-serializing python objects to the majority of the built-in python types. Serialization is the process of converting an object to a byte stream, and the inverse of which is converting a byte stream back to a python object hierarchy.

dill provides the user the same interface as the pickle module, and also includes some additional features. In addition to pickling python objects, dill provides the ability to save the state of an interpreter session in a single command. Hence, it would be feasable to save an interpreter session, close the interpreter, ship the pickled file to another computer, open a new interpreter, unpickle the session and thus continue from the ‘saved’ state of the original interpreter session.

Therefore, the following code can be implemented to save the current session:-

```python
##### User's python code #####
# pip install dill (or) conda install dill

import dill;
# Save the entire session by creating a new pickle file 
dill.dump_session('./your_bk_dill.pkl');

# Restore the entire session
dill.load_session('./your_bk_dill.pkl');
```
From, above it is clear that implementing dill is very easy and also it provides function like dill.detect to investigate the failed attributes inside that object.
MySQL calculate percentages
Published: 2021-11-27 23:31:56

Information is only useful, if you view it in a context. In data analysis you should avoid to only look at absolute numbers. For example you could just get the number of all users that have signed up in the previous month:
```sql
SELECT COUNT(*) as has_orderd
FROM users
WHERE users.has_ordered = true
AND YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
AND MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
```

Result:
```sql
has_ordered
450
```

But this number only gives you a certain amount of useful information. So you should look at that data, compared to all users that signed up the previous month:

```sql
SELECT COUNT(*) as total
FROM users
WHERE YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
AND MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
```

Result:
```sql
total
1100
```

If you want both data points next to each other, you can do the following:

```sql
SELECT 
    SUM(users.has_ordered = true) as user_with_orders, 
    COUNT(*) as total
FROM users
WHERE YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
AND MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
```

Result:
```sql
user_with_orders    total
450                 1100
```

And to calculate the percentage of all users that have signed up the last month, you can just do:

```sql
SELECT 
    SUM(users.has_ordered = true) as user_with_orders, 
    COUNT(*) as total,
    ((SUM(users.has_ordered = true)/COUNT(*)) * 100) as percentage
FROM users
WHERE YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
AND MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
```

Result:
```sql
user_with_orders    total   percentage
450                 1100    40.9
```