teleren/devto huggingface dataset:
Get Sizes of All S3 Buckets In AWS SSO Accounts With Python
Tags: aws, python, devops, s3
Published: 2023-03-10 09:13:11

Let's say you've been tasked to produce an excel document containing the sizes of all the s3 buckets in multiple AWS accounts. This is a tedious task and would take a lot of time.
I was in a similar situation but then I came up with a simple python script to do that. 

All the accounts were on SSO so it was simpler to achieve this having already [configured SSO](https://towardsthecloud.com/set-up-aws-cli-aws-sso).


This tutorial assumes that you have set up AWS SSO and have the necessary permissions to access the S3 buckets in the specified account. You may also need to install the boto3 library if it is not already installed on your system.

#### Initializing the boto3 client

The boto3 client is initialized first. A session is created for the SSO profile. 


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




#### Getting the list of all buckets in the account

Next, the list of all the buckets in the account are retrieved.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9464t8se8uzq28f0r8z.png)




#### Calculating the size of objects in each bucket

For each of the buckets listed above, the size of the objects in the bucket(GB) are calculated. The code reads the contents of the objects and calculates the size of each. A key error is raised for buckets that are empty since  there are no contents.
A dictionary of the buckets and their sizes is then created and returned.

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



#### Write to csv

A csv file named after the sso profile is then generated with the columns being the bucket name and the object size.


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

### Bringing it all together


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


To run this code you need to pass the sso profile as an argument. 
For example if your code file is s3_size.py and the sso profile is production, you execute it by entering the following command in the terminal 

```
python s3_size.py production
```
The internet's latest website: InputOutput.dev
Tags: showdev, webdev, design, frontend
Published: 2023-03-10 09:00:36

Hello, just wanted to share a project I'm working on.

Everyone should be able to use the internet to perform basic tasks without being bombarded with popups, compromising their privacy and security, or damaging the environment.

