Skip to content

Instantly share code, notes, and snippets.

View afro-coder's full-sized avatar

Leon afro-coder

View GitHub Profile
@dipankardas011
dipankardas011 / configuration for nix.md
Last active March 9, 2024 06:33
nixos configuration for i3 basic /etc/nixos/configuration.nix
@anthumchris
anthumchris / validate-permissions.js
Created June 9, 2022 20:55
Validate AWS Policy Action Permissions for IAM User or Role
/* This NodeJS script tests IAM Policy Actions for yourself or a specific PolicySourceArn user/role.
*
* https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html
*/
import AWS from 'aws-sdk' // $ npm i -D aws-sdk@2
const iam = new AWS.IAM()
const sts = new AWS.STS()
@mrimp
mrimp / !proxmox_k3s_cluster.sh
Created September 16, 2021 00:25 — forked from ilude/!proxmox_k3s_cluster.sh
Proxmox k3s cluster creation scripts
#!/bin/bash
# curl -s https://gist.githubusercontent.com/ilude/457f2ef2e59d2bff8bb88b976464bb91/raw/cluster_create_setup.sh?$(date +%s) > ~/bin/setup_cluster.sh; chmod +x ~/bin/setup_cluster.sh; setup_cluster.sh
echo "begin cluster_create_setup.sh"
export CREATE_TEMPLATE=1 #false
while test $# -gt 0; do
case "$1" in
--template)
export CREATE_TEMPLATE=0 #true
@dims
dims / README.md
Last active April 18, 2024 06:16
Kubernetes Resources
@rordi
rordi / root-password-MariaDB-docker-compose.md
Last active January 23, 2024 15:36
Change root password in MariaDB Docker container running with docker-compose

Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack:

$> docker-compose up -d
@perfecto25
perfecto25 / resticheat.md
Last active March 3, 2024 12:34
Restic cheatsheet

Restic backup application - commands cheatsheet

Installation & config

  1. add Retic repo
  2. yum install restic

add a Restic credential file to root

vim /root/.restic
@GeorgySk
GeorgySk / table_alignment.py
Created October 27, 2018 22:08
Example of how to print aligned a table from a list of dicts
from operator import itemgetter
from typing import (Any,
Dict,
Iterable,
Iterator,
List,
Sequence)
def max_length(objects: Iterable[Any]) -> int:
@dnozay
dnozay / LICENSE
Created December 19, 2017 20:07
Datetime utilities extracted from Django code as a single module.
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@MWins
MWins / project-ideas01.md
Last active April 22, 2024 16:13
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@mdonkers
mdonkers / server.py
Last active April 25, 2024 10:25
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer