teleren/devto huggingface dataset:
gookit/slog - release v0.5.2, Lightweight, configurable, extensible logging library
Tags: programming, go, github, tooling
Published: 2023-06-20 08:10:20


`gookit/slog` 📑 Lightweight, configurable, extensible logging library written in Go.
Support multi level, multi outputs and built-in multi file logger, buffers, clean, rotate-file handling.

<!--truncate-->

> Github https://github.com/gookit/slog

## v0.5.2 changelog

**Full changelog**: https://github.com/gookit/slog/compare/v0.5.1...v0.5.2

### Feature

- ✨ feat: Add new option FilePerm to customize the permission on log file creation. issues #102 https://github.com/gookit/slog/commit/699ecd8bc2dea0fb35607ba89d4299e86f96e40b
- ✨ feat: rotatefile - Added new option `ModeCreate` to support creating log files at rotation time. https://github.com/gookit/slog/commit/8c4a9a08a9b3432a699f6770b73935ecfd42e5b8

### Update

- 👔 up: Update and add more unit tests, upgrade goutil to v0.6.10 https://github.com/gookit/slog/commit/693cc04eb0e375183357be18893cbecaa171ffa1
- 📝 doc: Update README document description https://github.com/gookit/slog/commit/cbf77c38db5615a9a7ec8ab07853b2f9e3517bfa
- ✅ test: Add more unit test cases https://github.com/gookit/slog/commit/8468ea470645bb981fb34002176671bac1a9559e

## New feature usage

### Custom log file permissions

The log file permission flag created by configuring the `FilePerm` setting of `hander.Config`.

```go
h1 := handler.MustFileHandler("/tmp/error.log",
    handler.WithLogLevels(slog.DangerLevels),
    handler.WithFilePerm(0644), // <- sets log file permissions
)

slog.PushHandler(h1)

```

### Split files using ModeCreate mode

about `RotateMode`:

- ModeRename By default, every time rename handles rotation.
- ModeCreate Create files only by split time


Setting `RotateMode=ModeCreate` allows log files to be created only by split time.

```go
h1 := handler.MustRotateFile(
    "/tmp/error.log",
    rotatefile.EveryHour, // split by hour
    handler.WithLogLevels(slog.DangerLevels),
    handler.WithRotateMode(rotatefile.ModeCreate), // set RotateMode=ModeCreate
)

slog.PushHandler(h1)
```

Configure the logfile as `/tmp/error.log` in the above example. When set to `ModeCreate` mode, the file will not actually be created,
Instead, it will be created according to the actual split time:

```bash
/tmp/error.log.20230618_1500
/tmp/error.log.20230618_1600
/tmp/error.log.20230618_1700
...
```

> **Tips**: The `ModeCreate` mode can be applied to command-line tool applications. Because they exit after each execution, `ModeRename` may not be able to split files on time.


And using `ModeRename` mode will have the following effect:

```bash
/tmp/error.log # <- Logs are always written to this file
/tmp/error.log.20230618_1500
/tmp/error.log.20230618_1600
/tmp/error.log.20230618_1700
...
```

---


## More usage

More usage please see [README](https://github.com/gookit/slog/blob/master/README.md)
GCP Cloud Function 2nd Gen CLI For A Compatible Ingress Cloud Shell In Variant Web App
Tags: cloudfunction
Published: 2023-06-20 07:52:52

1.
GCP Region/Zones Extraneous CLI For Downward Function With Parallel Kubernetes Pod:
`gcloud enable googleapis 
artifactregistry.googleapis.com
pubsub.googleapis.com - 1
`
export REGION=us-east4
gcloud config set compute/region $REGION
2.
Now,Let us populate Cloud Storage Javascript function With Ingress Audit Logs-

Python CLI:
`gcloud enable googleapis 
artifactregistry.googleapis.com
- Node.js 2
`

import os
color = os.environ.get('COLOR')- (Artifact Registry JSON Function With Ingress Python Function Only For One HTTP Port Node Instance)
def hello_world(request):
    return f'<body style="background-color:{color}"><h1>Hello World!</h1></body>'

Kotlin/Java 11/Javascript CLI:

`gcloud enable googleapis 
artifactregistry.googleapis.com
pubsub.googleapis.com
 - Node.js 3
(Cold Restarts Node From Public Subscription Javascript Topic To Kotlin CLI)
`

Squeezed IntelliJ IDEA Ultimate IDE Coroutine From GCP 
const qj = require('google-cloud/functions-framework');
qj.http('req/res',(req,res)=>{
  res.status(200).send('HTTP function (2nd gen) has been called!');
});)
data class tp(val qw:Int,var qw2:Int)

