Skip to content

Instantly share code, notes, and snippets.

View azlkiniue's full-sized avatar
:shipit:
Forever a work in progress

Ahmada Yusril azlkiniue

:shipit:
Forever a work in progress
View GitHub Profile
@azlkiniue
azlkiniue / Dockerfile
Created December 23, 2024 02:26
Dockerfile for building AGL
FROM ubuntu:22.04 AS build
SHELL ["/bin/bash", "-c"]
RUN apt-get update \
&& apt-get install -y \
curl \
git \
python3 \
python3-pip \
@azlkiniue
azlkiniue / airquality.R
Created December 16, 2024 07:54
Statistical Data Analysis on "airquality" R Dataset
data("airquality")
old_airquality <- airquality
# clean the dataset
airquality <- airquality[
complete.cases(airquality),
!(names(airquality) %in% c("Month", "Day"))
]
pairs(airquality)
summary(airquality)

Node Exporter Installation Guide (for Systemd)

Step 1: Create the node_exporter User

The node_exporter user should be non-privileged with a shell of /sbin/nologin. This user will own the necessary directories and will run the service.

sudo useradd --system --shell /sbin/nologin --no-create-home --home-dir /var/lib/node_exporter node_exporter
@azlkiniue
azlkiniue / can2ws.py
Last active September 22, 2024 15:25
Script to forward CAN bus logs (using SocketCAN) into websocket
#!/usr/bin/env python
import can
import asyncio
from typing import List
from can.notifier import MessageRecipient
from websockets.asyncio.server import broadcast, serve
connections = set()
interval = 0.1 # in seconds
@azlkiniue
azlkiniue / create-read-only-kubeconfig.yaml
Last active April 9, 2024 02:10
Create Read-only Kubernetes Config
apiVersion: v1
kind: ServiceAccount
metadata:
name: read-only-user
secrets:
- name: read-only-secret
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
@azlkiniue
azlkiniue / ndtop.py
Last active December 24, 2024 10:09
Script to get list of docker container that used a particular GPU, based on nvitop – https://github.com/XuehaiPan/nvitop
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from typing import Dict
from nvitop import Device, GpuProcess, NA
import docker
from rich.console import Console
from rich.table import Table
from rich import box
docker_client = docker.from_env()
@azlkiniue
azlkiniue / github-followback-checker.py
Last active February 18, 2023 15:25 — forked from rezkyfm/github-followback-checker.py
Check if user in github follow you back or not
'''
Check if user in github follow you back or not
'''
import requests
username = input("Enter your username: ")
def main(username):
@azlkiniue
azlkiniue / parseml.py
Last active March 18, 2021 06:31 — forked from urschrei/parseml.py
Extract attachments from EML files in the current dir, and write them to the output subdir
#!/usr/bin/env python
"""
2020 update:
- More iterators, fewer lists
- Python 3 compatible
- Processes files in parallel
(one thread per CPU, but that's not really how it works)
2021 update:
- Change from legacy format (compat32)
@azlkiniue
azlkiniue / Dockerfile
Created March 10, 2021 11:16
simple nodejs dockerfile example
FROM node:14-alpine
WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install
COPY . .
@azlkiniue
azlkiniue / capitals.topo.json
Created November 28, 2020 06:10
List of Capital Cities Coordinates in TopoJSON Format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.