Skip to content

Instantly share code, notes, and snippets.

View nadirs's full-sized avatar

Nadir Sampaoli nadirs

View GitHub Profile
useradd $1
mkdir /home/$1/www
chown root /home/$1
echo "/some/external/dir /home/$1/www none rw,bind" >> /etc/fstab
mount -a
echo "
Match User $1
ChrootDirectory /home/$1
ForceCommand internal-sftp
@nadirs
nadirs / categories.php
Last active August 29, 2015 14:14
Recursive table self-reference
<?php
class MyDb {
protected $link = null;
public function __construct() {
$this->link = mysqli_connect('host', 'username', 'password', 'database');
}
public function getCategoryByName($name) {