Saturday, November 12, 2011

Ubuntu single paste to install lamp with phpmyadmin

sudo apt-get install apache2 libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp mysql-server mysql-client
phpmyadmin

Monday, November 7, 2011

mysql.m compile 64 bit ubuntu linux

So I downloaded the awesome file exchange mysql.cpp file to link Matlab.

http://www.mathworks.com/matlabcentral/fileexchange/8663-mysql-database-connector

Then I installed the mysql and the extra libraries I thought I needed.

Then in Matlab I ran:

mex -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient mysql.cpp

and I got this error:

Warning: You are using gcc version "4.5.2-8ubuntu4)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus: /home/snow/matlab2011/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/lib/libppl_c.so.2)
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus: /home/snow/matlab2011/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libppl_c.so.2)
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus: /home/snow/matlab2011/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/lib/libppl.so.7)
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus: /home/snow/matlab2011/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libppl.so.7)
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus: /home/snow/matlab2011/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libgmpxx.so.4)

mex: compile of ' "mysql.cpp"' failed.

After digging around on the Internet I finally found the solution, and it was very simple:

Navigate to here:

$MATLAB_ROOT/sys/os/glnxa64/

(first make a backup of that folder just in case). and run these two commands:

mv libstdc++.so.6 libstdc++.so.6.orig
mv libgcc_s.so.1 libgcc_s.so.1.orig

Then I didn't even need to restart my Matlab session, I just reran the mex compile command it it worked! Yay!




Sunday, November 6, 2011

How to 3 monitors 2 graphics cards ubuntu xorg.conf

What a pain! After three days of frustration I finally was able to setup my three monitors to work on ubuntu.

Here is my xorg.conf:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 285.05.09 (buildmeister@swio-display-x86-rhel47-02.nvidia.com) Fri Sep 23 17:55:42 PDT 2011

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" Absolute 1600 900 #Location of first screen
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1" #Use this to stich monitors together so windows can be moved
EndSection

Section "Files"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "HP S2031"
HorizSync 24.0 - 83.0
VertRefresh 50.0 - 76.0
Option "DPMS"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor1"
VendorName "Unknown"
ModelName "HP S2031"
HorizSync 24.0 - 83.0
VertRefresh 50.0 - 76.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 480"
BusID "PCI:1:0:0"
Option "RandRRotation" "on"
EndSection

Section "Device"
Identifier "Device1"
Driver "radeon"
VendorName "ATI Technologies"
BoardName "AMD Radeon HD 6500"
BusID "PCI:2:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +0+900"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
Option "TwinView" "1"
SubSection "Display"
Depth 24
EndSubSection
EndSection


Important points:
Make sure binary drivers are installed for your graphics cards.
Use nvidia-settings to create and test your xorg.conf files. I noticed it was a lot easier to start with one screen, get each one working individually and then combine.

Backup, backup, backup your working xorg.conf. I screwed this up >10xs and it was nice to have a backup. Also alt-ctrl-backspace came in very handy so I could quickly retest my xorg.conf by restarting.

Option "Xinerama" "1" was needed so I could pass windows between my screens. I had issues using this if compiz effects were enabled, so I just turned off all, looks like it is an issue specific to 11.04, not older versions.

Also lspci |grep VGA was helpful to see my card info, this was needed in the xorg.conf file. I had issues with the relative screen positioning so I used absolute positioning which I would recommend.

Please post comments with any questions or feedback.

Saturday, November 5, 2011

Ubuntu Mint Install Nividia GTX 480 Drivers

First I went to the Nividia website:

http://www.nvidia.com/object/linux-display-amd64-285.05.09-driver.html

And found the right driver for my system. Downloaded the ./NVIDIA-Linux-x86_64-285.05.09.run file.
Change the permissions so I could execute:

chmod 777 ./NVIDIA-Linux-x86_64-285.05.09.run
Then I executed it:
./NVIDIA-Linux-x86_64-285.05.09.run


But it gives me a warning and says I have to kill my xserver. I Do this (I am using gnome):
sudo /etc/init.d/gdm stop

After I kill it I run the same command I tried above and follow the directions and it worked fine.