To install the R package rattle for Data Mining on Ubuntu, firstly you must install the wajig ubuntu package which is a simplified wrapper to the package management system dpkg/apt, running the following command in the ubuntu terminal:
sudo apt-get install wajig
After that, we must install the graphical libraries libgtk2.0-dev and libxml2-dev with the following command in the ubuntu terminal:
sudo wajig install libgtk2.0-dev libxml2-dev
Next, the packages RGtk2 and rattle must be installed with the following commands in the R console:
Finally, to start rattle the following R code must be executed:
If you made all the steps required to install rattle, the following screen will be appear.
The easiest way to know the disk size of a Postgresql table is run the following command:
If you want to send the result of a sql query into a csv file in PostgreSQL you must use the \COPY command. For example, suppose you have the table example with a field and you need to send the query:
SELECT * FROM example ORDER BY id ASC
To the file example.csv, you must run the following command in the PostgreSQL terminal:
\COPY (SELECT * FROM example ORDER BY id ASC) to example.csv csv header
To know the size of ram memory, you must run the following command:
grep MemTotal /proc/meminfo
You can get more information with the following command:
If you want to know the size of a Postgres database on disk, we must run the following sql command:
pg_size_pretty(pg_database_size(pg_database.datname)) AS size
To export a Postgres table to a csv file with headers you must log into the shell of Postgres and execute something like this:
\COPY my_table to 'filename.csv' csv header
Where my_table is the table I want to export and filename.csv is the exported file.
To install SQLite on Ubuntu, you must run the following command in a terminal:
sudo apt-get install sqlite3 libsqlite3-dev
To execute an R file in batch mode, you must open a terminal and run the following code:
R CMD BATCH infile &
Where infile is a text file with R code.
When I use gimp in some occasions the main toolbox (the one with painting tools) has disappeared. There are two solutions:
1) Go to the menu Windows -> Recently Closed Docks
2) Go to Edit -> Preferences in the Window Management section, and press the Reset Saved Window Positions to Default Values button as it is shown in the below image.
To create a shutdown user, first of all we create the user with the following command:
When the command is run, the password must be provided along with other information. After that the following lines must be added to the file /etc/sudoers
## user shutdown is allowed to execute shutdown command
shutdown ALL=NOPASSWD: /sbin/shutdown