Compare commits
54 Commits
task/upgra
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 2acf391f7d | |||
| a8b466c8db | |||
| 7bd7fa90c4 | |||
| 33b8e61f42 | |||
| 7b3ae70073 | |||
| cd3ffa479c | |||
| 99cbe51cac | |||
| e3e3346fd3 | |||
| 0e69643c66 | |||
| e930ed0f2f | |||
| 4cd29e188d | |||
| 7ffcc1a83b | |||
| 8d37136815 | |||
| 2f1c45293e | |||
| 464bd0ccef | |||
| bb04c90f4a | |||
| a0fb32aa0f | |||
| a069ca7961 | |||
| c091bac4aa | |||
| a66e3fa1a3 | |||
| 8f4170a4b7 | |||
| e3e24d561d | |||
| f721c98e33 | |||
| 88ef311141 | |||
| a1c6f518aa | |||
| 982c65f9ed | |||
| d684eca9b3 | |||
| ea8dddd6fb | |||
| 31adea59f4 | |||
| d69ee3326e | |||
| 5a0ff70502 | |||
| b7ce8ad551 | |||
| 85554b9a65 | |||
| 5942fde518 | |||
| c110f5bb79 | |||
| 77714e38b2 | |||
| ce7ed6540a | |||
| 1f6b3fffb8 | |||
| f073272f1f | |||
| ab3917adcc | |||
| b33faddcb5 | |||
| c03611262b | |||
| 345840c543 | |||
| 6aca7be258 | |||
| 36de09ac1c | |||
| da578461fc | |||
| 1d9ac4dbce | |||
| 42f4b533b1 | |||
| 4ab4cad773 | |||
| 27e59a86bc | |||
| c2c9bdad43 | |||
| 81bdcf6259 | |||
| d3db8448fb | |||
| 5e8c81991b |
@ -1 +1 @@
|
||||
{"taxonomy":{"tags":["comment-system","hello","privacy","remark42","self-hosted","test","world"],"categories":[]}}
|
||||
{"taxonomy":{"tags":["comment-system","hello","principles","privacy","remark42","self-hosted","test","world"],"categories":[]}}
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -17,10 +17,11 @@ package-lock.json
|
||||
|
||||
# IDE configurations
|
||||
.idea
|
||||
.vscode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/tasks.json
|
||||
|
||||
# Misc
|
||||
_sass/dist
|
||||
_sass/vendors
|
||||
assets/js/dist
|
||||
|
||||
26
.vscode/tasks.json
vendored
Normal file
26
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Run Jekyll Server",
|
||||
"type": "shell",
|
||||
"command": "./tools/run.sh",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Runs the Jekyll server with live reload."
|
||||
},
|
||||
{
|
||||
"label": "Build Jekyll Site",
|
||||
"type": "shell",
|
||||
"command": "./tools/test.sh",
|
||||
"group": {
|
||||
"kind": "build"
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Build the Jekyll site for production."
|
||||
}
|
||||
]
|
||||
}
|
||||
6
Gemfile
6
Gemfile
@ -2,10 +2,10 @@
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "jekyll-theme-chirpy", "~> 7.0", ">= 7.0.1"
|
||||
gem "jekyll-theme-chirpy", "~> 7.2", ">= 7.2.2"
|
||||
|
||||
group :test do
|
||||
gem "html-proofer", "~> 5.0"
|
||||
gem "html-proofer", "~> 5.0", group: :test
|
||||
end
|
||||
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
@ -16,7 +16,7 @@ platforms :mingw, :x64_mingw, :mswin, :jruby do
|
||||
end
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
|
||||
gem "wdm", "~> 0.2.0", :platforms => [:mingw, :x64_mingw, :mswin]
|
||||
|
||||
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
|
||||
# do not have a Java counterpart.
|
||||
|
||||
24
README.md
24
README.md
@ -25,30 +25,13 @@ Jekyll site. The following is a list of targets:
|
||||
To save you time, and also in case you lose some files while copying, we extract those files/configurations of the
|
||||
latest version of the **Chirpy** theme and the [CD][CD] workflow to here, so that you can start writing in minutes.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of
|
||||
the basic environment. [Git](https://git-scm.com/) also needs to be installed.
|
||||
|
||||
## Installation
|
||||
|
||||
Sign in to GitHub and [**use this template**][use-template] to generate a brand new repository and name it
|
||||
`USERNAME.github.io`, where `USERNAME` represents your GitHub username.
|
||||
|
||||
Then clone it to your local machine and run:
|
||||
|
||||
```console
|
||||
$ bundle
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Please see the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy#documentation).
|
||||
Check out the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
|
||||
|
||||
## Contributing
|
||||
|
||||
The contents of this repository are automatically updated when new releases are made to the [main repository][chirpy].
|
||||
If you have problems using it, or would like to participate in improving it, please go to the main repository for feedback!
|
||||
This repository is automatically updated with new releases from the theme repository. If you encounter any issues or want to contribute to its improvement, please visit the [theme repository][chirpy] to provide feedback.
|
||||
|
||||
## License
|
||||
|
||||
@ -56,6 +39,5 @@ This work is published under [MIT][mit] License.
|
||||
|
||||
[gem]: https://rubygems.org/gems/jekyll-theme-chirpy
|
||||
[chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/
|
||||
[use-template]: https://github.com/cotes2020/chirpy-starter/generate
|
||||
[CD]: https://en.wikipedia.org/wiki/Continuous_deployment
|
||||
[mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE
|
||||
[mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE
|
||||
23
_config.yml
23
_config.yml
@ -17,20 +17,20 @@ timezone: Asia/Kolkata
|
||||
|
||||
title: Engineer's Odyssey # the main title
|
||||
|
||||
tagline: Your Hub for Tech, DIY, and Innovation # it will display as the sub-title
|
||||
tagline: Your Hub for Tech, DIY, and Innovation # it will display as the subtitle
|
||||
|
||||
description: >- # used by seo meta and the atom feed
|
||||
Through my articles and stories, I hope to guide you through the intricate world of technology, offer insights into automation's transformative power, unveil the secrets behind successful DIY projects, and encourage you to fearlessly pursue new skills.
|
||||
|
||||
# Fill in the protocol & hostname for your site.
|
||||
# e.g. 'https://username.github.io', note that it does not end with a '/'.
|
||||
# E.g. 'https://username.github.io', note that it does not end with a '/'.
|
||||
url: "http://localhost:4000"
|
||||
|
||||
github:
|
||||
username: rajukottedi # change to your github username
|
||||
username: rajukottedi # change to your GitHub username
|
||||
|
||||
twitter:
|
||||
username: RajuKottedi # change to your twitter username
|
||||
username: RajuKottedi # change to your Twitter username
|
||||
|
||||
social:
|
||||
# Change to your full name.
|
||||
@ -39,8 +39,8 @@ social:
|
||||
email: bangararaju.kottedi@gmail.com # change to your email address
|
||||
links:
|
||||
# The first element serves as the copyright owner's link
|
||||
- https://github.com/rajukottedi # change to your github homepage
|
||||
- https://twitter.com/rajukottedi # change to your twitter homepage
|
||||
- https://github.com/rajukottedi # change to your GitHub homepage
|
||||
- https://twitter.com/rajukottedi # change to your Twitter homepage
|
||||
# Uncomment below to add more social links
|
||||
- https://www.facebook.com/RajuKottedi435
|
||||
- https://www.linkedin.com/in/bangararajuk/
|
||||
@ -71,8 +71,10 @@ analytics:
|
||||
domain: # fill in your Matomo domain
|
||||
cloudflare:
|
||||
id: # fill in your Cloudflare Web Analytics token
|
||||
fathom:
|
||||
id: # fill in your Fathom Site ID
|
||||
|
||||
# Pageviews settings
|
||||
# Page Views settings
|
||||
pageviews:
|
||||
provider: # now only supports 'goatcounter'
|
||||
|
||||
@ -140,7 +142,7 @@ assets:
|
||||
env: # [development | production]
|
||||
|
||||
pwa:
|
||||
enabled: true # the option for PWA feature (installable)
|
||||
enabled: true # The option for PWA feature (installable)
|
||||
cache:
|
||||
enabled: true # the option for PWA offline cache
|
||||
# Paths defined here will be excluded from the PWA cache.
|
||||
@ -219,8 +221,9 @@ exclude:
|
||||
- tools
|
||||
- README.md
|
||||
- LICENSE
|
||||
- "*.config.js"
|
||||
- package*.json
|
||||
- purgecss.js
|
||||
- rollup.config.js
|
||||
- "package*.json"
|
||||
- db_scripts
|
||||
- frontmatter.json
|
||||
|
||||
|
||||
@ -26,3 +26,15 @@
|
||||
# - type: stack-overflow
|
||||
# icon: 'fab fa-stack-overflow'
|
||||
# url: '' # Fill with your stackoverflow homepage
|
||||
#
|
||||
# - type: bluesky
|
||||
# icon: 'fa-brands fa-bluesky'
|
||||
# url: '' # Fill with your Bluesky profile link
|
||||
#
|
||||
# - type: reddit
|
||||
# icon: 'fa-brands fa-reddit'
|
||||
# url: '' # Fill with your Reddit profile link
|
||||
#
|
||||
# - type: threads
|
||||
# icon: 'fa-brands fa-threads'
|
||||
# url: '' # Fill with your Threads profile link
|
||||
|
||||
@ -35,4 +35,16 @@ platforms:
|
||||
# - label: fosstodon.org
|
||||
# link: "https://fosstodon.org/"
|
||||
# - label: photog.social
|
||||
# link: "https://photog.social/"
|
||||
# link: "https://photog.social/"
|
||||
#
|
||||
# - type: Bluesky
|
||||
# icon: "fa-brands fa-bluesky"
|
||||
# link: "https://bsky.app/intent/compose?text=TITLE%20URL"
|
||||
#
|
||||
# - type: Reddit
|
||||
# icon: "fa-brands fa-square-reddit"
|
||||
# link: "https://www.reddit.com/submit?url=URL&title=TITLE"
|
||||
#
|
||||
# - type: Threads
|
||||
# icon: "fa-brands fa-square-threads"
|
||||
# link: "https://www.threads.net/intent/post?text=TITLE%20URL"
|
||||
28
_drafts/2025-02-02-getting-started-with-python.md
Normal file
28
_drafts/2025-02-02-getting-started-with-python.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
title: "Part 1: Getting Started with Python"
|
||||
description: Kick off your Python journey! Learn what Python is, set up your environment, and write your first program. Perfect for beginners—let’s start coding!
|
||||
date: 2025-02-02T16:59:46.763Z
|
||||
tags: []
|
||||
categories: []
|
||||
image:
|
||||
path: /assets/img/posts/python-getting-started.png
|
||||
disable-ty: false
|
||||
series: "Python Practical Guide: A Beginner's Journey"
|
||||
slug: part-1-started-python
|
||||
---
|
||||
|
||||
## What is Python?
|
||||
Python is a versatile, high-level programming language known for its simplicity and readability. It’s used for:
|
||||
- Web development
|
||||
- Data analysis and visualization
|
||||
- Artificial intelligence and machine learning
|
||||
- Automation and scripting
|
||||
- Game development
|
||||
- And much more!
|
||||
|
||||
## Why Learn Python?
|
||||
1. **Beginner-Friendly**: Easy-to-read syntax makes it perfect for first-time coders.
|
||||
2. **Versatile**: Use it for almost any type of project or industry.
|
||||
3. **In-Demand Skill**: Python developers are highly sought after in the job market.
|
||||
4. **Huge Community**: Tons of resources, libraries, and frameworks to help you learn and grow.
|
||||
5. **Fun and Powerful**: Automate tasks, analyze data, or build apps—Python makes it easy!
|
||||
@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "Part 2: Python Basics - Syntax and Fundamentals"
|
||||
description: "Learn Python’s building blocks: variables, data types, input/output, and basic operations. Start writing clean, readable code today!"
|
||||
date: 2025-02-02T18:04:14.853Z
|
||||
tags: []
|
||||
categories: []
|
||||
image:
|
||||
path: /assets/img/posts/python-logo.jpg
|
||||
disable-ty: true
|
||||
series: "Python Practical Guide: A Beginner's Journey"
|
||||
slug: part-2-python-basics-syntax-fundamentals
|
||||
---
|
||||
@ -8,7 +8,7 @@
|
||||
components: ['embed', 'counter'],
|
||||
|
||||
max_shown_comments: 10,
|
||||
theme: modeToggle.modeStatus,
|
||||
theme: Theme.visualState,
|
||||
|
||||
locale: 'en',
|
||||
show_email_subscription: false
|
||||
@ -23,11 +23,11 @@
|
||||
}
|
||||
})(remark_config.components || ['embed']);
|
||||
|
||||
var targetDiv = document.getElementById("sidebar").getElementsByClassName("mode-toggle")[0];
|
||||
var targetDiv = document.getElementById("mode-toggle");
|
||||
|
||||
if (targetDiv != null) {
|
||||
targetDiv.addEventListener("click", () => {
|
||||
window.REMARK42.changeTheme(modeToggle.modeStatus === 'light' ? 'dark' : 'light');
|
||||
window.REMARK42.changeTheme(Theme.visualState === 'light' ? 'dark' : 'light');
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
|
||||
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
|
||||
@ -70,7 +70,7 @@
|
||||
|
||||
<!-- Bootstrap -->
|
||||
{% unless jekyll.environment == 'production' %}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
|
||||
{% endunless %}
|
||||
|
||||
<!-- Theme style -->
|
||||
@ -97,7 +97,7 @@
|
||||
<link rel="stylesheet" href="{{ site.data.origin[type].glightbox.css | relative_url }}">
|
||||
{% endif %}
|
||||
|
||||
<!-- JavaScript -->
|
||||
<!-- Scripts -->
|
||||
<script>
|
||||
var serviceUrl = "{{site.custom-config.blog-services.service_url}}";
|
||||
var serviceApiKey = "{{site.custom-config.blog-services.service_key}}";
|
||||
@ -169,9 +169,28 @@
|
||||
<!-- End Microsoft Clarity -->
|
||||
{% endif %}
|
||||
|
||||
{% unless site.theme_mode %}
|
||||
{% include mode-toggle.html %}
|
||||
{% endunless %}
|
||||
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
|
||||
|
||||
{% include js-selector.html lang=lang %}
|
||||
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<!-- PWA -->
|
||||
{% if site.pwa.enabled %}
|
||||
<script
|
||||
defer
|
||||
src="{{ '/app.min.js' | relative_url }}?baseurl={{ site.baseurl | default: '' }}®ister={{ site.pwa.cache.enabled }}"
|
||||
></script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Web Analytics -->
|
||||
{% for analytics in site.analytics %}
|
||||
{% capture str %}{{ analytics }}{% endcapture %}
|
||||
{% assign platform = str | split: '{' | first %}
|
||||
{% if site.analytics[platform].id and site.analytics[platform].id != empty %}
|
||||
{% include analytics/{{ platform }}.html %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% include metadata-hook.html %}
|
||||
</head>
|
||||
@ -37,7 +37,6 @@
|
||||
.then(function (result) {
|
||||
if (result != "N/A") {
|
||||
var response = JSON.parse(result);
|
||||
setPostMetrics(response);
|
||||
if(!response.postExists){
|
||||
postDetails.likes = postDetails.views = postDetails.comments = 0;
|
||||
if(Number(likes.innerText) !== NaN){
|
||||
@ -49,15 +48,15 @@
|
||||
if(postDetails.modifiedDate === ""){
|
||||
postDetails.modifiedDate = postDetails.createdDate;
|
||||
}
|
||||
}
|
||||
|
||||
ajax(serviceUrl + "/CreatePost", "POST", postDetails)
|
||||
ajax(serviceUrl + "/CreatePost", "POST", postDetails)
|
||||
.then(function (result) {
|
||||
if(result != "N/A"){
|
||||
var response = JSON.parse(result);
|
||||
setPostMetrics(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
<style>
|
||||
main h3 {
|
||||
margin: 10px
|
||||
}
|
||||
|
||||
#post-series {
|
||||
margin-top: 25px;
|
||||
}
|
||||
@ -17,7 +13,7 @@
|
||||
<div id="post-series">
|
||||
<div class="card">
|
||||
<div>
|
||||
<h3>{{ page.series }}</h3>
|
||||
<h3>{{ page.series }} ({{ posts | size }} - Part Series)</h3>
|
||||
<ol>
|
||||
{% assign posts = site.posts | where: "series", page.series | sort: "date" %}
|
||||
{% for post in posts %}
|
||||
|
||||
@ -40,7 +40,7 @@ layout: compress
|
||||
</main>
|
||||
|
||||
<!-- panel -->
|
||||
<aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 mb-5 text-muted">
|
||||
<aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 text-muted">
|
||||
<div class="access">
|
||||
{% include_cached update-list.html lang=lang %}
|
||||
{% include_cached trending-tags.html lang=lang %}
|
||||
@ -75,14 +75,18 @@ layout: compress
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div id="mask"></div>
|
||||
<div id="mask" class="d-none position-fixed w-100 h-100 z-1"></div>
|
||||
|
||||
{% if site.pwa.enabled %}
|
||||
{% include_cached notification.html lang=lang %}
|
||||
{% endif %}
|
||||
|
||||
<!-- JavaScripts -->
|
||||
{% include js-selector.html lang=lang %}
|
||||
<!-- Embedded scripts -->
|
||||
|
||||
{% for _include in layout.script_includes %}
|
||||
{% assign _include_path = _include | append: '.html' %}
|
||||
{% include {{ _include_path }} %}
|
||||
{% endfor %}
|
||||
|
||||
{% include_cached search-loader.html lang=lang %}
|
||||
</body>
|
||||
|
||||
@ -6,12 +6,16 @@ panel_includes:
|
||||
tail_includes:
|
||||
- related-posts
|
||||
- post-nav
|
||||
- comments
|
||||
- comment
|
||||
script_includes:
|
||||
- comment
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
<article class="px-1">
|
||||
{% include toc-status.html %}
|
||||
|
||||
<article class="px-1" data-toc="{{ enable_toc }}">
|
||||
<header>
|
||||
<h1 data-toc-skip>{{ page.title }}</h1>
|
||||
{% if page.description %}
|
||||
@ -108,6 +112,30 @@ tail_includes:
|
||||
{% include post-series.html %}
|
||||
</header>
|
||||
|
||||
{% if enable_toc %}
|
||||
<div id="toc-bar" class="d-flex align-items-center justify-content-between invisible">
|
||||
<span class="label text-truncate">{{ page.title }}</span>
|
||||
<button type="button" class="toc-trigger btn me-1">
|
||||
<i class="fa-solid fa-list-ul fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button id="toc-solo-trigger" type="button" class="toc-trigger btn btn-outline-secondary btn-sm">
|
||||
<span class="label ps-2 pe-1">{{- site.data.locales[lang].panel.toc -}}</span>
|
||||
<i class="fa-solid fa-angle-right fa-fw"></i>
|
||||
</button>
|
||||
|
||||
<dialog id="toc-popup" class="p-0">
|
||||
<div class="header d-flex flex-row align-items-center justify-content-between">
|
||||
<div class="label text-truncate py-2 ms-4">{{- page.title -}}</div>
|
||||
<button id="toc-popup-close" type="button" class="btn mx-1 my-1 opacity-75">
|
||||
<i class="fas fa-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
|
||||
<div class="content">
|
||||
{{ content }}
|
||||
{% if page.disable-ty != true %}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: SOLID Principles
|
||||
description: Solid Principles
|
||||
description: The SOLID principles are a set of design principles aimed at improving software quality, making it easier to understand, extend, and maintain.
|
||||
date: 2024-04-03T16:10:57.476Z
|
||||
tags:
|
||||
- code quality
|
||||
|
||||
143
_posts/2025-01-01-a-beginners-guide-to-ufw.md
Normal file
143
_posts/2025-01-01-a-beginners-guide-to-ufw.md
Normal file
@ -0,0 +1,143 @@
|
||||
---
|
||||
title: "Keep Your Linux System Secure: A Beginner’s Guide to UFW"
|
||||
description: UFW is a tool that helps you decide which connections can or can't access your Linux system. It's simple enough for beginners but also has features for experts.
|
||||
date: 2025-01-01T17:48:18.319Z
|
||||
tags:
|
||||
- firewall
|
||||
- linux
|
||||
- security
|
||||
- ufw
|
||||
categories:
|
||||
- Linux
|
||||
- Firewall
|
||||
image:
|
||||
path: /assets/img/posts/ufw-logo.jpg
|
||||
alt: A Beginner's Guide to UFW (Uncomplicated Firewall)
|
||||
slug: ufw-guide
|
||||
---
|
||||
UFW (Uncomplicated Firewall) is a powerful yet user-friendly tool that allows you to control which connections can access your Linux system. Designed with simplicity in mind, it’s perfect for beginners while still offering advanced features for experienced users. In this post, we’ll explore how UFW works, how to use it effectively, and why it’s an essential tool for securing your system.
|
||||
|
||||
When it comes to securing your Linux server or desktop, managing network access is one of the most critical tasks. Firewalls serve as the first line of defense, and while tools like iptables offer granular control, they can be intimidating for beginners. That’s where UFW (Uncomplicated Firewall) steps in.
|
||||
|
||||
UFW is a user-friendly interface for managing iptables, designed to simplify the process of configuring a firewall. Whether you’re a seasoned Linux administrator or a newcomer, UFW makes securing your system straightforward and efficient.
|
||||
|
||||
## Why Use UFW?
|
||||
1. **Ease of Use:** UFW abstracts the complexities of iptables, offering simple commands to configure firewall rules.
|
||||
2. **Default Settings:** UFW ships with sensible defaults, such as denying all incoming connections while allowing outgoing ones.
|
||||
3. **Integration:** It integrates well with many linux distributions and is often installed by default.
|
||||
4. **Script-Friendly:** UFW is ideal for automation and scripting, making it perfect for managing servers at scale.
|
||||
|
||||
## Installing UFW
|
||||
Most modern Linux distributions come with UFW pre-installed. If it’s not already on your system, you can install it with the following commands:
|
||||
|
||||
For Ubuntu/Debian:
|
||||
```terminal
|
||||
sudo apt update
|
||||
sudo apt install ufw
|
||||
```
|
||||
For CentOS/RHEL:
|
||||
```terminal
|
||||
sudo yum install epel-release
|
||||
sudo yum install ufw
|
||||
```
|
||||
For Arch Linux:
|
||||
```terminal
|
||||
sudo pacman -S ufw
|
||||
```
|
||||
## Basic UFW Commands
|
||||
### Enable UFW
|
||||
Before configuring UFW, you need to enable it:
|
||||
```terminal
|
||||
sudo ufw enable
|
||||
```
|
||||
### Check UFW Status
|
||||
To see whether UFW is running and view current rules:
|
||||
```terminal
|
||||
sudo ufw status
|
||||
```
|
||||
### Allowing connections
|
||||
To allow traffic on a specific port, use the `allow` command. For example, to allow SSH connections:
|
||||
```terminal
|
||||
sudo ufw allow ssh
|
||||
```
|
||||
Or, specify the port number:
|
||||
```terminal
|
||||
sudo ufw allow 22
|
||||
```
|
||||
### Denying Connections
|
||||
To block traffic on a specific port:
|
||||
```terminal
|
||||
sudo ufw deny 80
|
||||
```
|
||||
### Removing Rules
|
||||
To delete a rule, prepend the rule with `delete`. For example:
|
||||
```terminal
|
||||
sudo ufw delete allow 22
|
||||
```
|
||||
Or Remove a rule by its number
|
||||
|
||||
List UFW Rules with Numbers
|
||||
```terminal
|
||||
sudo ufw status numbered
|
||||
```
|
||||
Example output
|
||||
```terminal
|
||||
Status: active
|
||||
|
||||
To Action From
|
||||
[ 1] 22/tcp ALLOW Anywhere
|
||||
[ 2] 80/tcp ALLOW Anywhere
|
||||
[ 3] 22/tcp (v6) ALLOW Anywhere (v6)
|
||||
[ 4] 80/tcp (v6) ALLOW Anywhere (v6)
|
||||
```
|
||||
Delete the Rule by Number
|
||||
```terminal
|
||||
sudo ufw delete 2
|
||||
```
|
||||
### Resetting UFW
|
||||
To reset UFW to its default state, removing all rules:
|
||||
```terminal
|
||||
sudo ufw reset
|
||||
```
|
||||
## Advanced Usage
|
||||
### Limiting Connections
|
||||
To protect against brute-force attacks, you can limit connections by using `limit` rule in UFW. This rule restricts the rate of new connections from the same IP address, allowing only a limited number of connections per minute (default: 6 attempts within 30 seconds). You can adjust these values by modifying the UFW configuration files, typically found in `/etc/ufw/` or `/etc/ufw/ufw.conf`, or by customizing rate limits using iptables rules directly. within a specified time frame. For instance, to limit SSH attempts, you can execute:
|
||||
```terminal
|
||||
sudo ufw limit ssh
|
||||
```
|
||||
This helps to deter malicious actors trying to gain unauthorized access to your system by repeatedly guessing passwords or exploiting vulnerabilities.
|
||||
### Allowing Specific IP Addresses
|
||||
To allow traffic from a specific IP address:
|
||||
```terminal
|
||||
sudo ufw allow from 192.168.0.100
|
||||
```
|
||||
Allowing Traffic to a Specific Port and IP
|
||||
For more granular control, you can specify both source IP and destination port:
|
||||
```terminal
|
||||
sudo ufw allow from 192.168.0.100 to any port 22
|
||||
sudo ufw allow from 192.168.0.0/24 to any port 22 proto tcp
|
||||
```
|
||||
### Using Application Profiles
|
||||
UFW supports application profiles to simplify rule management for common services. List available profiles with:
|
||||
```terminal
|
||||
sudo ufw app list
|
||||
```
|
||||
To allow a specific application, UFW provides predefined profiles for commonly used software and services. These profiles encapsulate the necessary port and protocol details, simplifying firewall configuration. For instance, to permit traffic for an application like Apache, you can execute:
|
||||
```terminal
|
||||
sudo ufw allow 'Apache Full'
|
||||
```
|
||||
This command enables both HTTP (port 80) and HTTPS (port 443) traffic, as defined in the application profile.
|
||||
|
||||
## Best Practices
|
||||
1. **Start with Defaults:** UFW's default policy denies incoming traffic and allows outgoing traffic, a good starting point for most setups.
|
||||
2. **Enable Logging:** Turn on logging to monitor blocked traffic:
|
||||
```terminal
|
||||
sudo ufw logging on
|
||||
```
|
||||
3. **Test Rules:** Before applying complex rules on a production system, test them in a safe environment.
|
||||
4. **Document Changes:** Keep a record of the rules you add or remove to make troubleshooting easier.
|
||||
|
||||
## Conclusion
|
||||
UFW makes it easy to manage your firewall, even if you’re new to Linux. By learning its simple and advanced features, you can protect your system without the hassle of complicated tools like iptables. Whether you’re using one computer or many servers, UFW is a great tool to keep things secure.
|
||||
|
||||
|
||||
BIN
assets/img/posts/python-getting-started.png
Normal file
BIN
assets/img/posts/python-getting-started.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
assets/img/posts/python-logo.jpg
Normal file
BIN
assets/img/posts/python-logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
assets/img/posts/ufw-logo.jpg
Normal file
BIN
assets/img/posts/ufw-logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@ -4,7 +4,7 @@ var remark_config = {
|
||||
components: ['embed'],
|
||||
|
||||
max_shown_comments: 10,
|
||||
theme: modeToggle.modeStatus,
|
||||
theme: Theme.visualState,
|
||||
|
||||
locale: 'en',
|
||||
show_email_subscription: false
|
||||
@ -23,6 +23,6 @@ var targetDiv = document.getElementById("sidebar").getElementsByClassName("mode-
|
||||
|
||||
if (targetDiv != null) {
|
||||
targetDiv.addEventListener("click", () => {
|
||||
window.REMARK42.changeTheme(modeToggle.modeStatus === 'light' ? 'dark' : 'light');
|
||||
window.REMARK42.changeTheme(Theme.visualState === 'light' ? 'dark' : 'light');
|
||||
})
|
||||
}
|
||||
@ -49,6 +49,11 @@
|
||||
"title": "disable-ty",
|
||||
"name": "disable-ty",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"title": "series",
|
||||
"name": "series",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
54
tools/run.sh
Normal file
54
tools/run.sh
Normal file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Run jekyll serve and then launch the site
|
||||
|
||||
prod=false
|
||||
command="bundle exec jekyll s -l"
|
||||
host="127.0.0.1"
|
||||
|
||||
help() {
|
||||
echo "Usage:"
|
||||
echo
|
||||
echo " bash /path/to/run [options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -H, --host [HOST] Host to bind to."
|
||||
echo " -p, --production Run Jekyll in 'production' mode."
|
||||
echo " -h, --help Print this help information."
|
||||
}
|
||||
|
||||
while (($#)); do
|
||||
opt="$1"
|
||||
case $opt in
|
||||
-H | --host)
|
||||
host="$2"
|
||||
shift 2
|
||||
;;
|
||||
-p | --production)
|
||||
prod=true
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo -e "> Unknown option: '$opt'\n"
|
||||
help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
command="$command -H $host"
|
||||
|
||||
if $prod; then
|
||||
command="JEKYLL_ENV=production $command"
|
||||
fi
|
||||
|
||||
if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then
|
||||
command="$command --force_polling"
|
||||
fi
|
||||
|
||||
echo -e "\n> $command\n"
|
||||
eval "$command"
|
||||
89
tools/test.sh
Normal file
89
tools/test.sh
Normal file
@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build and test the site content
|
||||
#
|
||||
# Requirement: html-proofer, jekyll
|
||||
#
|
||||
# Usage: See help information
|
||||
|
||||
set -eu
|
||||
|
||||
SITE_DIR="_site"
|
||||
|
||||
_config="_config.yml"
|
||||
|
||||
_baseurl=""
|
||||
|
||||
help() {
|
||||
echo "Build and test the site content"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo
|
||||
echo " bash $0 [options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo ' -c, --config "<config_a[,config_b[...]]>" Specify config file(s)'
|
||||
echo " -h, --help Print this information."
|
||||
}
|
||||
|
||||
read_baseurl() {
|
||||
if [[ $_config == *","* ]]; then
|
||||
# multiple config
|
||||
IFS=","
|
||||
read -ra config_array <<<"$_config"
|
||||
|
||||
# reverse loop the config files
|
||||
for ((i = ${#config_array[@]} - 1; i >= 0; i--)); do
|
||||
_tmp_baseurl="$(grep '^baseurl:' "${config_array[i]}" | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||
|
||||
if [[ -n $_tmp_baseurl ]]; then
|
||||
_baseurl="$_tmp_baseurl"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
# single config
|
||||
_baseurl="$(grep '^baseurl:' "$_config" | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
# clean up
|
||||
if [[ -d $SITE_DIR ]]; then
|
||||
rm -rf "$SITE_DIR"
|
||||
fi
|
||||
|
||||
read_baseurl
|
||||
|
||||
# build
|
||||
JEKYLL_ENV=production bundle exec jekyll b \
|
||||
-d "$SITE_DIR$_baseurl" -c "$_config"
|
||||
|
||||
# test
|
||||
bundle exec htmlproofer "$SITE_DIR" \
|
||||
--disable-external \
|
||||
--ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
||||
}
|
||||
|
||||
while (($#)); do
|
||||
opt="$1"
|
||||
case $opt in
|
||||
-c | --config)
|
||||
_config="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
main
|
||||
Loading…
Reference in New Issue
Block a user