Software Development, Linux, and Windows

Notes on Software Development, Linux, and Windows

Change default version of java on CentOS

Perform these steps to change the default version of java: Login in or switch user to root: su – Type this command: alternatives –config java If you do not see the version you want listed then you must use the alternatives –install command, so your version of java can be “installed”. List the versions of [...]

Posted in CentOS, Java | Comments Off

Fix error with making a screenshot in CentOS

Perform these steps if you are getting this error: Failed to execute child process “gnome-screenshot” (No such file or directory) Login in or switch user to root: su – Type this command: yum install gnome-utils -y

Posted in CentOS, Linux | Comments Off

Install Gnome System Monitor on versions of CentOS above 6.2

Perform these steps to install the Gnome System Monitor on CentOS versions above 6.2: Login in or switch user to root: su – Type this command: yum install gnome-system-monitor

Posted in CentOS, Fedora, Linux | Comments Off

Install Development Tools and Development Libraries on CentOS

Perform these steps to install gcc, gdb, cpp, perl, and other standard linux development tools and libraries: Login in or switch user to root: su – Type this command: yum groupinstall ‘Development Tools’ ‘Development Libraries’

Posted in CentOS, Fedora, Linux | Comments Off

How to list group names in Linux

To list the names of all defined groups, use this command: Type this command: cut -d: -f1 /etc/group

Posted in CentOS, Fedora, Linux | Comments Off

Compare BigDecimal to Zero in Java

You really need to use compareTo() instead of equals() for this: equals() yields inconsistent results with decimal values: new BigDecimal( 0 ).equals( BigDecimal.ZERO ); // true new BigDecimal( 0.00 ).equals( BigDecimal.ZERO ); // false As you can see, eqauls() gives unexpected results. compareTo() does this right thing: new BigDecimal( 0 ).compareTo( BigDecimal.ZERO ) == 0; [...]

Posted in Java | Comments Off

Error shutting down JBoss from JBoss Developer Studio

When trying to shutdown jboss-eap-5.1 from Jboss Developer Studio, I got the following Error: Failed to authenticate principal=admin, securityDomain=jmx-console The solution was to edit the file jboss-eap-5.1\jboss-as\default\conf\props\jmx-console-users.properties and uncomment the line: admin=admin

Posted in JBoss | Comments Off

Dump or Load to or from a Subversion Repository using svnadmin

Login as or switch user to root: su – Example of using svnadmin dump to create a dump file of an svn repository: svnadmin dump /var/www/svn/repos > /home/peter/svn-repos_20120831-2110.dump Example of using svnadmin to load a repository from a dump file svnadmin load /var/www/svn/repos < 30-svn-repos_20161031-1842.dump

Posted in Linux, Subversion | Comments Off

Configure WordPress on CentOS to connect to a remote database

Sounds simple enough to do, but I ran into a problem along the way. I also go over the solution here. Login or switch user to root: su – Change directory to your wordpress installation: For me this is in /var/www/html/wordpress. cd /var/www/html/wordpress Edit the WordPress config file: vi wp-config.php Change the “MySQL hostname” setting: [...]

Posted in CentOS, Linux, MySQL, WordPress | Comments Off

Allow Apache/PHP on CentOS to connect to a remote database

The issue for me was that by defualt SELinux was preventing this access from happening. Perform the following steps on the machine running Apache. Login or swith user to root: su – Enter the following command: setsebool -P httpd_can_network_connect_db=1 NOTE: When I ran this command on my system which is a 2.8 GHz Pentium 4 [...]

Posted in Apache, CentOS, Linux, MySQL, PHP | Comments Off