Search this site
59 results found with an empty search
- Meta’s new open source library – StyleX
Facebook aka Meta open source introduced a new CSS library that they use for Facebook, Instagram, and Thread named StyleX. StyleX is a simple, easy-to-use JavaScript syntax and compiler for styling web apps. https://stylexjs.com/ StyleX combines the strengths and avoids the weaknesses of both inline styles and static CSS. Major features of StyleX Scalable It minimizes CSS output with Atomic CSS. With StyleX, styles remain maintainable as your codebase grows. Predictable The last style will be always applied to the element. Composable Merge and compose arbitrary styles across component and file boundaries. Fast No runtime style injection. All the styles are bundled in a static file at compile time. Type-Safe The feature that I liked is that in StyleX the last style will always be applied to the element and all the styles are bundled in a static file at compile-time to boost performance. Let me know which feature you liked in the comment section. According to StyleX, the library is fast and scalable which means it will be very used for enterprise-grade applications and projects. We can use it with any javascript framework. We will just need to instance the npm package. npm install --save @stylexjs/stylex All done! You successfully installed it to your project. To get started, you only need to understand 2 things First, How to create StyleX styles? import * as stylex from '@stylexjs/stylex'; const styles = stylex.create({ base: { fontSize: 16, backgroundColor: 'black' }, }); Second, How to use StyleX styles on elements? Great! Now you are ready to try it yourself. Try it and let me know your thoughts in the comment section. Know more at: – https://stylexjs.com/ https://github.com/facebook/stylex
- Google Vertex AI
Gen AI is evolving daily, and big tech giants like Microsoft [OpenAI], Amazon, and Google are in a race to build the best AI solution for users and customers. To stay ahead in the race Google launched Vertex AI – a platform that provides everything to build Gen AI solutions. By everything what do I and Google mean? Businesses and developers would be able to use 100s of foundation models, fine-tune models with business data, and use various AI Solutions. The key features of Vertex AI involve Generative AI models and tools Open and integrated AI platform MLOps for predictive and generative AI Search and Conversation AI solutions The above feature will help businesses to improve customer experience and automate various business problems. Google Vertex AI provides tools like Colab Enterprise Model Garden Generative AI Studio and many more… What’s fascinating about the above tools is you don’t need much knowledge about ML, Deep Learning, or Artificial Intelligence. Anyone with a tech background will be able to adapt and use it with ease. Generative AI Studio – In detail Generative AI Studio provides a user interface that lets us customize generative AI models so that we can use them for business applications. In Generative AI Studio you will be able to use various Google’s Language, Vision, and Speech with chat interface. In this studio, you can create your own prompt or use a ton of sample prompts for chat, summarization, classification, extraction, writing, and ideation that are provided by Google. You can not only prompt the large language models like text-bison, chat-bison, etc but can also fine-tune them by giving business data to improve response. We will discuss Colab Enterprise, Model Garden, and Model Development and Deployment. Know more – https://cloud.google.com/vertex-ai New customers get $300 in free credits to spend on Vertex AI. So what are you waiting for go and try it today. Do let me know your experience with it in the comment section.
- Bun 1.0 is finally here
Bun is a fast, all-in-one toolkit for running, building, testing, and debugging JavaScript and TypeScript, from a single file to a full-stack application. Today, Bun is stable and production-ready. According to bun official blogpost, bun’s goal is simple: eliminate slowness and complexity without throwing away everything that’s great about JavaScript. Your favorite libraries and frameworks should still work, and you shouldn’t need to unlearn the conventions you’re familiar with. Some of the reasons to try bun today ! Node.js compatibility Bun is a drop-in replacement for Node.js. That means existing Node.js applications and npm packages just work in Bun. Speed Bun is fast, starting up to 4x faster than Node.js. This difference is only magnified when running a TypeScript file, which requires transpilation before it can be run by Node.js. TypeScript and JSX support Bun has a JavaScript transpiler that’s baked into the runtime. That means you can run JavaScript, TypeScript, and even JSX/TSX files, no dependencies needed ESM & CommonJS compatibility Bun supports both module systems, all the time. No need to worry about file extensions, .js vs .cjs vs .mjs, or including "type": "module" in your package.json. You can even use import and require(), in the same file and it should work fine. Web APIs Bun has built-in support for the Web standard APIs that are available in browsers, such as fetch, Request, Response, WebSocket, and ReadableStream. Hot reloading Bun makes it easier for you to be productive as a developer. You can run Bun with --hot to enable hot reloading, which reloads your application when files change. What are you waiting for go and check out bun today.
- How To Configure Keycloak With MySQL Database?
Keycloak is an Open Source Identity and Access Management. Keycloak provides Single-Sign On, Identity brokering and Social Login, user federation, strong authentication, user management, fine-grained authorization, and more. Let’s see how we can configure keycloak with MySQL database. Create keycloak database in MySQL Open cmd/ terminal and connect to your MySQL Server using your root MySQL credentials. mysql -u root -p Above command will ask password for the MySQL root user. CREATE DATABASE keycloak; CREATE USER 'keycloak'@'localhost' IDENTIFIED BY 'keycloak'; GRANT ALL PRIVILEGES ON keycloak.* TO 'keycloak'@'localhost'; Configure Keycloak to use MySQL Database Go to the conf directory of the Keycloak Server. Open the keycloak.conf file with a text editor. Uncomment and update the following properties in conf/keycloak.conf file: db=mysql db-username=keycloak db-password=keycloak db-url=jdbc:mysql://localhost:3306/keycloak Next, go to the bin directory: cd keycloak-22.0.1/bin/ and start the Keycloak Server In Windows .\kc.bat start-dev In Linux / Ubuntu / Unix $ ./kc.sh start-dev Go to the browser and open http://localhost:8080. You should see the Keycloak Admin Console.
- Exploring the World of Proxy Servers: Enhancing Online Security and Privacy
In today’s digital age, where the internet has become an integral part of our lives, concerns about online security and privacy are more pertinent than ever. One tool that has gained prominence in addressing these concerns is the proxy server. Today, we’ll dive into the world of proxy servers, understanding what they are, how they work, and the benefits they offer in enhancing your online experience. What is a Proxy Server? At its core, a proxy server acts as an intermediary between your device and the internet. Instead of directly connecting to a website or online resource, your requests are first routed through the proxy server. This server then forwards your request to the destination, retrieves the response, and sends it back to you. This process introduces several advantages: 1. Enhanced Privacy Proxy servers can hide your IP address, making it challenging for websites to track your online activities. This is especially useful when you want to maintain anonymity while browsing or accessing region-restricted content. 2. Access Control Certain networks or organizations use proxy servers to control access to the internet. This allows administrators to filter and block content that might be deemed inappropriate or harmful. 3. Bypassing Restrictions Proxy servers can help you bypass geo-restrictions, allowing you to access content that might not be available in your region. By connecting through a server located in a different country, you can access websites and services as if you were physically present there. 4. Improved Performance In some cases, proxy servers can cache frequently accessed resources. This can lead to faster load times and reduced bandwidth consumption, especially in scenarios where multiple users are accessing the same content. Types of Proxy Servers There are different types of proxy servers, each serving a specific purpose: 1. HTTP Proxy These proxies are primarily used for web browsing. They handle HTTP requests and can be used to filter or log internet traffic. 2. HTTPS Proxy Similar to HTTP proxies, HTTPS proxies focus on secure connections, encrypting the data transmitted between your device and the server. 3. SOCKS Proxy SOCKS proxies operate at a lower level than HTTP/HTTPS proxies, making them suitable for a broader range of applications, including email and torrenting. 4. Transparent Proxy These proxies don’t require user configuration and are typically used by organizations to monitor internet usage. Setting Up and Using a Proxy Server Setting up a proxy server can vary depending on the type you choose. You can configure your device to use a proxy manually or use proxy server software. Additionally, there are various proxy service providers that offer both free and paid options. Proxy servers play a vital role in enhancing online security, privacy, and accessibility. Whether you’re concerned about your digital footprint, want to access region-restricted content, or simply aim to improve your browsing experience, proxy servers offer a versatile solution. By understanding the different types and benefits of proxy servers, you can make informed choices about your online presence. Remember to use proxy servers responsibly and in accordance with the law and terms of use.
- Next.js
Next.js is the react framework used for building web applications and user interfaces. It is loaded with a lot more features that enable you to build full-fledged production-ready applications. Features like routing, styling, authentication, and bundle optimization. There’s no need to install additional packages. Next.js provides everything that you need to make the Web Faster. Why would you like to choose next.js for your next web project? Built-in Optimization Dynamic HTML Streaming React Server Components Data Fetching Support for CSS modules Client and Server Rendering Node.js and Edge Runtimes API Routes Powerful Routing [file-based routing] and Layout Middleware Authentication Dev and Prod build system Getting Started Install using npx npx create-next-app@latest Next.js is a powerful and versatile framework for building modern web applications. It offers numerous benefits, including improved SEO, faster page loading times, and simplified development workflows. Its built-in features, such as automatic code splitting, hot module replacement, and optimized routing, help streamline the development process and enhance productivity. With Next.js, developers can leverage the React ecosystem and take advantage of the extensive collection of libraries and components available. Overall, Next.js empowers developers to create high-performance web applications with minimal configuration and maximum efficiency. Whether you’re building a small website, a complex web application, or an e-commerce platform, Next.js provides the tools and features necessary to deliver a top-notch user experience. It is undoubtedly a valuable framework in the modern web development landscape. https://nextjs.org/
- Ansible
Ansible is a community project sponsored by Red Hat, it’s an open-source project that helps automate IT tasks. In simple terms, if I want to define Ansible then it would be like Ansible is a simple automation tool which helps us to automate most IT tasks. Why Ansible? / Advantages of Ansible It is free to use by everyone. It is lightweight, and no constraints regarding the operating system or underlying hardware are present. It is secure due to its agentless capabilities and open SSH security features. Its modularity regarding plugins, inventories, modules, and playbooks makes Ansible the perfect companion to orchestrate large environments. Other Ansible Products Ansible Galaxy Galaxy provides pre-packaged units of work known to Ansible as roles and collections. Ansible AWX The AWX project—AWX for short—is an open-source community project, sponsored by Red Hat, that enables users to better control their community Ansible project use in IT environments. AWX is the upstream project from which the automation controller component is ultimately derived. Ansible Vault Ansible Vault is a feature of ansible that allows you to keep sensitive data such as passwords or keys in encrypted files, rather than as plaintext in playbooks or roles. These vault files can then be distributed or placed in source control. Ansible Playbook An Ansible playbook is a file that contains a set of instructions (tasks) that are executed by Ansible. Playbooks are written in YAML format and are used to automate tasks such as configuration management, infrastructure management, application deployment, and system administration. A playbook consists of one or more plays, which are a collection of tasks that are performed on a single host or set of hosts. Tasks can be as simple as below: installing a package applying a security patch creating a user account copying a file etc… As Ansible is agentless, playbooks can be created once and can be executed as and when needed on servers/ hosts. Playbooks are designed to be idempotent, meaning that they can be run multiple times without causing any adverse effects. Ansible Tower Ansible Tower is an automation platform that provides a web-based UI interface for managing and running Ansible automation tasks and playbooks. It is developed by Red Hat and is designed to provide a centralized platform for IT teams to manage and automate their infrastructure and application deployments. Ansible Tower helps organizations improve productivity and reduce downtime by automating repetitive tasks and ensuring consistent configuration across their entire infrastructure. It also reduce human errors and provide the accurate result which saves time. With Ansible Tower, you can: Automate repetitive tasks, which saves time and reduces errors. Ensure that all systems are configured consistently, which improves reliability and security. Schedule tasks to run automatically at a specific time or on a regular schedule. See the status of your automation jobs in one place, which helps you track progress and troubleshoot problems. Use a REST API to integrate Ansible Tower with other systems and automate your workflows. Manage multiple environments (like development, testing, and production) from a single platform. Create complex workflows that involve multiple playbooks and dependencies. Overall, Ansible Tower is a powerful tool that helps IT teams be more productive and efficient by automating their tasks and workflows. Join the community Ansible is automation powered by people. The open-source projects that comprise the Ansible Automation Platform are created with contributions from an active Ansible community. Discover for yourself why Ansible is one of the largest open-source projects in the world. https://www.ansible.com/community https://www.ansible.com/
- How To Pass Data Between Pages In React?
We can pass data between pages in React in both class as well as functional components using Links v5 react-route and useNavigate, useLocation (hooks) v6 of react-router. Let’s see how we can achieve the above in the class component In PostScreen (Component) we have a Create Post link, by clicking the link we will go to the "/post-details" page with the data we passed in the state object. import React from 'react'; import { Link } from 'react-router-dom'; export default class PostComponent extends React.Component { render() { return ( <> Create Post </> ) } } In the PostDetailsScreen (Component), we can access the passed state object as below: import React from 'react'; export default class PostDetailsScreen extends React.Component { //Log props data consoleLog() { console.log(this.props.location.state); } render() { return ( <> { this.consoleLog() }}>Log Props Data </> ) } } Let's see how to achieve above in the functional component. We will need useNavigate, useLocation hooks to achieve routing in functional component import React from 'react'; import { useNavigate } from 'react-router-dom'; export default function PostScreen() { const navigate = useNavigate(); const createPost = () => { navigate('/post-details', { state: { post_id: 1, post_name: 'Lorem Ipsum', post_description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry." } }); } return ( <> { createPost() }}> Create Post </> ); } Now we will be able to access the post data on the post details screen. import React from 'react'; import { useLocation } from 'react-router-dom'; export default function PostDetailsScreen() { const { state } = useLocation(); return ( <> {state.post_id} {state.post_name} {state.post_description} </> ) } Thank you for reading this article, I really appreciate it. If you have any questions feel free to leave a comment.
- What is Infrastructure as code?
“According to Wikipedia, Infrastructure as Code (IaC) is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools. The purpose of infrastructure as code is to enable IT teams to automatically manage, monitor, configure, and provision resources rather than doing it manually.” In simple terms, Infrastructure as code is the process of replacing manual effort required by the IT teams with lines of code. The complete infrastructure can be set up using a few lines of code. for example, creating a virtual machine on AWS EC2. Benefits of Infrastructure as code Faster time to production and market. Improved consistency, less configuration drift. Faster, more efficient development. Lower costs and more time developing innovation. Some of the most popular infrastructure as code tools are Terraform Ansible Chef Puppet Thank you for reading this article, I really appreciate it. If you have any questions feel free to leave a comment.
- How to change the Jenkins port from 8080 to any other port?
What is Jenkins? Jenkins is a self-contained, open source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed. Let’s come to our main question how to change the Jenkins port from 8080 to any other port? On windows Go to C: Program Files (x86)\Jenkins Open Jenkins.xml. Edit the –httpPort argument (you may need to edit default permissions) Restart the Jenkins service. Now Jenkins will permanently use the new port. On Ubuntu On Ubuntu, we can find our Jenkins configuration file under folder /etc/default/. sudo nano /etc/default/jenkins In the jenkins file change the default HTTP_PORT to the port you want. # port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8080 On Linux On Linux, we can find our Jenkins configuration file under folder /etc/sysconfig/. sudo nano /etc/sysconfig/jenkins In the jenkins file change the default JENKINS_PORT to the port you want. ## Type: integer(0:65535) ## Default: 8080 ## ServiceRestart: jenkins # # Port Jenkins is listening on. # Set to -1 to disable # JENKINS_PORT="8080" ## Type: string ## Default: "" ## ServiceRestart: jenkins https://www.jenkins.io/
- How to work with MongoDB using Python?
What is MongoDB? MongoDB is a NoSQL database which is used to store data in document form. It is an OpenSource Document oriented Database. It uses JSON (JavaScript Object Notation) for displaying documents. And BSON (Binary Object Notation) for storage and retrieval of data. MongoDB Features: Flexible schema Heavy read Allows documents inside a document Array functionalities Support for CRUD operations with aggregation Why MongoDB? MongoDB is Flexible Document based NoSQL Database. It has capability to work with document. With fast changing digital world and vast amount of data generating daily MongoDB provides tools to process new age Data. We can easily Create, Retrieve, Update, Delete (CRUD) using MongoDB. Managing Data also becomes simple using MongoDB. Python provides simple and efficient tools to connect to MongoDB. Using pymongo module we can perform all basic operations on MongoDB document. So, without wasting much time let us dive into world of Python and MongoDB. Connecting to MongoDB from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['Database_Name'] Inserting into Database Insert one row from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] doc = {'id':'1','name':'abc'} res = mytable.insert_one(doc) print(res.inserted_id) #print inserted id Insert multiple row from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] doc = [{'id':'2','name':'def'}, {'id':'3','name':'xyz'}] res = mytable.insert_many(doc) print(res.inserted_id) #print inserted id Retrieval of data from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] #fetching the first document doc = mytable.find_one() print(doc) #fetching all the documents doc_1 = mytable.find() for doc in doc_1: print(doc) #where conditon wh = mytable.find({'name':'xyz'}) for doc in wh: print(doc) #using regex reg = mytable.find({'name':{'$regex':'^a'}}) for doc in reg: print(doc) #displaying certain column col = mytable.find({},{'_id':0,'name':1}) for doc in col: print(doc) Sorting data from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] doc = mytable.find({}).sort('id',1) for d in doc: print(d) Limit number of Rows from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] doc = mytable.find({}).limit(2) for d in doc: print(d) Deleting data from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] #deleting one document done = mytable.delete_one({'id':'1'}) deleting all document dmany = mytable.delete_many({'id':'2'}) dpc = mytable.find({}) for d in doc: print(d) Updating data from pymongo import MongoClient myclient = MongoClient("mongodb://localhost:27018") mydatabase = myclient['demodb'] mytable = mydatabase['demotable'] #updating one document upone = mytable.update_one({'id':'1'},{'$set':{'name':'pqr'}}) #updating many documents upmany = mytable.update_many({'id':{'$gt':'1'}},{'$set':{'quotient':5}}) doc = mytable.find({}) for d in doc: print(d) There are many options for updating and retrieving data. Try other options too. Hope it helps! Happy Learning.
