teleren/devto huggingface dataset:
How to enable hibernation in Ubuntu?
Tags: ubuntu, hibernate, management, power
Published: 2021-11-25 17:02:36

---
title: How to enable hibernation in Ubuntu?
published: true
date: 2021-11-23 09:31:16 UTC
tags: Ubuntu,hibernate,management,power
canonical_url: https://stackallflow.com/ubuntu/how-to-enable-hibernation-in-ubuntu/
---

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

In Ubuntu 12.04 and newer, [hibernation has been disabled by default in policykit](https://bugs.launchpad.net/ubuntu/+source/policykit-desktop-privileges/+bug/812394). How can I enable this back?

#### Accepted Answer

**If this answer does not work in Ubuntu 13.10, see [here](https://askubuntu.com/a/362499/178596) for an alternative answer**

* * *

Hibernation was [disabled](https://bugs.launchpad.net/ubuntu/+source/policykit-desktop-privileges/+bug/812394) on 12.04 for machines that are not certified with Ubuntu.

In order to enable hibernation you need to test whether it works correctly by running `sudo pm-hibernate` in a terminal. The system will try to hibernate. If you are able to start the system again then you are more or less safe to add an override.

To do so, start editing:

```
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

```

Fill it with this:

```
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

```

Or in 14.04 and later:

```
[Re-enable hibernate by default for login1]
  Identity=unix-user:*
  Action=org.freedesktop.login1.hibernate
  ResultActive=yes

[Re-enable hibernate for multiple users by default in logind]
  Identity=unix-user:*
  Action=org.freedesktop.login1.hibernate-multiple-sessions
  ResultActive=yes

```

Save by pressing <kbd>Ctrl</kbd>–<kbd>O</kbd> then <kbd>enter</kbd> and then exit nano by pressing <kbd>Ctrl</kbd>–<kbd>X</kbd>.

Restart and hibernation is back!

Or run `killall unity-panel-service` to just reset the menu.

Some users will then need to run `sudo update-grub` to get the hibernate option to be available in the power menu. Some users may also have to at least log out then log in to get it to appear in the (upper right) power menu.

The post [How to enable hibernation in Ubuntu?](https://stackallflow.com/ubuntu/how-to-enable-hibernation-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).
Why utils & helpers is a dump
Published: 2021-11-23 09:04:22

Let's start with how they appear. During project development, the programmer tries to put repetitive pieces of code into functions and reuse them. At some point, the same function is needed in two different modules, the inexperienced developer decides to move the function to a separate module. But for some reason stops at this solution, creating a directory/module of utils or helpers, without thinking about the future of this part of the program.

As the project grows, the number of functions in this directory grows. The number of developers in the project also grows. More and more functions appear. Often nobody follows the structure of these modules and it is quite possible that duplicated code will appear.

## How to solve this?
Forget about the `utils` and `helpers` directories. These names don't really capture the essence of the content. And from the rules of clean code we remember, the name should be unambiguous and reflect the purpose. We have to wonder why we need to put functions in there in the first place. Why are they used in such different parts of the project?

Perhaps the answer is poor organization of the code of the whole project. If you examine the project carefully you can find a lot of code which can be put in a separate library. If this code cannot or should not be put in a proper library, it can be put in a library inside the project. In the case of JS, you can do this by creating a complete library inside `lib/`.

You need to give such a library a meaningful and unambiguous name, write documentation and tests. And all related code should be collected in this library. For example, put all the functions that work with dates in the internal library `lib/datetime`. The `lib/` prefix will avoid name conflicts, and it will be possible to use simple and clear names. Of course, you can make an npm scope to simplify future npm publishing. For example, `@lib/datetime`.

## How is this different from lib and helpers?
- All code is put in a full-fledged library with a meaningful name, documentation and tests.
- `lib` describes the contents explicitly: it's a library.
- Refactoring, publishing and deleting this library become trivial tasks.
iOS clang: error: linker command failed with exit code 1 (use -v to see invocation)
Tags: reactnative, ios, javascript
Published: 2021-11-23 08:41:47

Here is what I did after spending 2 days trying to fix this.
1. Clean the Build
```Menu Bar → Product → Clean```
2. Delete Derived Data
3. Delete Xcode Preferences
in terminal ```defaults delete com.apple.dt.Xcode```
4. make sure your build setting are on new build setting instead of legacy build setting.
I can't be sure what worked exactly and what happened in the background, but it worked for me.
How to access your server anywhere without SSH
Tags: devops, ssh, tutorial, writing
Published: 2021-11-23 08:41:07

How to access your server anywhere without SSH.

## Use cases

- You want to have temporary access of your server from a remote location

- You don't want to authorize a key to connect via ssh

---

OK now lets get into the process.

## Prerequisites

- root access
- A Linux machine with ports `3023`, `3024`, `3025`, and `443` open
- A registered domain name
- An SSH client like OpenSSH.
- 2FA App

## Download and installing Teleport

- visit [Teleport website](https://goteleport.com/)

![Teleport website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9m9awg80idrnmxd19g3.png)

- Click getting started, and select the community edition

![Choosing community edition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8um75kv45ta5kbycr91g.png)
 
 - Select acconding your platform, for me its Ubuntu 18.04 LTS, so I select the `Linux 64-bit DEB` version 8.0

 ![Copy the link to download](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6y4tky9h8wvyz35xu0ls.png)

- Now login to your server via ssh, and download teleport using wget by running `wget https://get.gravitational.com/teleport_8.0.0_amd64.deb`
 
![After downloading teleport using teleport](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5pyab9ggxbwor905h7m.png)

- Install the deb package by `sudo apt install ./teleport_8.0.0_amd64.deb`

![Installing Deb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njb1x0n0lg12643gi12q.png)
 
- Configure your domain for SSL certificate

```sh
sudo teleport configure --acme --acme-email=your-email@example.com --cluster-name=tele.example.com -o /etc/teleport.yaml
```
### Note if you already have reverse proxy servers running at port `443` you needed to edit it and change the port (/etc/teleport.yaml) [Included at last step].


- Now start the teleport `sudo systemctl start teleport.service`

- Add user with 
```sh
tctl users add teleport-admin --roles=editor,access --logins=root,ubuntu,ec2-user
```
- It will give you a url to access the teleport

- Follow the steps in the webpage to activate

---

### For users with port address being used by other process

- Open the config file in `/etc/teleport.yaml`
- Go to the line where 

```yaml
web_listen_addr: 0.0.0.0:443
public_addr: tele.example.com:443
```

- Change the port address there

- reload teleport service by `sudo systemctl restart teleport.service`

---

for more about [installation documentation checkout](https://goteleport.com/docs/getting-started/linux-server/)
Black Friday & Cyber Monday 2021 🔥 Curated List of Best Deals 
Published: 2021-11-23 08:40:52

What is the best deal for the web developer? 

The list I've put together with the help of contributors on GitHub can help you find the offer for yourself 👇

{% github mdbootstrap/Black-Friday-2021 %}

PS. the list of offers is constantly updated
Country Code Picker using Jetpack Compose
Tags: android, kotlin, mobile, tutorial
Published: 2021-11-23 08:20:35

Pada artikel kali ini saya akan menunjukan bagaimana membuat country picker menggunakan jetpack compose.

Jetpack Compose tentunya berbeda dengan XML. Yang sebenarnya, XML layout akan dirender menjadi kode android.view. Sedangkan jetpack compose tidak lagi menggunakan android.view. Ini menjadikan Jetpack Compose lebih cepat ketika di compile

Saat ini sedikit plugin yang support Jetpack Compose. Disini saya akan menjelaskan bagaimana menampilkan Country Code Picker menggunakan Jetpack Compose ini.

Pertama saya perkenalkan dulu dengan library atau package yang bernama **ComposeCountryCodePicker** ini merupakan package buatan saya sendiri yang berguna untuk membuat tampilan country code picker.

## 🎉 Requirement
There are requirements that you must meet in order to use this library:

1. Jetpack Compose version 1.1.0-beta02
2. Android Gradle Plugin version 7.0.3
3. Kotlin version 1.5.31

## 🔧 Installing plugin
First tambahkan repository jitpack di `build.gradle`. Seperti dibawah ini

```groovy
repositories {
    maven { url 'https://jitpack.io' }
}
```
Setelah itu tambahkan plugin nya seperti biasa di file `app/build.gradle`.
Setelah itu jangan lupa untuk **Sync Gradle** supaya library terpasang dengan baik
```groovy
implementation 'com.github farhanroy:ComposeCountryCodePicker:1.0.2'
```
## ✏️ How to usage ?
Sangat mudah sekali, panggil saja Composable functionnya, lalu untuk mendapatkan nama dari negara cukup manfaatkan high order parameter yang ada.

```kotlin
CountryCodeDialog(pickedCountry = { 
    Log.d("", it.name) // picked contry name
})
```
Jika ada error atau bug lain langsung saja buat **issue** di repository package ini.

## Preview
Berikut tampilan dari kode diatas
![Image description](https://i.ibb.co/N70nMjV/1.png)

![Image description](https://i.ibb.co/8sJC0B8/2.png)

## Closing
Feel free untuk bertanya atau **pull request** ke repository saya ini merupakan project opensource dan terbuka untuk semua orang.
 
https://github.com/farhanroy/ComposeCountryCodePicker
Difference between Pyglet and Pygame
Published: 2021-11-23 08:00:54

Python is one of the <a href="https://externlabs.com/blogs/top-10-python-frameworks-for-game-development/">most potential programming languages</a> that can help develop web, mobile, and desktop applications and even games; without keen knowledge in programming. A proper Framework or library can make any Python programming much more effortless. There are hundreds of frameworks and libraries available for Python Development, and each of them has something different to offer. Today we are going to find the best Python library for game development. 

Pyglet

Like Python, Pyglet is easy to understand and uses the python library. In addition, Pyglet is powerful enough to build a visually rich graphical user interface that can be used in games and multimedia. It works on Windows, Mac, and Linux. 

It has all the essential features like window system, UI events handling, OpenGL support, Images integration, sound, and videos. It is solely based on the Python programming language.

Benefits of Pyglet in development- 

- Doesn’t Require external installation
- Windows management system allowing multitasking support
- We can use it for commercial and open source work 
- We can use multimedia in any format, including any type of audio or sound and Visual.

PyGame

Pygame offers in-built tutorials, examples, and FAQs, which makes it easier to work with them. It is a python-based implementation of the SDL library programmed in C. with SDL, Pygame already has all the features and advantages of SDL and provides users easier access to it. 

<a href="https://externlabs.com/blogs/differences-between-pyglet-vs-pygame-in-python/">Difference Between Pyglet & Pygame</a>

Pyglet

- Intertwined with OpenGL
- First subclass and then starts to do anything
3D Supported
- Version update will require changes in projects
When It comes to Speed, Pyglet is much faster.
- Smaller user base and community Updated

PyGame

- It Uses SDL Libraries which is better than OpenGL
- Starting is easier with PyGame; It doesn’t require any class of function to start.
- It can only develop 2D projects and does not support 3D because of more straightforward python syntax
- Working with Pygame is more convenient and portable. It has a broadmore accessible community of developers and a stable API, So you will never need to rewrite codes again.
- Pygame is too slow when compared to Pyglet
- Older than Pyglet, it has more users and developers and popularity
- Not updated for a long time

You might think it’s not too different, but these more minor differences make significant in your work. So Pyglet is the better choice for game development of any scale, and If you are a beginner, you can start with Pygame then use Pyglet.
Macbook Pro Keyboard with Touchbar with HTML/CSS
Tags: webdev, opensource, html, css
Published: 2021-11-23 07:50:01

Hi,
I want to introduce my little practise project, which I call Mac-n-CSS. During my practise on advance CSS, I build this 3D replica of the keyboard of Macbook Pro with touchbar.

You can have a look at it [here](https://dgr8akki.github.io/Mac-n-CSS/)!
I wrote this project in pure HTML and CSS. I used SASS for smooth compilation and less code.

I think if something does not start well, it may end well when you do your best. This project was something like that, it didn't start well, and it was simple, but when I continued on my way and didn't break the chain, I saw the fantastic progress. -Mahdi

Feel free to clone, star and raise bugs. I would be very happy if you show your likes in form of star on [my github repo](https://github.com/dgr8akki/Mac-n-CSS).
![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqkxrf1sj9nvapoieync.png)
Create and expose deployment using NodePort Service in Kubernetes
Published: 2021-11-23 07:47:27

This is a practice question for Kubernetes CKA and CKAD exams.

**Question**
We have a 3 node cluster setup locally using kubeadm. We need to do the following:

- Create a deployment named web-deploy with the 3 replicas of image mycloudtutorials/poddeployservicedemo:latest in namespace app1
(The Docker container is created from apache image, exposing the application on port 80)

- Pass the following environment variables   NODE_NAME, POD_NAME, POD_IP which are the name of the node where the pod is running, name of the pod and the ip address of the pod respectively

- Verify the pods are working fine, by curl to the individual pods using POD’s internal ip address

- Create a service for this deployment of type NodePort with name web-service in namespace app1 on port 30090

- Check the End points

-  Access the service on each of the node:port of the cluster nodes from outside of the cluster


**Answer**
I have published a Youtube video for step by step solution for this question.
You can check at

{% youtube s2vLgDWYidw %}

{% tag kubernetes %} {% tag devops %} {% tag cka %} {% tag ckad %}
Simple solution for the recent Chrome emoji font weight issue 
Published: 2021-11-23 07:32:15

Recently, with the [Chrome v96 update](https://bugs.chromium.org/p/chromium/issues/detail?id=1266022), I've noticed that emojis on our [platform](https://askfinny.com) changed to colorless glyphs. Frankly, that was frustrating, because we want to give a freedom in actions to our editors who create a unique content, thus it became a necessity to find a quick and valid solution for the raised problem.

Occasionaly, soon we've found that the culprit is the `font-weight` property. More specifically, with the Chromium update bold text makes emojis to look like a plain glyhps. 

To solve the issue we need to change the `font-weight` of the text to `normal`, however we don't a have control over the portion of text inside the tag.

Hence, we need to do couple of steps:

1) Extract emojis from the text.

2) Wrap them into separate HTML tag with `font-weight: normal`, i.e 

```html
<span style="font-weight: normal !important">{emoji}</span>
```

3) replace all emojis within the text with the relative HTML tags created in step 2.

Here we done!

```javascript
import emojiRegex from 'emoji-regex';

function normalizeEmojis(content) {
  const regex = emojiRegex();

  return content.replace(regex, (char) => {
    return `<span style="font-weight: normal !important;">${char}</span>`;
  });
}
```


After you can use the normalized HTML content inside your application.

```jsx
<div
  className="font-bold text-center"
  dangerouslySetInnerHTML={{
    __html: normalizeEmojis(contentWithEmojis),
  }}
/>
```

Although, the parent `div` set to be bold, the emojis inside are colored!
EP14: Create Terraform Modules for Azure
Tags: azure, terraform, devops
Published: 2021-11-23 07:32:13

Watch the Episode on YouTube: https://youtu.be/o9KD7lLrQvg

In this Episode, I’ll show you how to create your first Terraform Module to use in Azure! We will walk-through, the standard terraform code and how to generalise it into a module. I’ll run through a demo to show you how to write code.
HTML tags | rt
Tags: html, tags, rt
Published: 2021-11-23 07:24:04

It is used to **specify the ruby text component of a ruby annotation**, providing pronunciation, translation, transliteration or explanation for East Asian typography.

The `<rt>` element must always be contained within a `<ruby>` element.

The end tag may be omitted if the `<rt>` element is immediately followed by an `<rt>` or `<rp>` element, or if there is no more content in the parent element.

- Type: *block*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt) | [Support](https://caniuse.com/mdn-html_elements_rt)
3 recent trends in low-code & year-end events you can't miss!
Tags: beginners, programming, webdev
Published: 2021-11-23 07:19:52

Low-code has steadily gained prominence among developers, showing that they appreciate low-code's visual builders that make complex use cases easier, with fewer lines of code.

If you're a tech enthusiast, here's why you should be jumping on the low-code bandwagon:

**3 recent trends in low-code**

**Robotic process automation (RPA)** - Low-code is now used to develop RPA elements that make it easy to build, deploy, and automate processes that are repetitive, high-volume, and rule-based.

**Internet of things (IoT)**: IoT apps are complex to build, as they need to manage data from devices like sensors, communication devices, cars, and more. Low-code helps developers seamlessly build applications that can sync reams of data into context-aware visuals for end users.

**Augmented reality (AR)**: Low-code has already enabled many device experience for users. And recent progress has made even multi-interaction feasible. Users can now interact with applications via AR, VR, and more.

If you love low-code, or are interested in knowing more about it, here are a few developer events you can check out:

* **OutSystems**: Outsystems is conducting an event for the developer community, to showcase their low-code platform, with feature-specific sessions, such as integration builders, plus discussions of various use cases. Click here to join: https://www.outsystems.com/nextstep/osdc/#

* **Zoho Creator**: Zoho Creator is hosting their virtual hackathon, inviting amateur and experienced developers to build apps on their low-code platform. They've made it even more attractive, with $10k in prize gift vouchers for the top 3 winners. Click here to register: https://www.zoho.com/creator/low-code-hackathon

**Conclusion**

With low-code solidifying its place as the future of software development, attending events for various platform providers helps to connect with like-minded developers and better understand the trends in this space.
Symbl.ai’s Hacktoberfest 2021: Thank you for participating!
Published: 2021-11-23 07:19:06



It was our pleasure participating in the Hacktoberfest for the first time and we were absolutely thrilled to see the participation from our fellow developers of Symbl.ai Community. 👩‍💻👨‍💻

It feels like we just announced [Symbl.ai’s Hacktoberfest](https://blog.symbl.ai/blog/hacktoberfest-with-symbl-ai-celebrate-open-source-for-a-chance-to-win-exclusive-prizes) a while back, but it has officially come to a close. 


⭐ **Some Amazing Stats** from our 3 repos that were a part of hacktoberfest: 


>
 [Symbl Agora](https://github.com/symblai/Symbl-powered-Agora-RTE-app/) - 32 contributions (12 issues + 20 PRs)
[Symbl Twilio](https://github.com/symblai/symbl-twilio-video-react) - 20 contributions (15 issues + 5 PRs)
 [Symbl Docs](https://github.com/symblai/symbl-docs/) - 15 contributions (6 issues + 9 PRs)



On behalf of me and my Symbl.ai team, we thank each and every one of you for your contributions in open source. Your involvement and enthusiasm blew us away, with participants ranging from school kids, professionals, community members to people completely new to our ecosystem. 
<br>
:trophy: We would also like to appreciate our **Top Contributors** during the Hacktoberfest. 
- [Vanshaj Poonia](https://github.com/VanshajPoonia)	
- [Asian Cat](https://github.com/AsianCat54x)	
- [atom19-i](https://github.com/atom19-i) 
- [Aman Bedi](https://github.com/amanbedi1) 
- [Sproff](https://github.com/Sproff)
- [Gayathri krishnaswamy](https://github.com/gayathri-krishnaswamy)

🚩 Huge shout out to our **Project Maintainers and stakeholders** from Symbl.ai Team: Vishal, Shivam, Akanksha, Rishabh, Marcelo, Vaibhav, Janhavi and Pema. 
<br>
⏳ We’re currently in the process of reviewing all submissions, and everyone who completed our Hacktoberfest challenge will receive a limited edition T-shirt, and stickers depending on the contribution level. 

✅ Participants who meet all the [requirements](https://github.com/symblai/symbl-docs/blob/develop/Contributing.md) will receive an email in the coming week with a swag form and shipping instructions. We appreciate your patience – they’re coming soon!

🤔 Anything you’d like to see at Symbl.ai’s Hacktoberfest next year? Let me know via email (akanksha.bhasin@symbl.ai).

:computer: Hacktoberfest is over, but you still can contribute to our repositories anytime. Read more about us on [Symbl.ai Docs](https://docs.symbl.ai/docs/) + [Open Source repos](https://github.com/symblai/).🚀
<br>

🌻 **Join our Symbl.ai community here**
>
🔗 Slack Group: https://bit.ly/symbldotai-slack
🔗 Twitter: [@SymblDev](https://twitter.com/SymblDev) and [@symbldotai](https://twitter.com/symbldotai)
🔗[Akanksha Bhasin’s Twitter](https://twitter.com/Akii_20)
 
<br>
Happy Hacking! 

Cheers,
Akanksha
30 días de CSS y HTML (Iniciando en Desarrollo Web)
Published: 2021-11-23 07:17:43

¡Hola Mundo!

Bienvenida/o al reto de #30diasdeCSS 👩🏽‍💻

### ¿Qué es?

Este reto consiste en realizar una tarea diaria durante 30 días consecutivos; esta tarea te permitirá probar tus habilidades, practicar o conocer más sobre **CSS3**

Aquí te dejo algunas demostraciones de lo que lograrás con el reto 😏

{% youtube gt0rHSt_f2o %}
{% youtube GtrFw2vCN6I %}

### ¡Quiero empezar!

Perfecto, en este [repo](https://github.com/melissahuertadev/Reto-30dias-CSS) podrás encontrar ideas/propuestas para cada reto diario, en realidad, el reto es <u>libre</u>, por lo que tú mism@ puedes elegir o personalizar cada tarea.

🤫 pss.. también podrás encontrar la solución en la rama `solucion`

### Inspo

Por si deseas más ideas, te comparto aquí 2 repositorios y un curso gratis de HTML y CSS. 😬

- Reto de #30diasdeCSS (en Portugues) de [Milena Carecho]( https://github.com/MilenaCarecho/30diasDeCSS)
- Reto de 30 días de HTML y CSS (en Inglés) de [Somanath Goudar](https://dev.to/somanathgoudar/30dayschallenge-30-days-extreme-html-css-challenge-50k1)
- Aprende HTML y CSS en 30 días (en Inglés) con [CoursesFree](https://coursesfree.org/course/30-days-to-learn-html-css-full-course-2/lessons/day-1-your-first-webpage-30-days-to-learn-html-css-5/)

---

Cuéntame como te fue 👩🏽‍💻