fun main()
{
  IntelliJ IDEA Kotlin Function 1 (Extraneous CLI For Multiple Warm Instance In Similar Methods For Cold Node Run Analysis For AI/ML,Web App)

val tq = qj.set()  - Here We have to find out if Google Cloud Run function can be originated for similar Cold restarted nodes function(Point 1 Described Above) 

}
Exam Labs Dumps: Your Key to Acing Any Exam
Tags: javascript, tutorial, python
Published: 2023-06-20 07:51:11

**How Much Does Exam Labs Dumps Cost?**
One of the best things about Exam Labs Dumps is that they are affordable, making it easier for you to prepare effectively without breaking the bank. The cost of <a href="https://examlabsdumps.com/">Exam Labs Dumps</a> varies depending on the exam you are preparing for and the package that you choose. Generally, Exam Labs Dumps packages range from $30 to $100. However, keep in mind that paying more doesn't necessarily mean getting better results. It's always important to choose a package based on your specific needs and budget.

Moreover, some packages may offer additional features such as access to online practice tests or study guides which can be helpful in boosting your chances of passing your exam.

Click Here to Get Free Updates >>>>> https://examlabsdumps.com/
Python 📸 image manipulation
Tags: python, programming, deeplearning, computervision
Published: 2023-06-20 07:35:42

Image manipulation is a key technique in computer vision.This helps to better prepare our data for training .

In this short tutorial we would highlight various technique required for image  manipulation

- Load Image 

`
import skimage.io as io #for input output manipulations on the image
import matplotlib.pyplot as plt
import numpy as np



#you can download any color image from google.com to use for this lab


# Read the image
img = io.imread('/content/Screenshot 2023-05-05 at 09.45.04.png')

plt.imshow(img)
plt.show()


`

- Image shape

`
img.shape
(675, 1272,3)
`
The 3 means it contains three layer RGB(Red,Green and blue) all layered on each other.


- Slipt layers in different section 

`
# Split
red = img[:, :, 0] 
green = img[:, :, 1] 
blue = img[:, :, 2]   
`

- Preview Split layers based on color

`
plt.imshow(red, cmap="Reds")
plt.show()

============================================
plt.imshow(green, cmap="Greens")
plt.show()

============================================

plt.imshow(blue, cmap="Blues")
plt.show()

`

Image Transformation
Using tensorflow you can run image argumentation to create muitiple variation of the same image 
`
#Rotation

import tensorflow as tf
transformation = tf.keras.preprocessing.image.apply_affine_transform(
img,
theta=270
)
plt.imshow(transformation)

#Ship image 

import tensorflow as tf
transformation = tf.keras.preprocessing.image.apply_affine_transform(
img,
tx=500,
ty=500,
)
plt.imshow(transformation)
`
Thanks for reading
Fleetbase, the open source modular logistics platform
Tags: product, opensource, productivity, aws
Published: 2023-06-20 07:29:03

Introducing Fleetbase: an open-source, modular platform for logistics. 

Our Alpha release rolls out core extensions - FleetOps, Storefront, and the Developer Console. 

We're building to become the definitive on-premise solution for logistics. Join us in reshaping logistics tech together.

We're happy to announce we have just launched our Alpha release on Product Hunt!

https://www.producthunt.com/posts/fleetbase-alpha
PlugXR
Tags: augmentedreality, virtualreality, mixedreality, threejs
Published: 2023-06-20 07:25:16

