From the mind of a G33k

Generic placeholder image
FreeNAS Bulk Add Python script

FreeNAS Bulk Add user python script

    Want to add more than one user at a time on your FreeNAS server? You've come to the right place here is the python script to do it!

import json,csv
import requests


usertemplate = {
  'bsdusr_uid': '1100',
  'bsdusr_username': '',
  'bsdusr_mode': '755',
  'bsdusr_creategroup': 'True',
  'bsdusr_password': '',
  'bsdusr_shell': '/usr/local/bin/bash',
  'bsdusr_full_name': '',
  'bsdusr_email': '',
}
def read_cell(x, y):
    with open('new_users.csv', 'r') as f:
        reader = csv.reader(f)
        y_count = 0
        for n in reader:
            if y_count == y:
                cell = n[x]
                return cell
            y_count += 1
print (read_cell(1, 0))



i = 0
id = 1200
with open("new_users.csv","r") as f:
    for line in f:
        usertemplate["bsdusr_full_name"] = read_cell(0, i)
        usertemplate["bsdusr_password"] = read_cell(1, i)
        usertemplate["bsdusr_home"] = read_cell(2, i)
        usertemplate["bsdusr_uid"] = id
        usertemplate['bsdusr_username'] = read_cell(0, i)
        r = requests.post(
          'http://192.168.168.138/api/v1.0/account/users/',
          auth=('root', 'password'),
          headers={'Content-Type': 'application/json'},
          verify=False,
          data=json.dumps(usertemplate)
        )
        print(r.text)
        i +=1
        id +=1

Download File: .:. lgfnblkadd.py .:.
read more


Generic placeholder image
NextCloud

An Enterprise File Sync and Share solution that keeps data under control.

Your employees need to have easy access to their files, photos and documents to work and share with team members, customers and partners. And IT needs to know nobody besides those they shared with has access to those files.

Nextcloud Files is a self-hosted, open source file sync and share solution designed to be easy-to-use and highly secure.

Download Link: .:. https://nextcloud.com/install/#insta... .:.
read more