Skip to content

Instantly share code, notes, and snippets.

View afro-coder's full-sized avatar

Leon afro-coder

View GitHub Profile
@afro-coder
afro-coder / SFtoMS.go
Created October 25, 2021 15:16
Pull Data from Salesforce and push to MS teams
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@afro-coder
afro-coder / Containerfile
Created December 27, 2021 07:45
Squid Proxy with Kubernetes k3s Raspberry Pi4
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"]
@afro-coder
afro-coder / index.js
Last active February 16, 2022 16:06
Cloudfront function to rewrite and redirect to a different location
function handler(event) {
var request = event.request;
var uri = request.uri;
if (uri.startsWith('/api')) {
uri=uri.replace('/api/','')
var newurl = `https://backend-url/${uri}`
var response = {
// The status code is important.
@afro-coder
afro-coder / README.md
Created February 22, 2022 15:57 — forked from dims/README.md
Kubernetes Resources
@afro-coder
afro-coder / commands.md
Last active March 15, 2022 18:24
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
afro-coder / question1.html
Last active March 29, 2022 08:03
IT html programs
<!--
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.
-->
<html>
<head>
<title>HTML question 1</title>
</head>
<body>
@afro-coder
afro-coder / create-ecr.sh
Created April 18, 2022 10:51
ECR create repo files Terraform services
#!/bin/bash
# Usage./create-ecr.sh create repo-name
set -x
set -e
ECR_IMAGE_NAME=""
if [ "$1" = "" ];
then
echo "No Args passed"
@afro-coder
afro-coder / commands.md
Last active June 2, 2022 09:54
Linux commands
@afro-coder
afro-coder / chal-01.md
Created May 31, 2022 09:40
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
afro-coder / chal-02.md
Created May 31, 2022 11:21
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