teleren/devto huggingface dataset:
[Summary] Chapter#08 "The Internals of PostgreSQL" Buffer Manager(Part-02)
Tags: postgres, apacheage, devcommunity, bitnine
Published: 2023-07-09 22:49:00

## Buffer Manager Locks:
**Buffer Table Locks**
BufMappingLock protect data integrity and buffer table and it is light weight lock that used in shared and exclusive modes, and it split into partitions to reduce contention in the buffer table.

**Lock for Each Buffer Descriptor**
It uses two light-weight locks.
**Content Locks**
This lock enforces access limits, and it can be used in shared and exclusive modes.
**io_in_progress_lock**
It is used to wait for I/O on a buffer to complete, process holds exclusive io_in_progress lock of the corresponding descriptor while accessing the storage.

## How the Buffer Manager Works
Backend process want to access a desired page, it calls the ReadBufferExtended function.

**Accessing a Page Stored in the Buffer Pool**
Buffer Manager performs the following steps:
- Create the buffer _tag of the desired page and compute the hash bucket slot.
- Aquire the BufMappingLock partition that covers the obtained has bucket slot in shared mode.
- Look up entry whose tag is Tag-C and obtain the buffer_id from the entry.
- Pin the buffer descriptor for buffer_id
- Release the BufMappingLock
- Access the buffer pool slot with buffer_id

**Page Replacement Algorithm: Clock Sweep**
This Algorithm is Not Frequently Used with low overhead and it selects less frequently used pages efficiently.

**Ring Buffer**
The ring buffer is a small and temporary buffer area, following list that should be satisfied a ring buffer is allocated to shared memory.
- Bulk Ringing
- Bulk Writing
- Vacuum Processing

**Flushing Dirty Pages**
It is used to store background writer process and replace victim pages. Both have same functions but different roles and behaviours.
when checkpointing starts, checkpoint process writes a checkpoint record to WAL segment file. 
Role of background writer is to reduce the influence of intensive writing of checkpointing. The background writer continues to flush dirty pages little by little with minimal impact on database activity.

[Reference](https://www.interdb.jp/pg/pgsql08.html)
Launch a Linux Virtual Machine Using Custom Template in Azure
Tags: customtemplate, linux, cloudcomputing, simplelinux
Published: 2023-07-09 22:26:54

Deploying a custom template in Azure involves automating the provisioning and configuration of Azure resources using Azure Resource Manager (ARM) templates. The desired state of your infrastructure, including the resources, their attributes, dependencies, and customizations, is defined by a custom template, which is a JSON file.
To deploy your own template, Azure provides a variety of deployment methods. You can use Azure REST API, Azure DevOps, Azure PowerShell, Azure CLI, or Azure Portal. The deployment strategy you choose will depend on your preferences and the level of automation needed.
You may automate the deployment of your infrastructure, guarantee consistency across environments, and provide version control for your infrastructure-as-code by deploying a custom template on Azure. It simplifies the creation and management of Azure resources, increasing productivity and reducing the potential for human error.
In this blog post, we will explore how custom template in Azure Resource Manager (ARM) can be configured to spin up a Linux virtual machine through Ubuntu Terminal.

#Steps to create a Custom Template and deploy using Ubuntu Terminal in Azure#

Search for deploy a custom template in Azure resource page
Click on Create a Linux Virtual Machine (VM) and select Quickstart template in the Template Source

![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0rf66tu6txfvhnlgjyv.JPG)
#Steps to modify the template to customize it according to your requirements#

![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfr5l6lncnv06dtvnzsz.JPG)
Click on create new and enter the resource group name
Select the desired region
Edit the VM Name
Enter the admin Username
Select the authentication type password or SSH
Click on Review and create
![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9cxuboceb7t3m1vy6xg.JPG)
After validation, click creates to initiate the deployment.
![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4bflagdu84gsa828k3t.JPG)
Deployment is complete
Click on Go to Resources
![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jbj5zgmum4k55niojti.JPG)
Click on “SimpleLinux VM”
![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3w7b2gatd79xd2xpp6o.JPG)
Click on the connect button at the top bar of the overview page 
!Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ncd7go920qbayu18puzf.JPG)
To connect to the Linux VM, input the command SSh <your Username@IPaddress> in the Ubuntu terminal and press enter.

