Skip to content

Instantly share code, notes, and snippets.

@RPChinhara
RPChinhara / xml_to_json.py
Last active July 31, 2024 10:31
XML to JSON
import xml.etree.ElementTree as ET
import json
def parse_element(element, namespace, indent=""):
result = {}
if element.attrib:
result['attributes'] = element.attrib
if element.text and element.text.strip():
@RPChinhara
RPChinhara / remove_residual_config.sh
Created October 13, 2021 03:37 — forked from zhaostu/remove_residual_config.sh
One-liner to remov all residual config packages in Ubuntu
# Remove all the packages with residual configuration.
# http://stuzhao.blogspot.com/2012/07/removing-all-residual-config-packages.html
sudo apt-get remove --purge `dpkg -l | grep '^rc' | awk '{print $2}'`