Quick Tips
To increase the file upload and post size limit in moodle, edit "/etc/apache2/conf.d/moodle" as well as "/etc/php5/php.ini"
To remove all files and folders except a particular file do the following, replacing somefile.txt with whatever you need:
find -iname "*" \! -iname "somefile.txt" -exec rm -rf {} \;To create a user and password granting most/all priveledges to that database from the command line do:
1. first make sure the user doesnt already exist: SELECT USER,host FROM mysql.user; 2. Then create the user: CREATE USER 'nubae'@'localhost' IDENTIFIED BY 'a goood password'; 3. grant priveledges for that user: GRANT ALL ON nubae.* TO nubae@localhost;
Easy quick way to create mysql db from command line and add example table. you an always DROP a database too.
#nubae$ mysql -u root -p #nubae$ mysql> CREATE DATABASE hipwebsite: #### dont forget the : #nubae$ mysql> USE hipwebsite: #nubae$ mysql> CREATE TABLE entrancekeys (id INT, name VARCHAR(20), password VARCHAR(20)); #nubae$ mysql> SHOW TABLES;
To reset the postgres password or set a password do the following:
echo "localhost all all trust" | sudo tee -a /etc/postgresql/8.3/main/pg_hba.conf /dev/null su - postgres psql CREATE USER root WITH PASSWORD 'password'; ALTER ROLE root SUPERUSER; \q
To set the default character set to utf8 in mysql (to stop broken encoding for non English languages) Edit /etc/mysql/ and add the following under [mysqld]
default-character-set=utf8 skip-character-set-client-handshake
In case you accidentally move all the files for your user to the wrong directory. You can easily move them again where they should go by executing the following in the directory you copied the files to:
find . -user "nubae" -exec mv -f {} web/ \; 

