One of the most immediate differences that typical computers notice between an Apple and other operating systems is the Dock Bar. This is a possible addition to any operating system (such as Windows or Linux). On Ubuntu Linux you can easily install Docky in just a few minutes.
sudo add-apt-repository ppa:docky-core/ppa
sudo apt-get install docky
Installation of Sonar requires but a few simple steps, though they can be rather obscure to many developers.
Connect to MySQL:
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
grant all privileges on sonar.* to '[email protected]' identified by 'sonar';
Easiest method, if you are on Ubuntu:
sudo vi /etc/apt/sources.list
- Then add the following line:
deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/
sudo apt-get update
sudo apt-get install sonar
- You will then have to stop/start as above to edit the configuration, generally to change database config:
sudo vi /opt/sonar/conf/sonar.properties
Manual installation (and upgrade?) if you prefer to do things the hard way 🙂
- Download and unzip the release:
sudo mv sonar-3.6.1 /opt/sonar
sudo rm -r /opt/sonar (to remove old link)
sudo ln -s /opt/sonar-3.6.1/ /opt/sonar
(uncomment lines for MySQL, comment out H2)
sudo cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
sudo vi /etc/init.d/sonar
add the following 2 lines:
sudo update-rc.d -f sonar remove
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
Upgrades can be a little odd, if you see the maintenance page at http://localhost:9000/maintenance, go to http://localhost:9000/setup and do the required steps.
If you update your Ubuntu kernel frequently, eventually you will come to the realization that it is taking a lot of space to keep the old versions around on disk. Another annoyance is that your Grub loader will show a very long list. Sure, you can keep them around forever, should you need to recover them, but for most people it’s safe to remove them. You can manually select and remove the packages in Synaptic, but the easiest way I’ve found is to sun the following script instead. It will remove all old kernel version (except the current one!):
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
Occasionally, you might also want to follow that with the following to clean up other artifacts too…
sudo apt-get autoremove
With the rate of updates and security patches for Java, administration of your Ubuntu machines can become tedious. There’s a better way… allow it to check for and update with your other software. The steps are easy…
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
NOTE: You can also install java8 in the same manner with:
sudo apt-get install oracle-java8-installer
NOTE: The Java Control Panel can sometimes be hard to locate, it will be at the following:
Installing MySQL on Ubuntu requires only a few simple steps.
sudo apt-get install mysql-server
sudo netstat -tap | grep mysql
sudo vi /etc/mysql/my.cnf
sudo service mysql restart
To look for some simple performance and security suggestions:
sudo apt-get install mysqltuner
Adding a new user is equally easy…
mysql --user=root --password=mypassword mysql
CREATE USER 'myusername'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON *.* TO 'mydatabase'@'%' WITH GRANT OPTION;
NOTE: This allows access to the user from ALL hosts, it can be limited by replacing the
'%' with a specific hostname (such as ‘localhost’ if desired) for security.
Logging is often an overlooked performance drain on systems requiring high throughput. Here’s a simple change to the default Tomcat logging configuration to implement. It works on all operating systems.
In the file:
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler
There are a few steps that I generally take to setup a new Tomcat server instance, this enables the following:
- The manager console
- HTTP compression
- UTF-8 encoding
- tomcat-users.xml – add to bottom:
<user username="tomcat" password="s3cr3t" roles="manager-gui"/>
server.xml – add compression and URIEncoding, change port if desired:
<Connector port="8080" protocol="HTTP/1.1"
redirectPort="8443" compression="on" URIEncoding="UTF-8" />
- server.xml – relocate webapps by adding ../ to appBase
<Host name="localhost" appBase="../webapps"
- Restart your server, on Ubuntu use:
sudo service tomcat7 restart
Ubuntu continues to make great strides with improvement to the User Interface for the ‘common’ user. Unfortunately this sometimes comes at the cost of security. 12.10 added a “Guest” account to the launch screen, to allow a new session to be opened. This is not always useful as it represents a potential security concern.
A single line command and reboot will remove it:
sudo sh -c 'echo "allow-guest=false" >> /etc/lightdm/lightdm.conf'
Similarly “Remote Login” can also be hidden/removed.
sudo sh -c 'echo "greeter-show-remote-login=false" >> /etc/lightdm/lightdm.conf'
WARNING: This will cause some problems in 15.10 (and likely some earlier versions before). See the following for the new method.
sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" >/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf'
I’ve done a lot of Internationalization(I18N) and Localization (L10N) work in my various development positions. One particularly troubling area is currency support. Support of number formats is generally well supported (or can be accomplished with some trivial input translation). However, the tricky area come with support for currency symbols, western currencies such as USD (US$) and CAD(C$) and the Euro (EUR or €) are well supported across character sets and fonts some are not. One particular item is for the Indian Rupee (INR). Ubuntu 10.10 is the first operating system to ship with a font that supports this character ₹