Posts

How to undo Git commits ?

You'll need to "reset" the last commit by running the following git command git reset HEAD~ If you wish to undo more that one git commit, add the number of commits to be undone after the tilda, for example: git reset HEAD~3 git reset undo your commits and leaves your, previously committed files, in an unstaged state. If you would like to leave the uncommitted files in a staged state, add the parameter --soft to the reset command, for example: git reset --soft HEAD~2 From here, you can proceed with updating\committing your files.

Taming VI on Ubuntu

Install V IM proved sudo apt-get install vim Create\edit ~/.vimrc to have the following lines set nocompatible set backspace=2

Testing SOAP services using pingdom

This post  gives half the answer I needed to test SOAP services . The other half of the answer was to override the default Content-Type HTTP header added by pingdom  (Check the 11th point in the Optional Parameters section). To override the header, just add one with a blank space. This worked for me and may be for you too. Also another thing I had to do while testing web services developed using Apache Axis (I don't know which version), is that I had to specify a SOAPAction header with the value ""  (The value is 2 double quotes, not an empty value) Generally, you need successfully send a POST request to the service and find out what HEADER you are missing (i.e. to add it) or adding (i.e. to remove it). You can use SOAP UI to do that. But SOAP UI doesn't show sent HEADER by default, so you'll need to download TCPMon (Which records and displays communications), start it, and let it proxy connections on a specific port, then configure SOAP UI to use that po...

Useful Java VM options

Display possible java options:   java -X Display java default values:   java -XX:+PrintFlagsFinal -version

What plugins to install after installing Eclipse Luna for J2EE developers

This list shall be extended as time goes by ISA M2E-WTP ( http://download.eclipse.org/m2e-wtp/releases/luna/ )

maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e.

Download this file  and save it somewhere on your disk. In Eclipse/Preferences/Maven/Lifecycle Mappings dialog, click the Browse  button and select the file you just saved. While focusing on your project. (i.e. Clicking it), press Alt+F5. This will refresh your project in Eclipse. This error should be ignored now.

Things to do after installing M2E (Maven integration) on Eclipse

Open Window > Preferences Open Maven > Archetypes Click ' Add Remote Catalog ' and add the following: Catalog File:   http://repo1.maven.org/maven2/archetype-catalog.xml Description: Maven Catalog This is to add numerous archetypes in Maven's catalog so you would be able to create a project based on any of these archetypes.

AMD Catalyst™ Driver 14.6 BETA has been released for selected products

AMD Catalyst™ Driver 14.6 BETA has been released for Windows® & Linux®. What's new?: Windows:     • Performance improvements     • AMD Eyefinity enhancements     • AMD Mantle enhancements Linux:     • Ubuntu 14.04 support     • Install improvements     • Package & distribution generation options Windows 8.0 users should upgrade to Windows 8.1 to take advantage of the new features found in the AMD Catalyst 14.6 Beta. AMD Catalyst™ driver 14.6 BETA is for AMD Radeon™ HD 5000 Series Graphics products or higher. For windows users: Link For Linux users: Link

JDO error: Specified enum getter-by-value for field...

Specified enum getter-by-value for field ... gave an error on extracting the enum so just using the ordinal : null This is a very vague message that could occur due to a very common mistake. Which is writing your enum getter-by-value or value-getter methods to accept or return numbers that aren't of the type " short " I don't know if there is a way to bypass this restriction.

Install AMD Catalyst 13.12 Driver with patch on Ubuntu 13.10

This is a copy-paste post from this one only for my personal reference and just in case the original post is gone for any reason. --------------------------------------------------------------------------------- Download  amd-catalyst-13.12-linux-x86.x86_64.zip Extract it and you will get  amd-catalyst-13.12-linux-x86.x86_64.run chmod +x amd-catalyst-13.12-linux-x86.x86_64.run ./amd-catalyst-13.12-linux-x86.x86_64.run --extract catalyst cd catalyst Apply  the patch  manualy: at the end of the file  catalyst/common/lib/modules/fglrx/build_mod/kcl_acpi.c , starting with line 990, there is #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,3) if ( ! ACPI_SUCCESS ( acpi_get_table_with_size ( id , 0 , & hdr , & tbl_size ))) #else tbl_size = 0x7fffffff ; if ( ! ACPI_SUCCESS ( acpi_get_table ( id , 0 , & hdr ))) ... delete everything to the end of the file and replace with this #if LINUX_VERSION_CODE >=...

Installing Git's latest version on Ubuntu

Here are the commands to run to install the latest version of the source-control system, Git, on Ubuntu. sudo apt-get install python-software-properties #I'm not sure if this line is necessary sudo add-apt-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git

Replace\remove last occurrence of a string using regular expressions

Try this regex (^.+)b(.+$) Example (Remove the last b  character)     System.out.println("1abchhhabcjjjabc".replaceFirst("(^.+)b(.+$)", "$1$2")); Outputs (Notice the underlined portion of string)     1abchhhabcjjj ac

Fix Virtualbox clipboard (copy & paste) functionality between the host and guest machine

Image
First make sure you have this option enabled Then on your guest machine (i.e. running on Virtualbox), kill the  VBoxClient  process then run  VBoxClient-all . I'm not sure, but I strongly think this should only work only after installing the Virtualbox additions.

Ubuntu 13.10: Installing Xfce 4.12

I had a very nice impression when I tried Xubuntu. That was exactly the idea I had about linux. Stylish, very fast, space savvy and highly configurable. There is nothing I've tried to customize with Xubuntu's panels that I couldn't. Here is how to have this nice experience alongside Ubuntu's Unity sudo su add-apt-repository -y ppa:xubuntu-dev/xfce-4.10 add-apt-repository -y ppa:xubuntu-dev/xfce-4.12 apt-get -y update apt-get -y install xfce4 The -y switch is to assume "yes" to all questions Adding xfce 4.10 ppa will avoid you some dependencies problems

Linux: How to reset root's or any other user's password

I've tried this only  on Ubuntu server but it should work on all Linux-based machines. But first you must fulfill the following requirements: Have physical access to the machine Can command the machine to boot from CD or USB Have a live Linux image on a CD or a USB stick. You can usually boot an installable image and choose to "Try" Linux and not install it. Now: Boot the your machine and login to your live Linux image.  Decide on which disk does your original Linux system reside one (i.e. the one you need to reset the root password for). sudo fdisk -l Mount your original Linux system's hard drive on a directory of your choice sudo mount /dev/sda1 /media/your_drive chroot your mounted drive sudo chroot /media/your_drive Change any username's password sudo passwd (i.e. for root) or sudo passwd anyusername

Google Chrome: Middle click scrolling in Ubuntu

Middle-click scrolling doesn't work on Chrome when it's running on Ubuntu (Not sure if this also applies to all Linux distros), for a reason I do not know about. But I know a workaround (not a solution to the root cause), it's this chrome extension . After installing the extension, Remember to reload your page for the extension to take effect.

Ubuntu: Install .deb package and it's dependencies

There are 2 ways to do that A) Manually sudo dpkg -i your_package.deb (This will install the package but with the missing dependencies, if there is) sudo apt-get install -f (This will download the missing packages, after that, your are good to go) B) Or you can use gdebi . This package has 2 version, command line and one with a GUI. The GUI one integrates with your file explorer so you right-click your package, and select to open it using Gdebi. The command line version can be installed by runing this command  sudo apt-get install gdebi-core , the GUI version for GNOME can be installed by running the command sudo apt-get install gdebi . For KDE, run the following command sudo apt-get install gdebi-kde . To use the command line version of gdebi. Just run the following command sudo gdebi your_package.deb .