![Linux VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3u69iqc51ksejzgaw8i7.JPG)
To copy your IP address, go to the overview page
Lunch the Ubuntu terminal and input the command SSh <your Usename@IP address> as shown below. Click enter
Input your password and press enter
The Linux VM is launched 
![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfnsw8pw1khpf74p6rf7.JPG)
AWS IAM Roles with AWS CloudFormation
Tags: aws, cloud, devops, cloudformation
Published: 2023-07-09 22:20:18

If you are starting with CloudFormation and IAM Roles, I wrote an introductory article on the AWS Fundamentals blog:

https://blog.awsfundamentals.com/aws-iam-roles-with-aws-cloudformation

If you enjoyed this post & you want to get 𝗯𝗶𝘁𝗲-𝘀𝗶𝘇𝗲𝗱 𝗔𝗪𝗦 𝗰𝗼𝗻𝘁𝗲𝗻𝘁 straight to your inbox, feel free to check out our bi-weekly newsletter 📨

You can also browse our 𝗽𝗿𝗲𝘃𝗶𝗼𝘂𝘀 𝗶𝘀𝘀𝘂𝗲𝘀 to see what you'll subscribe to 📚

https://newsletter.awsfundamentals.com/
Phase 1
Tags: javascript, beginners
Published: 2023-07-09 22:13:47

My Phase One project (Formula 1) at Flatiron School was a challenging yet rewarding experience. I gained valuable knowledge in JavaScript, Node.js, DOM manipulation, and HTML. Throughout the phase, I faced difficulties understanding DOM manipulation terminology but managed to incorporate it into my code. Here's an example:

![Javascript code ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zihitz816fmr5jrncvko.png)

In the first image, I declared a variable searchInput using const. I used document.getElementById('searchInput') to select an element with a unique ID from the DOM.

![HTML code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnqj8ccj8tspzebyz991.png)

In the second image, I showed an HTML code snippet with elements assigned unique IDs. These IDs enable specific element selection and manipulation. The document.getElementById() method is commonly used for this purpose. For instance:

```javascript
const racersContainer = document.getElementById('racersContainer');
```

When working with the DOM in JavaScript, these IDs can be utilized to select and manipulate specific elements. The document.getElementById() method is commonly used for this purpose. For example, to select the element with the ID "racersContainer," you would use the following code:

```javascript
const racersContainer = document.getElementById('racersContainer');
```

This code assigns the element with the ID "racersContainer" to the variable racersContainer, allowing you to perform various operations on it.

This code assigns the element with the ID "racersContainer" to the variable racersContainer, allowing various operations on it.

I also encountered challenges distinguishing between document.querySelectorAll() and document.querySelector(). Here's a brief explanation:

- document.querySelectorAll(): This method returns a list of all the elements in the document that match a specific CSS selector. It returns a NodeList, which is similar to an array and allows you to access and iterate over the selected elements. For example:

```javascript
const elements = document.querySelectorAll('.myClass');
```

In this example, all elements with the class "myClass" will be selected and stored in the elements variable.

- document.querySelector(): This method returns the first element that matches a specific CSS selector. It returns a single element, even if there are multiple elements that match the selector. For example:

```javascript
const element = document.querySelector('#myElement');
```

In this example, the first element with the ID "myElement" will be selected and stored in the element variable.

In summary, document.querySelectorAll() selects multiple elements based on a CSS selector, returning a NodeList, while document.querySelector() selects the first element that matches a CSS selector and returns a single element.

For more information about the DOM visit: 
https://www.w3schools.com/jsref/dom_obj_document.asp
[Summary] Chapter#08 "The Internals of PostgreSQL" Buffer Manager (Part-01)
Tags: postgres, apacheage, devcommunity, bitnine
Published: 2023-07-09 21:32:49

Bugger manager manage data transferred between shared memory and persistent storage and PostgreSQL buffer manager works very efficiently.

