The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20130822

ubuntu 13.04 - how to install proprietary amd/ati graphics drivers on Sony Vaio VPCSE laptop

after 4 hours of endless attempts at trying dozens of people's tutorials, i finally was able to install the amd catalyst drivers on my sony vaio vpcse ( Radeon HD 6600M/6700M/7600M Series ) using a ppa and some additional necessary tasks. here's what i did:

open a terminal

first uninstall any fglrx drivers that are installed:
sudo sh /usr/share/ati/fglrx-uninstall.sh
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*


(if it's not installed or the sh script isn't there, then don't worry)

install the fglrx ppa:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install fglrx


check if this folder exists:
ls /usr/lib64

------
DO ONE OF THE FOLLOWING (A or B)
A. if /usr/lib64 doesn't exist, run this:
sudo mkdir /usr/lib64
sudo mkdir /usr/lib64/fglrx
sudo cp -dR /usr/lib/fglrx/* /usr/lib64/fglrx


B. if /usr/lib64 does exist, run this:
sudo mkdir /usr/lib64/fglrx
sudo cp -dR /usr/lib/fglrx/* /usr/lib64/fglrx


the flags -dR mean to copy all files, directories and symlinks, exactly as they are in the source folder you're copying from--everything gets preserved and you get an exact copy.
------

sudo aticonfig --adapter=all --initial

reboot

you should be able to login but unity will probably not work

open a terminal

GET UNITY TO WORK (i think this is the right order, IIRC)
gsettings reset org.compiz.core:/org/compiz/profiles/unity/plugins/core/ active-plugins
 

dconf reset -f /org/compiz/ && setsid unity

20130819

richfaces rich:inputNumberSpinner - how to disable form submit on enter key press

this tutorial has a quite complicated/lengthy solution, which involves recompiling source code: How to disable form submit on Enter and fix for RichFaces rich:inputNumberSpinner

my solution is way simpler:
open richfaces-ui-3.3.3.Final.jar in an archive manager

then open this file in a text editor (double click the file):
/org/richfaces/ui.pack.js

beginning around line 15151, you'll see the following lines:
}if(A.keyCode==13){if(this.spinner.required||""!=this.edit.value){this.edit.value=this.getValidValue(this.edit.value)
}if(this.edit.form){this.edit.form.submit()

change the second line so it looks like this:
}if(this.edit.form){/*COMMENTED OUT BY ME: this.edit.form.submit()*/

when you save the file ui.pack.js in the text editor, the archive manager should ask you if you want to update the jar file, choose Update

clear your browser cache, stop your app server, rebuild your project, then restart your server, then test it out in the browser and you should now be able to hit the enter key in a rich:inputNumberSpinner without submitting the form :)



see also: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?

and here's the bug registered in the jboss issue tracker:
inputNumberSpinner: autosubmit of a form while pressing the ENTER KEY, validation is discarded and modal panel is closed

20130812

wireshark - how to packet sniff webservices messages xml data stream content

we are debugging an issue we have with webservices and one of our clients, so we wanted to see that actual content data he was sending to a webservice at a specific port, so we installed wireshark.

i configured it to filter packages with the following filter text:
tcp.dstport == 9001 and data


at the bottom of the screenshot you can see the actual xml data stream that was sent to the webservice.

and here's the wireshark capture interfaces configuration--i just used "any" which captures on all interfaces.



note: in ubuntu linux you have to start wireshark as root:
sudo wireshark

otherwise you'll get the error/warning "there are no interfaces on which a capture can be done"

Suggestion for increased security against brute force password cracking

imagine if your authentication engine gave you an error even though you entered a correct password--requiring you to enter the correct password at least twice

it would at least double the time it takes to brute force crack a password.

20130805

how to move raid disks to new ubuntu machine when the motherboard failed/died

we have a database server: mydbserver

there we installed oracle 11g (11.1) with a RAID 1 (mirror) disk setup.

today the motherboard on that machine died.

we have another ubuntu server machine (machine2).

we took out the disks on machine2 and replaced them with the disks from mydbserver and after we booted up again, everything worked and we were able to use the RAID disks without any additional processes/configurations :)


wow, that was easy :)

UPDATE 20130919

make sure on the new server that RAID in the BIOS is turned off/disabled

the simplest/easiest web server installation on ubuntu

if you already had python installed on your ubuntu machine, then you're all ready to go! if not, then do this:
sudo apt-get install python

when python is installed, just open a terminal and change directory to the folder where you have some html files you wanna test in a browser, then start the python simple http server:
cd
cd Desktop
python -m SimpleHTTPServer

then open your browser to:
http://localhost:8000

simple as that!

i figured this out because i wanted to test the tlk.io embedded web chat library.

so, in my Desktop folder i made a file called tlkio.html, with the following contents:
<html>
<body>
<div id="tlkio" data-channel="mytestwebchatchannel0192837465" style="width:100%;height:400px;"></div><script async src="http://tlk.io/embed.js" type="text/javascript"></script>
</body>
</html>


so, if i go to this url:
http://localhost:8000/tlkio.html

then i can see that the web chat works.

20130727

[SOLVED] build, compile, install musescore from git on ubuntu 13.04: libdrm does not exist; Failed to find "GL" in ""

i tried building musescore from git on ubuntu 13.04, using the musescore compilation instructions tutorial for ubuntu 12.04, but when i ran "make", i got the following error:
...
CMake Error at /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:15 (message):
  The imported target "Qt5::Gui" references the file

     "//usr/include/libdrm"

  but this file does not exist

...
Call Stack (most recent call first):
  /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:41 (_qt5_Gui_check_file_exists)
  /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:47 (_qt5gui_find_extra_libs)
  /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:118 (include)
  build/FindQt5Transitional.cmake:29 (find_package)
  CMakeLists.txt:26 (include)

...

to fix this error i had to install this package:
sudo apt-get install libdrm-dev

then i tried it again:
cd
cd Downloads/MuseScore
make clean
make revision
make

and got the following error:
...
CMake Error at /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
  Failed to find "GL" in "".
Call Stack (most recent call first):
  /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:49 (_qt5gui_find_extra_libs)
  /home/me/Qt/5.1.0/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:118 (include)
  build/FindQt5Transitional.cmake:29 (find_package)
  CMakeLists.txt:26 (include)

...

to fix this error i had to install this package:
sudo apt-get install libgl1-mesa-dev

i have to thank this page for helping me find the right library to install the right opengl package/libraries.


then i tried it again and it worked :)

NOTE: i've also updated the musescore git compile instructions for ubuntu 12.04 with this new information.