Skip to content

Instantly share code, notes, and snippets.

View w0rldart's full-sized avatar

Al w0rldart

View GitHub Profile
@w0rldart
w0rldart / README.md
Created February 27, 2025 05:07
Python Script for Monitoring Running Processes and Docker Containers

Python Script for Monitoring Running Processes and Docker Containers

This Python script captures and logs information about running OS processes and Docker containers on a Unix-like system. It filters out specific unwanted processes (e.g., system tasks, internal commands) to provide a clear view of active user processes and containers.

Features

  • Process Monitoring: Uses the ps command to retrieve detailed information about running processes, including user, PID, CPU, and memory usage.
  • Docker Integration: Utilizes Docker CLI to fetch active container information in JSON format.
  • Exclusion List: Implements an exclusion mechanism to filter out system processes and commands based on a predefined list.
  • Output in JSON: Saves results in separate JSON files (running_processes.json and docker_containers.json) for easy consumption and analysis.
  • Error Logging: Captures errors during execution in a dedicated log file.
@w0rldart
w0rldart / README.md
Last active January 21, 2025 19:16
JIRA Upgrade from 8 to 9.4 LTS, together with MySQL upgrade from 5 to 8

Jira and MySQL upgrade

This GIST is a compilation of steps/instructions to help on how to

  1. Upgrade MySQL to version 8 from version 5
  2. Upgrade Jira to version 9.4 LTS from version 8.x
  3. Fix MySQL collation issues for new version of Jira

These steps have been executed on Ubuntu 24.04 after a few subsecuent Ubuntu OS upgrades with the do-release-upgrade tool. It might be different for you if you have a different configuration and OS, but the overall process/idea should be universal.

#!/bin/bash
#################
### VARIABLES ###
#################
NODE_VERSION="v18"
NPM_PACKAGES="yarn gulp standard"
BREW_ESSENTIALS="zsh zsh-autosuggestions zsh-syntax-highlighting vlc firefox brave-browser virtualbox virtualbox-extension-pack jq tmux nmap git pyenv"
BREW_DEV_TOOLS="tfenv vagrant packer ansible docker vagrant-manager rbenv ruby-build terraform-docs graphviz jq ffmpeg"
@w0rldart
w0rldart / docker-compose.yaml
Last active February 19, 2024 16:36
Odoo 17 with docker compose watch
version: '3.1'
services:
odoo:
image: odoo:17.0
command: odoo --dev all
depends_on:
- db
ports:
- "8069:8069"
@w0rldart
w0rldart / bleak.py
Last active January 14, 2024 21:32
Bluetooth scanner via Bleak
# Scan for nearby Bluetooth LE devices and their services
# @credits: https://medium.com/@protobioengineering/how-to-make-a-detailed-bluetooth-le-scanner-with-a-macbook-and-python-8e2c7dccfd39
# @install: pip install bleak
import asyncio
from bleak import BleakClient, BleakScanner
async def main():
devices = await BleakScanner.discover()
for device in devices:
@w0rldart
w0rldart / scroll-meetup-messages.user.js
Last active March 12, 2020 15:08
Scroll to the last message on Meetup
// ==UserScript==
// @name Scroll Meetup Messages
// @namespace https://meetup.net/
// @version 0.2
// @description Script to scroll to the last message in your Inbox, and last member on a Meetup Group
// @author Alex B
// @match https://secure.meetup.com/messages/*
// @match https://www.meetup.com/*/members/
// @grant none
// @require http://code.jquery.com/jquery-latest.js
@w0rldart
w0rldart / app.js
Last active May 20, 2023 20:31
NodeJS Lambda with DynamoDB setup for dev environment
const AWS = require('aws-sdk')
const IS_OFFLINE = process.env.NODE_ENV !== 'production'
let options = {}
// connect to local DB if running offline
if (IS_OFFLINE) {
const DYNAMO_ENDPOINT = process.env.DYNAMO_ENDPOINT
options = {
* alicloud_ess_alarm.alarm_up: CreateAlarm got an error: &errors.ServerError{httpStatus:400, requestId:"xxxx-xxxx",
hostId:"ess.eu-central-1.aliyuncs.com", errorCode:"InvalidParameter", recommend:"",
message:"The specified value of parameter \"MetricName\" is not valid.", comment:""}.
@w0rldart
w0rldart / trick.md
Created July 18, 2018 20:13
wp cli with increased memory_limit

If you get the following error when running wp command

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 12288 bytes) in ....

You can overcome that the following way

php -d memory_limit=256M /usr/bin/wp
@w0rldart
w0rldart / Chef.md
Last active July 14, 2021 15:32
Chef cluster recovery notes

Intro

Chef High Availability: Backend Cluster and its not so common problems list.

Notes:

  • In my case, Chef HA setup is entirely on AWS but this can be translated to other vendors too
  • chef-backend-ctl commands are for backend nodes
  • chef-server-ctl commands are for frontend nodes

Index