wiki:administration/system-admin
close Warning: Can't synchronize with repository "(default)" (/usr/svn/silverfile does not appear to be a Subversion repository.). Look in the Trac log for more information.

Version 9 (modified by hank, 13 years ago) (diff)

dumpdata/loaddata django

SilverFile Server Administration Guide and Tips

Add users to sudo

Sudo allows all users in admin group root privilege. This is something that Ubuntu sets up as an alternative to visudo.

usermod -a -G admin ryan

SSH Keys

To generate a key:

ssh-keygen (or)
ssh-keygen -t dsa (for dsa)
(do not enter a passphrase)

This generates, id_dsa and id_dsa.pub. Client(id_dsa) ---ssh--> Host(id_dsa.pub in .ssh/authorized_keys)

Disk Usage Tools

Get a summary of disk usage for each client folder. Sort the output alphabetically.

du -h --max-depth=1 | sort -k 2

Using Screen

Screen is an excellent utility for managing shell sessions remotely.

screen

Within the new shell, enter Ctr-A d. This disengages you from that shell but still allows it to keep running.

screen -ls (lists screen sessions)
screen -r xxxx.tty.session (allows you to re-attach to a given session)

SSH Tunneling

If you want to tunnel the tomcat instance (running nutch) try this command:

ssh user@harvey.silverfilecorp.com -p 2222 -L 8080:localhost:8080

Init Scripts

Add an init script Add the script to /etc/init.d/ and then run:

update-rc.d script_name defaults

Remove an init script Delete the script from /etc/init.d/ and then run:

update-rc.d script_name remove

Samba Administration

Check samba version (also checks if samba is running)

smbd -V

Use samba client List smb shares on server:

smbclient -L //server -U user

Browse samba share

smbclient //server/share -U user
(or)
smbclient //server/share -U user%password

Django Administration

Dump data in database (assumes settings is in production skin directory)

python manage.py dumpdata --pythonpath=.. --settings=production.settings

Load data from fixture (json)

python manage.py loaddata /home/sf/dataout.json --pythonpath=.. --settings=production.settings

Alternatively you can load data in with syncdb. Recreate the MySQL db and move the fixture into files/common/fixtures/ naming it initial_data.json. Then run:

python manage.py syncdb --pythonpath=.. --settings=production.settings