Rugby on Rails Basic Commands

rails generate controller Controllername function

Using Wget to download website HTML

wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains --no-parent This command downloads the Web site The options are: --recursive: download the entire Web site. --domains don't follow links outside --no-parent: don't follow links outside the directory tutorials/html/. --page-requisites: get all the elements that compose the page (images, CSS and so on). --html-extension: save files with the .html extension. --convert-links: convert links so that they work locally, off-line. --restrict-file-names=windows: modify filenames so that they will work in Windows as well. --no-clobber: don't overwrite any existing files (used in case the download is interrupted and resumed).

Import and Export MySQL Database via CLI

Export MySQL table command. We must use mysqldump program. This needs to be installed separately

mysqldump --host=" " -u " " -p "table_name" > "filename".sql

Importing sql file

mysql --host=" " -u " " -p "table_name" < "filename".sql

Importing multiple sql file

for SQL in *.sql; do mysql --host="" --port="" -u "" --password="" {database_name} < $SQL; done

Apache2 PHP Minimum Config Settings

sudo vim /etc/php5/apache2/php.ini post - post_max_size = 35M upload - upload_tmp_dir = /var/tmp/ - upload_max_filesize = 100M - max_file_uploads = 100 timezone - date.timezone = "Asia/Seoul" session session.save_handler = memcache session.save_path = "” memory_limit = 1024M sudo apt-get install php5-mysqlnd sudo apt-get install php5-mysqlnd-ms sudo vim /etc/php5/apache2/conf.d/20-mysqlnd_ms.ini mysqlnd_ms.enable=1 mysqlnd_ms.config_file=/var/www/database/system/mysqlnd_ms.json