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)

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.

20130725

why a blogspot/blogger blog is better than a facebook musician/band page when you publish your music on soundcloud

Imo, the one main reason a blogger blog is better than a facebook Musician/Band page, when you publish your music on soundcloud, is that your music is way more easily exposed to the user in blogger. Compare the screenshots below and see what you think.

My "Nickleus" facebook Musician/Band page


people have to click that soundcloud link, and then they are redirected to the facebook soundcloud app page, which looks like this:






it takes some configuration to set this up too. read my guide to configuring your facebook page to use the soundcloud app. (note: the soundcloud app is currently unavailable, so you have to use the BandPage plugin--this is explained in that tutorial).

now take a look at soundcloud on your blog (taken from my Nickleus Music Technology Blog):





all you have to do here is paste a link into a gadget in the blogger layout admin and all your music is right there. users can start playing a song, then keep reading on the page. here's how to add your SoundCloud music to your blogger blog.

i recommend you have both, but i can pretty much guarantee, according to how things currently are now, that your music will be heard by more people through your blogger blog.

firefox "downloadthemall" plugin "hijacks" "download flash & video" plugin - how to make downloadthemall's video filename be the title of the video

before, when i just had the firefox add-on called Download Flash & Video installed, i would click on the down-arrow icon, e.g. on a youtube page and select video-title.mp4 and it would save the video with that exact title, e.g.:
~/Downloads/video-title.mp4

but then i had to install DownloadThemAll! for something here at work and after it was installed, then the DownloadThemAll! dialogue came up after i clicked on the mp4 link in the Download Flash & Video down-arrow icon list!

DownloadThemAll!'s default Renaming mask is:
*name*.*ext*

and would save the youtube mp4 file as simply as:
~/Downloads/videoplayer

so, to get DownloadThemAll! to save the youtube video file like Download Flash & Video used to do, set the Renaming mask to:
*text*

:)

20130719

ubuntu - how to take a screenshot and include the pointer/cursor/arrow/hand

follow this guide to open dconf-editor:
Default save directory for gnome-screenshot?

then check the key named "include-pointer"

UPDATE
doesn't look like that works in ubuntu 13.04 :( i enabled it, but it didn't have any effect...

leave a comment if you figure something out

UPDATE
if you use gnome-screenshot from a console then it works:
gnome-screenshot -i

how retarted is that? it's the same program, but you have to run it from the console in order for the "include-pointer" functionality to work..

20130718

[SOLVED] sony xperia sola cell/mobile phone won't charge after battery became fully uncharged (the phone turned off because it ran out of battery)

what i had to do to get the phone to charge again:

1. take off the back cover


2. remove the battery connector cover. you don't have to remove the speaker cover at the bottom, like in the video (see link at bottom), or unscrew anything at all. on my phone there was a sticker on top of the battery connector cover, and a tiny, thin piece of sticker from the battery on top of/overlapping the battery connector cover sticker)