**Buffer Manager Structure**
It comprises a buffer table, buffer descriptors and buffer pool, while buffer pool layers stores data file pages such as table and indexes and freespace maps and visibility maps. It is an array and stores one page of data file and it referred to buffer_id.
It is Comprise of three layer Structure
**Buffer Pool**
It is an array, each slot stores a data files pages and the indices of the array slots are referred to as buffer_ids.
**Buffer Descriptors**
It is layer in array, every descriptor has one-to-one buffer pool slot and holds metadata of the stored page in corresponding slot.
**Buffer Table**
It stores relations between buffer_tags of stored pages and buffer_ids of the descriptors.

**Buffer Tag**
In PostgreSQL, each page of all data files assigned a unique tag.
Buffer tag comprise of three values:
RelFileNode and fork number to which its page belong, and the block number of its page. 

**How a Backend Process Reads Pages**
- Backend process send request that includes page's buffer_tag to buffer manager.
- Buffer Manager return buffer_ID of the slot that stores the requested Page and if it is not present in buffer pool, buffer manager loads the page from persistent storage and return buffer_ID.
- The backend process accesses the buffer_ID slot.

**Page Replacement Algorithm**
Page selection algorithm is called page replacement algorithm and selected page is victim page. Buffer manager select one page in buffer pool that will be replaced by requested page in case of page not stored.

**Flushing Dirty pages**
Buffer manager requires help to perform this task and In PostgreSQL two background processes checkpointer and background writer are responsible for task.

**Buffer Table**
It is divided into three parts:
- Hash Function
- Hash Bucket Slots
- Data Entries

**Buffer Descriptor**
It holds metadata of stored page in corresponding buffer pool, and descriptor structure is defined by structure BufferDesc. 
Some fields are defined following:
**Tag** holds buffer_tag of the stored page in the corresponding buffer pool slot.
**Buffer_id** identifies descriptor
**Refcount** holds number of postgreSQL process accesses the stored page.
**Usage_count** holds number of times associated stored pages accessed since load.
**Content_lock** and **io_in_progress_lock** that are used to control access.
**Flags** can hold several states of the associated stored page.
**FreeNext** is a pointer to the next descriptor to generate freelist.

