Skip to content

Instantly share code, notes, and snippets.

############################################################
# locking down the ssh system next.
# see http://www.howtogeek.com/howto/linux/security-tip-disable-root-ssh-login-on-linux/
useradd YOURNAME
passwd YOURNAME
############################################################
# some good things in this repo
# @see http://fedoraproject.org/wiki/EPEL
@btray77
btray77 / xml2json.js
Last active April 15, 2021 23:56
RegEX to parse XML to JSON
// Original from: http://killzonekid.com/worlds-smallest-fastest-xml-to-json-javascript-converter/
// Thanks to Loamhoof for helping get this working!
// http://stackoverflow.com/questions/15675352/regex-convert-xml-to-json/15680000
//Load XML into XML variable
var regex = /(<\w+[^<]*?)\s+([\w-]+)="([^"]+)">/;
while (xml.match(regex)) xml = xml.replace(regex, '<$2>$3</$2>$1>');
xml = xml.replace(/\s/g, ' ').