The PlugXR Discord (https://discord.com/invite/2HkzWrRMAD) team is looking for passionate individuals who would be interested in becoming Champions of our dynamic Discord community, driving vibrant discussions, share their knowledge and interests into the wider Web3 and XR space enabled by PlugXR.

Kindly fill the form shared below. 
https://forms.gle/MVXzLMwz69b1w97HA

or

Reach me at raju@plugxr.com
Flutter KeyStorage discussion
Tags: flutter, cybersecurity, discuss, mobile
Published: 2023-06-20 07:25:06

How do you prefer to secure data in Flutter apps? We're diving into software-backed vs. hardware-backed keystore solutions, discussing benefits, vulnerabilities, and seeking community insights. Join the conversation!

{% embed https://medium.com/@talsec/safely-storing-data-what-flutter-can-do-87cf5f8632da %}
Adaptive preprocessing in Python and OpenCV for OCR
Tags: beginners, opencv, coding, help
Published: 2023-06-20 06:54:42

I am currently working on a project in Python that involves using OpenCV for preprocessing user-taken images before passing them to an OCR (Optical Character Recognition) system. These images may have varying quality issues, such as poor lighting and other similar problems.

As a beginner in image processing, I would like to implement an adaptive preprocessing approach, where the preprocessing techniques employed would dynamically adjust based on the specific characteristics of each image. For example, if an image exhibits low brightness or high levels of noise, I would like to apply specific adjustments or filters accordingly.

I am wondering if there are any established techniques or best practices in Python and OpenCV that could help me achieve this adaptive preprocessing functionality. Are there any libraries or functions specifically designed for handling such scenarios? Additionally, any insights or suggestions on the overall approach would be greatly appreciated, as well as academic articles or books suggestions.

For now I am using: 
-Adaptive Gaussian Thresholding
-Median Blur
-Noise removal
Probably I am gonna add something to sharpen the image.
It seems that it is not improving the quality of the data taken by the OCR.

Thank you in advance for any guidance you can provide!
Do I Really Have to Math? Can You Navigate the Tech World without Numbers?
Tags: discuss, beginners, codenewbie
Published: 2023-06-20 07:00:00

Here's a question that often comes up among beginners in the tech industry: do you need to have strong mathematical skills to thrive, or is it possible to excel without them? Some argue that a solid foundation in math is crucial for solving complex programming problems. On the other hand, there are developers who have succeeded without extensive math knowledge.

What are your thoughts and experiences with this? Have you found math to be a vital component in your programming journey, or have you been able to navigate the industry without it? 
---
Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
📛 Improving a GitHub Repo (II)!
Tags: community, github, git, productivity
Published: 2023-06-20 20:46:44

---
title: 📛 Improving a GitHub Repo (II)!
published: true
date: 2023-06-20 07:00:00 UTC
tags: Community,GitHub,git,productivity
canonical_url: http://blog.jromanmartin.io/2023/06/20/Improving-a-gh-repository-ii.html
---

My first post of [📛 Improving a GitHub Repo](https://blog.jromanmartin.io/2023/06/12/Improving-a-gh-repository.html) describes many good things to add in any GitHub repository to be more productive and professional. However, that stuff can be hard to do every time a new repository is created, and we can forget to add something great. I found a way to accelerate this process and also do not forget to add anything great: [GitHub Repository templates](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository).

GitHub template repository is the best way to replicate an standard structure, including folders, documentation, workflows, branches, and any file required to set up a new project. Using this pattern we can homogenize the structure of any repository of your organization, or also your own projects, easily and saving a lot of time. If you need to standardize your projects, or you need to create many projects on demand, definitely a template repository is your tool.

As summary, the most great benefits of using repository template I found are:

- ⌛ Spend less time repeating code
- 🌟 Focus on building new things
- 🦾 Less manual configuration
- 📝 Sharing boilerplate code across the code base

And, the main features of a repository template are:

- Copy the entire repository files to a brand new repository
- Every template has a new url endpoint called `/generate`
- Share repository template through your organization or other GitHub users

## My own repository template

I create mw own GitHub Template repository in here: [https://github.com/rmarting/gh-repo-template](https://github.com/rmarting/gh-repo-template) including all the things described in my previous [post](https://blog.jromanmartin.io/2023/06/12/Improving-a-gh-repository.html), or new things added along the time.

My template repository includes things such as:

- Initial content files aligned with the common patterns in any Open Source project: Contribution guide, Code of Conduct, contributors, …
- GitHub templates to report issues or open Pull Requests.
- Standard badges to summarize the repository.
- Standard workflows to release versions, or to implement Continuous Integration pipelines

So, creating a new repository and setting up it takes few seconds and steps. Amazing!!!

Do you have ideas, or comments about how to improve a template repository? Looking forward to hearing you with more contributions into my template repo, or adding comments in this post.

🤖🚩 Happy creation of new projects!!! 🤖🚩

[![](http://blog.jromanmartin.io/images/bitmoji/happy-coding.avif "Happy coding!!!")](http://blog.jromanmartin.io/images/bitmoji/happy-coding.avif)
Rubyist Hangout Thread
Tags: discuss, ruby, watercooler
Published: 2023-06-20 07:00:00

Hey folks, this is a new weekly hangout thread.

This is an area for **Rubyists to discuss _Ruby_**, but since Ruby is 28 years old, and things don't change so quickly, this is also just **a hangout thread for Rubyists to share whatever you feel like** within our community guidelines.

So what's up this week?
What Global Problem Would Your Tech Solution Solve?
Tags: discuss
Published: 2023-06-20 07:00:00

If you had the ability to create a game-changing technology that addresses one of the world's most pressing issues, which problem would you choose, and how would your envisioned technology make a lasting impact on society?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}

[Image by pch.vector on Freepik](https://www.freepik.com/author/pch-vector)
Caption This! 🤔💭
Tags: watercooler
Published: 2023-06-20 07:00:00

Weird pic. No context. What's happening here? 

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

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Introducing my New Portfolio!
Tags: webdev, nextjs, tailwindcss, portfolio
Published: 2023-06-20 06:58:06

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

I'm thrilled to share that I've just launched my brand new portfolio website, built from scratch using Next.js, React, and Tailwind CSS! 🎉

🔗 Check it out here: [viditkushwaha.live](https://viditkushwaha.live)

This portfolio represents the culmination of countless hours of hard work, creativity, and a passion for web development. I've drawn inspiration from the incredible Brittany Chiang and incorporated some elements from her portfolio design.

Key Features of my Portfolio:

✅ Client-side rendering for fast and seamless user experience
✅ Utilizes the power of Next.js to optimize performance
✅ Stunning UI design created with Tailwind CSS
✅ Fully responsive layout for a seamless mobile experience
✅ Integrated Google Analytics for comprehensive website analytics

I have incorporated Google Analytics into my portfolio to gain valuable insights into user behavior, traffic sources, and engagement. This allows me to continuously refine and enhance the user experience.

In addition, I'm excited to share that in the future, I will be adding a Progressive Web App (PWA) to my portfolio. By implementing a service worker, I'll enable offline functionality, faster loading times, and an enhanced user experience.

I'd like to extend a special thanks to the open-source community for their incredible contributions. My portfolio is deployed on DigitalOcean, ensuring reliability and scalability.

🔗 GitHub Repo: [Vidit-Kushwaha/v2.portfolio](https://github.com/Vidit-Kushwaha/v2.portfolio)

Feel free to explore the codebase on GitHub and provide any feedback or suggestions. Your input is highly valued!

I'm excited to connect with professionals, recruiters, and fellow developers. Let's collaborate and create amazing projects together. Reach out to me for any opportunities or just to say hello!

You can also find me on social media platforms. Feel free to connect with me and stay updated on my latest projects and endeavors:

🔗 LinkedIn: [Vidit Kushwaha](https://www.linkedin.com/in/vidit9011/)

Feel free to connect with me on LinkedIn. I'm always open to networking and exploring new opportunities. Let's connect and grow together!

Thank you for your support and for checking out my new portfolio. I'm looking forward to connecting with all of you!
Dotnet authentication clock skew.
Tags: webdev, dotnet, auth, discuss
Published: 2023-06-20 06:39:12

If you use dotnet JWT authentication check your `TokenValidationParameters`, and make sure you have set `ClockSkew` to reasonable values. By default, it is set to 300 seconds (5 minutes). That make your JWT tokens valid for extra 5 minutes.

```csharp
/// <summary>
        /// Gets or sets the clock skew to apply when validating a time.
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException">If 'value' is less than 0.</exception>
        /// The default is <c>300</c> seconds (5 minutes).
        [DefaultValue(300)]
        public TimeSpan ClockSkew
        {
            get
            {
                return _clockSkew;
            }

            set
            {
                if (value < TimeSpan.Zero)
                    throw LogHelper.LogExceptionMessage(new ArgumentOutOfRangeException(nameof(value), LogHelper.FormatInvariant(LogMessages.IDX10100, LogHelper.MarkAsNonPII(value))));

                _clockSkew = value;
            }
        }
```
Unleashing Your Digital Doppelgänger with Azure Custom Neural Voice
Tags: ai, azure, ndc, voice
Published: 2023-06-20 06:26:18

Hello, AI enthusiasts! Today, we're diving into a topic that's as fascinating as it is futuristic - cloning your voice using Azure Custom Neural Voice. Now, before you start picturing sci-fi scenarios, let's clarify that we're talking about creating a synthesized version of your voice, not growing a vocal cord in a petri dish!

The video we're discussing today is a presentation by Callum Whyte at NDC London 2023, titled "Clone yourself with Azure Custom Neural Voice." It's a captivating exploration of how advancements in AI are making it possible to create a digital twin of our voice. Imagine the possibilities - from telephony and voice overs to attending meetings on your behalf. Yes, you read that right!

In this session, Callum covers the basics of training and tweaking a model of your own voice, with minimal code, to turn text into natural-sounding speech. It's a fascinating journey into the world of AI and machine learning, and the best part is, you don't need to be a coding wizard to follow along.

But that's not all. Callum also delves into advanced techniques for training your model with enhanced data. As an example, he takes a larger amount of audio, such as a podcast, and uses widely available tools and APIs to identify individual speakers and the words being spoken. This includes highly technical language, which can then be fed into the model. 

The video is a little over an hour long, but it's worth every minute. You'll walk away with the knowledge and inspiration to give "cloning" your voice a try. And who knows? 

Now, I'd love to hear your thoughts. Have you ever tried to clone your voice using AI? What applications can you envision for this technology? Drop your thoughts in the comments below, and let's get the conversation started!

And if you found this post helpful, don't forget to hit that like button and share it with your friends. Stay tuned for more exciting explorations into the world of tech!

[Watch the video here](https://youtu.be/nXNYrbetzMM)

---
*Disclaimer: This blog post is a summary and analysis of Callum Whyte's presentation at NDC London 2023. All credit for the original content goes to the presenter and the event organizers.*

---
> Restyled with ChatGPT
> Photo by <a href="https://unsplash.com/@danielkcheung?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Daniel K Cheung</a> on <a href="https://unsplash.com/photos/cPF2nlWcMY4?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Build Safer Docker Images
Tags: docker, containers, security, beginners
Published: 2023-06-20 06:25:14

When you're building your container image there are at least two effortless practices that you can follow:

1. Prefer minimal base images
2. Run process with Least privileged user

## Prefer minimal base images

Base images not only help speed up your CI/CD pipelines, reduce storage space and network traffic. They also help you reduce the attack surface of your container.

Your container **should only have the dependencies that it needs** to run and nothing more.

> I know, we all love to ssh into the container and use vim, ping, or some other tool to debug it. But being lazy can get us into trouble very quickly 😊.

Explore the following base image options:

- [Scratch](https://hub.docker.com/_/scratch/) If you are going to run a binary that doesn't need any other libs (GO programs for example).
- [Alpine](https://hub.docker.com/_/alpine/) The image is only 5 MB in size and has access to a package repository to install what you need.
- If you want/need more, you can also try images with *-slim* version or even with *-alpine*.


## Run process with Least Privileged User

Your process inside the container shouldn't run as root unless is mandatory.

Having a process running as root means that an attacker could gain root access and perform an attack on the host.

Imagine that someone mounts a volume to the container and an attacker was able to gain access to the container by the process running as root. They would be able to manipulate that external volume with no issues at all.

What if that container has been launched using `--privileged` flag?

> The --privileged flag gives all capabilities to the container. When the operator executes docker run --privileged, Docker will enable access to all devices on the host as well as set some configuration in AppArmor or SELinux to allow the container nearly all the same access to the host as processes running outside containers on the host. Additional information about running with --privileged is available on the Docker Blog.
> [https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)

As you can see, potential issues begin to emerge very quickly.

### How do you run a process as non-root?

In your `Dockerfile` make sure you create a new regular user and then activate it.

Here's an example of how it can be done

```
...
# crate a non-root user
ENV NONROOT_USER myappser
ENV NONROOT_UID 1000
ENV HOME /app

RUN adduser --disabled-password \
    --gecos "Default user" \
    --uid ${NONROOT_UID} \
    ${NONROOT_USER}

USER root
# all files in the home folder will
# be owned by the non-root user
RUN chown -R ${NONROOT_USER}:${NONROOT_USER} ${HOME}
USER ${NONROOT_USER}

# You can add your CMD after this if you want to
...

```

*Photo credit: [Francesco Ungaro](https://www.pexels.com/@francesco-ungaro/)*