The goal for [inputoutput.dev](https://inputoutput.dev) is to be a repository of simple tools that just work without being annoying or causing harm.

Tools like unit converters, random number generators, that sort of thing.

Here's a list of some of the features:

- every tool is under 14kB in a single http request. *See [why your website should be under 14kB in size](https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/)*
- every tool works without JavaScript. *See [why your website should work without JavaScript](https://endtimes.dev/why-your-website-should-work-without-javascript/)*
- no tracking.
- nothing annoying.
- dark mode by default. *See [actually, dark mode can save the planet](https://endtimes.dev/actually-dark-mode-can-save-the-world/)*
- and many more!

I've written a more in depth description on the about page for [inputoutput.dev](https://inputoutput.dev/about/)

Let me know what you think or if there are any tools you'd like to have added.
Effortlessly Schedule Appointments with Google Calendar Integration on Your HTML Page
Tags: html, javascript, beginners, programming
Published: 2023-03-10 08:47:41

Do you find scheduling appointments to be a tedious task? Do you want to simplify the process and make it more efficient? If so, integrating Google Calendar with your HTML page can be a game-changer. In this post, we'll guide you through the steps to add Google Calendar to your HTML page with just a click of a button.

**Step 1: Create a Google Calendar Account**

If you don't already have a Google Calendar account, the first step is to create one. Go to the Google Calendar page and sign in with your Google account. Once you're logged in, you can create a new calendar by clicking the "Create" button.

**Step 2: Customize Your Calendar**

After creating your calendar, customize it according to your preferences. You can set the timezone, add events, and share the calendar with others.

**Step 3: Obtain the Google Calendar API Key**

To integrate Google Calendar with your HTML page, you need to obtain the Google Calendar API key. You can do this by creating a project in the Google Developer Console and enabling the Google Calendar API.

**Step 4: Add Google Calendar to Your HTML Page**

Now it's time to add Google Calendar to your HTML page. To do this, you'll need to use JavaScript to create a function that adds the calendar when the button is clicked. Here's an example of what the function might look like:

```
function addCalendar() {
  var calendarId = 'your-calendar-id-here';
  var apiKey = 'your-api-key-here';
  var script = document.createElement('script');
  script.setAttribute('src', 'https://www.googleapis.com/calendar/v3/calendars/' + calendarId + '/events?key=' + apiKey);
  document.head.appendChild(script);
}

```
Make sure to replace "`your-calendar-id-here`" and "`your-api-key-here`" with your own calendar ID and API key.

**Step 5: Add the Button to Your HTML Page**

```
<button onclick="addCalendar()">Schedule Appointment</button>
```

Finally, add a button element to your HTML page with an onclick attribute that calls the `addCalendar()` function. Here's an example of what the button might look like:
That's it! Now your users can easily schedule appointments by clicking the button on your HTML page.

In conclusion, integrating Google Calendar with your HTML page can simplify the process of scheduling appointments and make it more efficient. By following these simple steps, you can easily add Google Calendar to your HTML page and provide a better user experience for your customers. Happy learning!
Social Media Marketing for Logistics
Tags: socialmedia, market, logistics, webdev
Published: 2023-03-10 08:41:48

[Social Media Marketing for Logistics Transportation Trucking & Supply Chain Industry](https://paldigitalmedia.com/social-media-marketing-logistics-transportation-trucking-supply-chain-industry/
): We provide best Social Media Marketing for logistics transportation Trucking and Supply Chain Industry. SO if you are in search of Social Media Marketing for logistics company you are at the right place.
Distinguishing Websites and Web Apps for Better Performance
Tags: javascript, webdev, beginners, react
Published: 2023-03-10 08:40:21

I recently listened to an interesting podcast episode that highlighted the fact that only a small percentage of internet users browse the web using the newest devices. In fact, most people access the internet with relatively slow smartphones. Unfortunately, many developers ignore this fact when installing the next seemingly-super-useful npm package.

Web performance is a crucial factor that can determine the success or failure of a website or web application. While client-side libraries like React, which are commonly used on websites, are typically lightweight, the issue lies in the ecosystem that facilitates the easy incorporation of numerous dependencies into bundles. The potential for a large number of dependencies to be pulled into a project can significantly impact web performance, making it critical to carefully manage and monitor the dependencies to ensure optimal web performance.

While it may be tempting to incorporate the latest technology trends into website development, it is important to consider the specific needs of your project. For instance, if you are creating a blog featuring your favorite chicken recipes, you should think twice before sending JavaScript-heavy code to your users. In this case, users do not need extensive interactions, but they do expect quick content loading times. On the other hand, if your aim is to develop a service with multiple interactive elements (such as a SaaS application), longer initial load times may be acceptable, as long as further interactions with the app are speedy. This is where the difference between a website and a web app comes into play. A website is simply a collection of web pages that provide information, while a web app is a software application that runs in a web browser and provides an interactive user experience.

The priority should ultimately be meeting the needs of your target audience rather than blindly following the latest trends.

The good news is that the web-community appears to be increasingly conscious of these issues. For instance, NextJS provides excellent static-site generation capabilities, enabling developers to utilize the strengths of React while optimizing performance. Additionally, Remix prioritizes native browser functionality, delivering extensive functionality without relying on JavaScript.

To be clear, I do not advocate for completely eliminating JavaScript from websites. However, it is important for developers to put in the effort to understand what their users are really experiencing.
Appendix: SQL Syntax（6）
Tags: opengauss
Published: 2023-03-10 08:31:14

**DROP COLUMN ENCRYPTION KEY**
Deletes a CEK.

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


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

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

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

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

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

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

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

**EXECUTE**
Executes a prepared statement. Because a prepared statement exists only in the lifetime of the session, the prepared statement must be created earlier in the current session by using the PREPARE statement.

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

**EXECUTE DIRECT**
Executes an SQL statement on a specified node. Generally, the cluster automatically allocates an SQL statement to proper nodes. EXECUTE DIRECT is mainly used for database maintenance and testing.

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

**EXPLAIN**
Shows the execution plan of an SQL statement.

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

**FETCH**
Retrieves rows using a previously created cursor.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikkdbx8emudyt6idrrjr.png)
Normal Build Vs SSR Build
Tags: angular, react, javascript, build
Published: 2023-03-10 08:26:27

## Normal Build
Creating a normal build in front-end Application is useful for deploying the application to a web server or a content delivery network (CDN) where it can be accessed by users through a web browser.

A normal build in Angular creates a set of optimized static files, including JavaScript, HTML, and CSS, that can be served from a web server. These files are optimized for performance and include features like tree-shaking, ahead-of-time (AOT) compilation, and minification, which can reduce the size of the application and improve its load time.

There are several benefits to using a normal build in front-end Application:

Performance: Normal builds can be optimized for performance using features like tree-shaking, AOT compilation, and minification. This can help to reduce the size of the application and improve its load time.

Compatibility: Normal builds can be deployed to any web server or CDN that supports static file hosting, making it easy to distribute your application to a wide range of devices and platforms.

Security: Normal builds can be served over HTTPS, providing secure communication between the server and the browser.

Maintainability: Normal builds can be easily updated and deployed, allowing you to quickly make changes and improvements to your application.

In summary, creating a normal build in Angular is useful for deploying your application to a web server or CDN, and can provide benefits like improved performance, compatibility, security, and maintainability.


## SSR Build 

A front-end JavaScript framework that runs in the browser. When you first load an Angular application, the entire application is downloaded to the browser, including all the JavaScript, HTML, and CSS files. This can result in slow load times and a poor user experience, especially on slower internet connections or on mobile devices.

Server-side rendering (SSR) can help to improve the performance of   applications by pre-rendering the initial HTML on the server and sending it to the browser. This means that the user can see content more quickly and the application feels faster, even on slower connections.

There are several benefits to using SSR with Angular:

Faster load times: By rendering the initial HTML on the server, the user can see content more quickly, which can improve the user experience.

Better SEO: Search engines can crawl and index server-rendered pages more easily, which can improve the visibility of your application in search results.

Improved performance: By reducing the amount of work the browser needs to do to render the page, you can improve the performance of your application and reduce the load on the user's device.

Accessibility: Server-side rendering can make your application more accessible to users who rely on screen readers or other assistive technologies.

In summary, creating an SSR build in Angular can help to improve the performance and user experience of your application, and can make it more accessible and SEO-friendly.
What is Your Display Type?
Tags: tooling, webdev
Published: 2023-03-10 08:05:19

In today's digital age, we interact with various devices that offer us a wide range of display options. From mobile phones to laptops, tablets to desktops, the display technology has advanced to a great extent, offering a plethora of features to choose from. However, sometimes it can be challenging to identify the display type, resolution, color depth, and orientation of our devices, which can impact our viewing experience.

To solve this problem, a new online utility called "[What is my display type?](https://webutility.io/what-is-my-display-type)" has been developed on [Webutility.io](https://webutility.io/), which helps users identify their display specifications with just a click. This tool is a one-stop solution that offers quick and accurate information about your device's display type, resolution, color depth, and orientation.

With "What is my display type?" utility, you can quickly check whether your device uses an LCD, OLED, or AMOLED display. You can also learn about the resolution of your screen, whether it's HD, Full HD, or 4K. Furthermore, the tool can also identify the color depth of your display, indicating the number of colors your screen can produce. Lastly, it can tell you the orientation of your screen, whether it's in portrait or landscape mode.

The tool is user-friendly, and you don't need any technical knowledge to use it. All you have to do is click on the link and let the tool do the rest. The utility is designed to work on all devices, from mobile phones to desktops, and can be used on any web browser.

In conclusion, "What is my display type?" is an excellent utility that provides users with valuable information about their device's display. It's a quick and reliable tool that helps you make informed decisions about your viewing experience. With this utility, you can identify your display specifications, ensuring that you can take full advantage of your device's capabilities.
Appendix: SQL Syntax（3）
Tags: opengauss
Published: 2023-03-10 08:00:14

**ALTER USER**
Modifies the attributes of a database user.

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

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

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

**ALTER VIEW**
Modifies the auxiliary attributes of a view.

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

ANALYSE|ANALYZE
Collects statistics about ordinary tables in a database, and stores the results in the **PG_STATISTIC** system catalog. The execution plan generator uses these statistics to determine which one is the most effective execution plan.

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

**ANONYMOUS BLOCK**
Applies to a script that is infrequently executed or a one-off activity. It is executed in a session and is not stored.

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

**BEGIN**
Initiates an anonymous block or a single transaction.

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

**CALL**
Calls defined functions and stored procedures.

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

**CHECKPOINT**
A checkpoint is a point in the transaction log sequence at which all data files have been updated to reflect the information in the log. All data files will be flushed to a disk.

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

**CLEAN CONNECTION**
Clears database connections. You may use this statement to delete a specific user's connections to a specified database.

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

**CLOSE**
Frees the resources associated with an open cursor.

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

**CLUSTER**
Clusters a table based on an index.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/on60nskzdo20ijk0kwut.png)
How Do You Share Your Love for Coding with Friends and Family?
Tags: discuss, beginners, codenewbie
Published: 2023-03-10 08:00:00

For many of us, coding is not just a hobby or a profession, it's a passion. But how do you share that passion with the people in your lives who may not understand or have the same interests? Here are a few ideas for ways to introduce coding to your friends and family:

1. **Create something useful** - like a website for a friend’s business, perhaps.
2. **Share interesting tech news** - this is a great way to spark a conversation and get others interested in what you do.
3. **Teach them basic coding concepts** - HTML and CSS are accessible, and teaching your friends and family some basic concepts could be a fun way to spend time together…and gain a new skill!
4. **Participate in coding events** - get your loved ones to tag along and cheer you on! They get to see firsthand what it's like to be a coder and meet other people who share your passion.

How do you share your love for coding with your friends and family?
The Rise of Augmented Reality: How AR is Revolutionizing Industries
Published: 2023-03-10 07:43:53

******_Augmented Reality (AR) _**is a technology that has been gaining popularity in recent years. It has the ability to superimpose digital information onto the real world, creating an immersive and interactive experience. AR has been used in various industries such as gaming, education, healthcare, retail, and more. In this article, we will explore how AR is revolutionizing industries and changing the way we interact with the world.

_Gaming_
One of the earliest industries to adopt AR technology was gaming. AR games like Pokemon Go and Ingress have been incredibly successful, with millions of users playing the games worldwide. These games allow users to capture virtual creatures in the real world, creating an immersive and interactive experience. AR has also been used in traditional video games, allowing users to project the game into the real world and interact with it in new ways.

_Education_
AR has the potential to transform the way we learn. By overlaying digital information onto real-world objects, AR can create an immersive and interactive learning experience. For example, AR can be used to bring historical sites to life, allowing students to explore them in a new way. AR can also be used to teach complex concepts in science and math, allowing students to visualize and interact with the information in a more tangible way.

_Healthcare_
AR is also being used in the healthcare industry to improve patient outcomes. Surgeons can use AR to project images of a patient's anatomy onto the surgical site, providing real-time guidance and improving precision. AR can also be used to provide patients with virtual therapy sessions, allowing them to interact with virtual environments and objects to reduce pain and improve mobility.

_Retail_
AR is changing the way we shop. By overlaying digital information onto real-world objects, AR can provide users with an immersive and interactive shopping experience. For example, users can use AR to try on virtual clothes, see how furniture would look in their home, or even see how makeup would look on their face before purchasing. AR is also being used to create virtual showrooms, allowing customers to browse and purchase products in a virtual environment.

_Conclusion_
AR is a technology that has the potential to revolutionize industries and change the way we interact with the world. Its ability to overlay digital information onto the real world creates an immersive and interactive experience, allowing users to explore and interact with the world in new ways. As AR technology continues to evolve, we can expect to see it being adopted in more industries and used to create even more innovative and exciting experiences.