3. remove the battery connector (you can do it with your fingers or a knife--you don't need any special tools.



4. i let the phone sit for about a half hour, with battery connector disconnected. then i reattached it and then charged the phone.

NOTE: the last time i tried it, the phone wouldn't charge at all--the little, red, charge light never came on. i eventually found out that it was because the usb connector into the side of the phone wasn't connecting properly (it was a little loose), so i had to wrap the usb cable around the phone a couple of times to make a tight connection, essentially putting tension on the usb connection into the phone, pulling the usb cable up towards me. the wrapping procedure was just so i could put the phone down while it was charging, so i didn't have to hold the phone.



(GTV screenshots taken from this sony xperia disassembly video)

20130716

JSP RAT by Jeroy - hacked a jboss 4.2.2 server

he put stuff in a jboss 4.2.2 "work" folder, in these locations:
/path/to/jboss/server/myapp/work/jboss.web/localhost/temporary/

/path/to/jboss/server/myapp/work/jboss.web/localhost/tmp/

/path/to/jboss/server/myapp/work/jboss.web/localhost/updates/


see also:
http://bri-blog.blogspot.no/2012/12/jsp-rat-by-jeroy.html

RAT can mean several things:
remote access trojan
remote administration tool

here's how to secure your jboss 4 server--first steps. (this links to my comment below on this page--or just read the instructions below):
1. remove the following folders:

/path/to/jboss/server/myapp/deploy/jmx-console.war
/path/to/jboss/server/myapp/deploy/management


NOTE: if you want to keep jmx-console enabled, then it seems that you need to edit some config code in deploy/jmx-console.war/WEB-INF/web.xml:
https://access.redhat.com/site/solutions/30744

<security-constraint>
  <web-resource-collection>
    <web-resource-name>HtmlAdaptor</web-resource-name>
    <description>
       An example security config that only allows users with the role
       JBossAdmin to access the HTML JMX console web application
    </description>
    <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
    <role-name>JBossAdmin</role-name>
  </auth-constraint>
</security-constraint>


2. secure permissions:
http://nickhumphreyit.blogspot.no/2013/07/jboss-422-files-that-need-execute.html




 
UPDATE 20131105

you also need to secure the invoker servlet, i.e. don't let anyone access this url:
/invoker/JMXInvokerServlet


UPDATE 20131114

according to Nafly, you also need to secure the EJBInvokerServlet


jboss 4.2.2 files that need execute permissions

i downloaded a "new"/default installation of jboss 4.2.2 to find out which files need execute/executable permission/permissions, so i ran this:
cd /path/to/where/i/extracted/jboss
find . -type f -executable

here's the list (note, "find" searches recursively, but all the executable files are in one folder: bin):
./bin/wsconsume.sh
./bin/shutdown.sh
./bin/wsrunclient.sh
./bin/classpath.sh
./bin/twiddle.sh
./bin/probe.sh
./bin/wsprovide.sh
./bin/run.sh
./bin/jboss_init_suse.sh
./bin/jboss_init_hpux.sh
./bin/jboss_init_redhat.sh
./bin/wstools.sh


12 files

to count the number of executable files, you do this:
find . -type f -executable|wc -l

and fyi, there are 990 readable files:
find . -type f -readable|wc -l

and 227 directories/folders:
find . -type d|wc -l


if you ever need to set the default jboss file permissions you'd do this:
WARNING: BE VERY CAREFUL YOU USE THESE EXACT COMMANDS--**DON'T INSERT EXTRA SPACES ANYWHERE!**
 
sudo find /path/to/where/you/installed/jboss -type f -print0 | sudo xargs -0 chmod 644

sudo find /path/to/where/you/installed/jboss -type d -print0 | sudo xargs -0 chmod 755
 

cd /path/to/where/you/installed/jboss 

chmod +x *.sh


20130715

java tip of the day - explicitly set unused (or no longer used) variables/objects/references to null to make them available for garbage collection

especially in large java programs, it's important to explicitly set unused (or no longer used) variables/objects/references to null to make them available for garbage collection.

Here is an example of "nulling the reference":

public class GarbageCollectionExample {

    public static void main(String[] args) {
        StringBuffer x = new StringBuffer("test");
        System.out.println(x);
        // the StringBuffer "test" is not available for GC yet
        x = null;
        //
the StringBuffer "test" is now available for GC
    }
}


Here is an example of "reassigning a reference value":

public class GarbageCollectionExample {

    public static void main(String[] args) {
        StringBuffer x = new StringBuffer("test");
        StringBuffer y = new StringBuffer("asdf");
        System.out.println(x);
        // the StringBuffer "test" is not available for GC yet
        x = y;
        // the StringBuffer "test" is now available for GC
}

the StringBuffer "test" is no longer reachable because "x" now references the StringBuffer "asdf".


(taken from pages 257-258 in "Sun Certified Programmer for Java 6 Study Guide")


20130707

debugging kxstudio-team's musescore package

I've just spent the last 3-4 hours trying to figure out how to report a bug for musescore and how to debug a musescore crash, but it looks like i can't do any debugging before kxstudio-team enables ddebs for their PAA.

below are my raw, personal notes, currently for my own use, while i await a reply from the kxstudio-team about enabling ddebs.
=====================

my original bug report:
http://musescore.org/en/node/21768

"
SUBJECT: "Define" keyboard shortcut in v1.3.5702 causes MuseScore to crash/close

I'm running musescore version 1.3 revision 5702 in Ubuntu Linux 13.04 64-bit. When I open musescore settings and try to define an unassigned keyboard shortcut by selecting a shortcut, then clicking the "Define" button, musescore crashes/closes.

UPDATE
I see I'm using the musescore package from this PPA:
http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu/ raring/main amd64 Packages

packaged by the kxstudio-team:
https://launchpad.net/~kxstudio-team

the package is version 1.3+dfsg-1+nopulse1~raring1

and is available here:
http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu/pool/main/m/musescore/musescore_1.3+dfsg-1+nopulse1~raring1_amd64.deb

I've asked them to enable ddebs for this package so I can provide debugging information for you to help you fix this bug easier. I'll add a comment/upload an attachment later when that is done, unless you're able to fix the issue without debugging info.

I don't know if the error is in the musescore code, or if it is due to a problem with kxstudio-team's compiling/packaging.
"

the instructions below come from here:
https://wiki.ubuntu.com/DebuggingProgramCrash
--------------

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
 

deb http://ddebs.ubuntu.com $(lsb_release -cs)-security main restricted universe multiverse
 

deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01

sudo apt-get update


-----------
gksudo gedit /etc/apt/sources.list.d/ddebs.list

contains this:

deb http://ddebs.ubuntu.com raring main restricted universe multiverse
deb http://ddebs.ubuntu.com raring-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com raring-security main restricted universe multiverse
deb http://ddebs.ubuntu.com raring-proposed main restricted universe multiverse



--------------

apt-cache policy musescore

gave this output:

musescore:
  Installed: 1.3+dfsg-1+nopulse1~raring1
  Candidate: 1.3+dfsg-1+nopulse1~raring1
  Version table:
 *** 1.3+dfsg-1+nopulse1~raring1 0
        500 http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status
     1.2+dfsg-1 0
        500 http://no.archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages



sudo apt-get install musescore-dbgsym=1.3+dfsg-1+nopulse1~raring1

didn't work:

E: Version '1.3+dfsg-1+nopulse1~raring1' for 'musescore-dbgsym' was not found

sudo apt-get install musescore-dbgsym=1.2+dfsg-1

didn't work (wouldn't work bc this is the ubuntu package--an earlier version):

The following packages have unmet dependencies:
 musescore-dbgsym : Depends: musescore (= 1.2+dfsg-1) but 1.3+dfsg-1+nopulse1~raring1 is to be installed
E: Unable to correct problems, you have held broken packages.




THE PROBLEM IS THAT I AM USING kxstudio-team's VERSION OF MUSESCORE, BUT THEY DON'T PROVIDE ddebs/dbgsym files


https://bugs.launchpad.net/launchpad/+bug/156575

"Launchpad admins can enable ddebs on a per-PPA basis. They are published in the PPA itself, alongside the normal debs."
https://bugs.launchpad.net/launchpad/+bug/156575/comments/21


-----------
my request to kxstudio-team:
https://launchpad.net/~kxstudio-team

"
SUBJECT: how do i post a bug? musescore 1.3+dfsg-1+nopulse1~raring1 crashes when editing keyboard shortcuts

can you please enable ddebs for musescore?

according to this post, your admins can do this:
https://bugs.launchpad.net/launchpad/+bug/156575/comments/21

"Launchpad admins can enable ddebs on a per-PPA basis. They are published in the PPA itself, alongside the normal debs."

I posted my original bug report to the musescore team here:
http://musescore.org/en/node/21768

but it would be nice to give them some debugging information to help them fix it faster.

thanks in advance,
nick humphrey
"