Skip to content

Instantly share code, notes, and snippets.

View richard457's full-sized avatar
🎯
Focusing

Muragijimana richard457

🎯
Focusing
View GitHub Profile
@richard457
richard457 / Clean a dirty string
Created March 14, 2019 09:25
Cleaning a string in JavaScript.
let dirtyString= "[Hello world]";
dirtyString.replace(/([^a-z0-9]+)/gi, '');
console.log(dirtyString); // Hello world
@richard457
richard457 / ssh-chroot-jail.sh
Created March 10, 2019 07:30 — forked from floudet/ssh-chroot-jail.sh
Chroot Jail for SSH Access
# Chroot Jail for SSH Access
# Tested on Ubuntu 14.04.2 LTS and Debian GNU/Linux 8 (jessie)
# Reference : http://allanfeid.com/content/creating-chroot-jail-ssh-access
#
# Had to add/change several things to make it work, including:
# - create lib64 folder
# - copy whoami dependencies that ldd doesn't show to fix 'I have no name!'
# in the customized prompt + create passwd file
#