Ubuntu 13.10: Google chrome window closes when Ctrl+F is pressed

Image
On Ubuntu 13.10, the keyboard shortcut Ctrl+F is set to close windows ! You should simply click on that shortcut, which will allow you to pick another shortcut. You probably would like to press Alt+F4 .

Installing Eclipse Kepler on Ubuntu 13.10

I don't know an apt-get way to install the latest Eclipse Kepler for Java EE development. So you just download the archive file and extract it somewhere. I also have Juno for OC4j development so I also created a "sub" shortcut, or as it's technicly known, a shortcut group within the one shortcut we'll create on the launcher. Basically, you can run your main eclipse environment just by clicking on a launcher icon, and you can also run another application just by right-clicking this icon, and choosing the application you configured. on your ~/.local/share/applications directory, create a file and call it eclipse.desktop (Or whatever, AFAIK the name doesn't matter). Put the following in it and change the paths respectively. [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=Java EE - Eclipse Kepler Icon=/home/mgelbana/Downloads/IDE/eclipse_kepler/icon.xpm Path=/home/mgelbana/Downloads/IDE/eclipse_kepler Exec=env UBUNTU_MENUPROXY=0 /home/mg...

mysql_install_db: Can't create test file *.lower-test

When I install MySQL on an Ubuntu machine, I tend to move MySQL's data and temp directories to another locations on a bigger partition that the root's. But even after setting the correct user permissions to the new data directory, attempting to initialize the data directory to have mysql and information_schema schemas will fail, not due to not enough direcotry permissions as the error suggests, but for the security application apparmor  that is installed by default with Ubuntu. I have no interest in using this application but you probably do so you may no want to apply this solution. /etc/init.d/apparmor stop /etc/init.d/apparmor  update-rc.d -f apparmor remove apt-get purge apparmor reboot >> Apply this solution at your own risk   <<