Skip to content

Instantly share code, notes, and snippets.


Leon(@mediocreDevops) afro-coder

View GitHub Profile


Enabling a service and starting it

systemctl enable --now httpd
systemctl enable httpd

Making the journal persistent

afro-coder /
Created May 31, 2022
Linux File manipulation

Learning File Manipulation

New Command: cut use man to figure out how to use cut

Using the file shared on slack

  • Print the first hundred lines
  • Print the first line
  • Print the last line of the file
  • Total lines inside the file
afro-coder /
Created May 31, 2022
Linux Basic Administration challenge

Boot up the linux virtual machine

  • Install apache (Use package manager to figure this out)
    • Start the apache service
    • Create a file that will replace the index file in your apache server
    • Check the port of the apache server
    • Check how many processes are being run by apache
  • Install nginx (Use package manager to figure this out)
    • Start the nginx systemd service
  • Test the service
afro-coder /
Created Apr 18, 2022
ECR create repo files Terraform services
# Usage./ create repo-name
set -x
set -e
if [ "$1" = "" ];
echo "No Args passed"
afro-coder / question1.html
Last active Mar 29, 2022
IT html programs
View question1.html
Program to accept Student ID (combination of alphabets an numbers),
date of joining Collige, percentage in previous class (in digits)
The data should be sent to the server.
<title>HTML question 1</title>
afro-coder /
Last active Mar 15, 2022
Daily Linux trouble shooting commands

Get a list of running processes

ps aux

Filter through the processes replace "<keyword>"

ps aux| grep <keyword>

Search for 2 or more processes

afro-coder /
Created Feb 22, 2022 — forked from dims/
Kubernetes Resources
afro-coder / index.js
Last active Feb 16, 2022
Cloudfront function to rewrite and redirect to a different location
View index.js
function handler(event) {
var request = event.request;
var uri = request.uri;
if (uri.startsWith('/api')) {
var newurl = `https://backend-url/${uri}`
var response = {
// The status code is important.
afro-coder / Containerfile
Created Dec 27, 2021
Squid Proxy with Kubernetes k3s Raspberry Pi4
View Containerfile
FROM alpine
RUN apk update && apk add squid
COPY ./squid.conf /etc/squid.conf
RUN squid -z && squid -k check
CMD ["squid","--foreground","-f","/etc/squid.conf"]