[Reference](https://www.interdb.jp/pg/pgsql08.html)
Connect your latest wagmi + viem with ethersjs to use ethers provider, signer with wagmi
Tags: web3, ethereum, nextjs, react
Published: 2023-07-09 21:01:28

{% embed https://youtu.be/YNsuJT5orgU %}

Highlights
🚀 Learn how to connect metaMask wallet with Wagmi using Ethers.js
🎯 Resolve issues faced while using Wagami + Ethers combination
📱 Connect your Metamask wallet with Wagmi application
🚪 Log in and log out functionality with console logging of signer
⚙️ Create a provider and configure the chain for Wagmi
🔗 Use connectors like Metamask or WalletConnect
✍️ Provide signature functionality for various tools using Ethers.js

In this exciting video, we explore the integration of wagmi and Viem with ethers.js, enabling seamless interaction with the Ethereum blockchain. Join us as we dive into the world of Web3 development and learn how to leverage the power of ethers.js to connect to an Ethereum provider and utilize signers for secure transactions.

🚀 Discover the possibilities of wagmi, the innovative decentralized application framework, combined with Viem, a powerful user interface library. With this dynamic duo, you'll be equipped to create remarkable decentralized applications on the Ethereum network.

🔗 Whether you're a seasoned developer or a newcomer to the world of Ethereum, this tutorial provides step-by-step guidance on setting up your development environment, integrating wagmi, Viem, and ethers.js, and implementing essential functionality using Ethereum providers and signers.

💡 Don't miss out on this opportunity to level up your Ethereum development skills and unlock the potential of Web3. Join us as we bridge the gap between wagmi, Viem, and ethers.js, and empower your applications with the full capabilities of the Ethereum ecosystem.

🔔 Stay tuned, hit that notification bell, and be the first to watch this informative video. Like, share, and subscribe to our channel to stay updated with the latest Ethereum development content. Let's wagmi together in the world of Ethereum Web3!
The Best 13 ChatGPT Prompts for Web Developers.
Tags: ai, webdev, chatgpt, aiprompts
Published: 2023-07-09 18:54:00

🌐 Calling All Web Developers: Unlock the Power of AI-Powered Coding! 🚀💻

!NOTE : POST LINK BELOW

Are you a web developer seeking innovative ways to enhance your coding prowess? Look no further! We're thrilled to present our latest blog post, "The Best 13 ChatGPT AI Prompts for Web Developers." 🤖✨

🔥 Explore the possibilities with our handpicked collection of AI prompts designed to revolutionize your web development journey. From streamlining workflows to conquering coding challenges, these prompts will ignite your creativity and propel your projects to new heights. 💡💪

📚 In this comprehensive blog post, we delve into the fascinating world of AI-powered web development. Discover how ChatGPT AI can become your indispensable companion, offering invaluable insights, problem-solving capabilities, and limitless inspiration. 🌐✨

You will learn:
✅ Fresh perspectives on tackling complex coding conundrums.
✅ Time-saving techniques to optimize your development process.
✅ Cutting-edge ideas to transform your web projects into masterpieces.

Ready to embark on a coding adventure like no other? Click here to read the full blog post: [Insert Blog Post Link]

🌟 Join a vibrant community of web developers who are harnessing the power of AI to reshape the digital landscape. Share this post with your fellow coding enthusiasts, tag your developer friends, and let's inspire each other to achieve greatness. 💼👥

🔓 Unleash your coding potential and unlock a world of possibilities today! Don't miss out on this game-changing resource. 💻💡

#WebDevelopment #AIProgramming #CodingTips #DeveloperCommunity #ChatGPTAI #WebDevInsights #AIRevolution

👉 We're eager to hear your thoughts! Visit our blog, leave a comment, and let us know which AI prompt resonates with you the most. Join the conversation and become a part of the AI-powered web development movement! 💬✨

[builtbybuilder.com/blog/best-13-chatgpt-prompts](https://www.builtbybuilder.com/blog/best-13-chatgpt-prompts)

#AI #WebDevelopment #Coding #Developers #BlogPost #Tech #AIPrompts #ChatGPTAI
How to add a custom font to a Rails app
Tags: rails, webdev, css, tutorial
Published: 2023-07-09 18:14:05

First you need to create the folder `app/assets/fonts` if it doesn’t exist yet: this is the default directory for font assets in Rails.

Then download the font file from GitHub. For example Inter is a great choice and it is already used by many sites and by Tailwind UI. Move the file (e.g. `Inter-roman.var.woff2`) in the fonts directory.

Now you can use the font like a normal asset of the asset pipeline: for example you can use the helpers like `asset_path` and `font_url` to refer to it.

In order to use the font in the CSS you need a font face declaration:

```
@font-face {
  font-family: 'Inter var';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: font-url('Inter-roman.var.woff2') format('woff2');
  font-named-instance: 'Regular';
}
```

Note the use of the `font-url` helper, which is available in SASS files.

Finally you can use your font:

```
body {
  font-family: 'Inter var', sans-serif;
}
```

You can also speed up the loading of the font and avoid the page glitch while the font is loading using `<link rel="preload">`. Add this code to the `<head>` section of the application layout:

```
<%= preload_link_tag 'Inter-roman.var.woff2' %>
```

*Originally posted on [AbstractBrain Answers](https://answers.abstractbrain.com/how-to-add-a-custom-font-to-a-rails-app/)*
Avoid shared state on the server in SvelteKit - Be extra cautious when using stores in SSR mode
Tags: sveltekit, state, ssr, stores
Published: 2023-07-09 17:39:58

State management is a crucial part when working with complex web applications. Svelte does provide us with elegant native stores that can be used in such scenarios. However, we must be cautious while using them otherwise our application may result in unwanted behavior and could produce bugs that are difficult to trace and fix!

One such example is using stores in the backend i.e. in the SSR flow. This article will focus on a few edge cases where we must be extremely cautious in the way we use stores or rather state management in general.

### What is the problem?

**Using stores in the backend (SSR mode) causes data leaks between clients.**

**But Why?**

Servers are stateless i.e. one common space on the server is shared by multiple clients (users). In other words, the state on Server is global by default that will be shared by all of its clients. The servers are often long-lived and shared by multiple users. For that reason, it's important not to store data in shared variables. For example, consider the following scenario:

![Arch](https://cdn.hashnode.com/res/hashnode/image/upload/v1688891933795/8861edca-c071-469d-9e2e-df40f070168e.png)

Multiple users have been logged into the system and they are interacting with a common application server. Now each user interacts with the server, independently, via the browser. **A store is contextual to each instance of your app**. This essentially means that the state on the client side is always stateful. If we save any store value on the client side for a particular user, it will remain local to that user and will not be shared with other users.

On the other hand, the state of the server is shared with all the users simultaneously and hence if user "A" updates the store value, that will be reflected on user "B" as well, thus leaking data! In addition, when user "A" returns to the site later in the day, the server may have restarted, losing their data. **The main thing to understand is that as soon as you create a store, it becomes global server-side in an SSR context (= your store is a singleton in memory server-side, so it is shared by all HTTP requests hitting your server).**

### How to fix this problem?

Read rest of the article on my [blogging site](https://blog.aakashgoplani.in/avoid-shared-state-on-the-server-in-sveltekit)
CURL
Published: 2023-07-09 17:33:45

<u>**_CURL_**
</u>
Command Line Utility
Used to retreive a URL from WEB using HTTP or HTTPS

<u>**_Installation_** 
</u>
sudo apt-get install curl

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

**_<u>About Curl </u>_**

Eg.,

curl https://www.onlinesbi.sbi/  -->  It provides the complete HTML page of the website.

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

_<u>Now going to output the file from the curl command,</u>_

curl https://www.onlinesbi.sbi -o sbi.html

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

_<u>Common Option is : COOKIES</u>_

curl https://www.onlinesbi.sbi -c sbicookies.html

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6tgs42ndidzy6ndzxy6.png)
This will have cookie information ...
How we can pass the information back to the site using -b and -c ? TBD

_<u>Below one , also TBD</u>_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51mkrqhhyk5y07tonl3q.png)

_<u>POST REQUEST :</u>_

curl -d "output=json" <url>

_<u>How to check the certificate ?</u>_

curl -k <url>  -->  Use this -k which is insecure to bypass the HTTPS certificate. 

_<u>How to pass username and password to a URL ?</u>_

curl -u name:password <url>

_<u>CUSTOM HEADER :</u>_

curl -H "Content-Type: application/json" <url>



**_<u>Important Notes :
</u>_**
1. File name should not have any '_' like sbi_html.html --> we are unable to execute these costume name.
2. curl -h or man curl  -->  Library
DriverFix Pro 4.2021.8.30 Crack With License Key Free Download 2023
Tags: webdev, softwareengineering
Published: 2023-07-09 17:30:10

https://autocracking.com/driverfix-pro-crack/
It is a famous program that is useful in fixing drivers. Moreover, it gives you automatic downloads and updates of drivers also. Without a doubt, it gives you the latest driver for your pc. In the same way, users can enjoy a healthy system all the time. Further, it has the facility to find and add various versions to the computer. On the other hand, it supports computer drivers in the best way
Basic linux commands
Published: 2023-07-09 17:11:06

ls - list storage

pwd - present working directory

cd - change directory

file - to know file type

locate - locate the file

which - command to find a command

history - history of commands

whatis - to get what command does

appropos - command to get info about command what it does

man - manual page

mkdir - create a directory

touch - create a empty file / update date on a file

cp - createa copy of file / edit a file without removing

mv - move a file / rename a file

rm -r direct_name ->remove a directory

rmdir - remove a directory if it contains nothing

cat - concatenate

sudo - super user do

chmod - change a mode

users - who are logged into system

killall - kill a process

chsh - change shell

env - environmental variable

lscpu - cpu information

lshw - hardware information