Pages

Sunday, July 20, 2014

How to install Eclipse Luna (4.4) on Ubuntu

Installing Eclipse

  1. Download Eclipse from here;
  2. Extract it. You will end up having a folder named eclipse, copy it;



  3. Press CTRL + ALT + T to open Terminal;
  4. Type the command:
    sudo nautilus
    and then insert your password;



  5. Browse to /opt/ and paste the extracted folder there.


Creating a shortcut

  1. Press CTRL + ALT + T to open Terminal;
  2. Type:
    sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse
    sudo gedit /usr/share/applications/eclipse.desktop
  3. After these commands, gedit (ubuntu's default text editor) should have opened. Copy this and paste it there:
    [Desktop Entry]
    Name=Eclipse
    Type=Application
    Exec=/opt/eclipse/eclipse
    Terminal=false
    Icon=/opt/eclipse/icon.xpm
    Comment=Integrated Development Environment
    NoDisplay=false
    Categories=Development;IDE;
    Name[en]=Eclipse
    X-Desktop-File-Install-Version=0.22


  4. Save the text file and close gedit;
  5. This should have successfully created a shortcut. You may have to log off and back in for it to show up.


Saturday, June 7, 2014

Snake for android

I've just finished another android app: Snake.

Here are the github repository and the .apk download links.

Screenshots:

Monday, June 2, 2014

Remove unwanted file that has been committed several commits ago from git repository

Recently I have been developing a contacts management program and as usual I've been using git for source code management. This program stores all the contacts info in a file, say contacts.info.

Today I bumped into a problem I had never had:
I noticed I had committed contacts.info several commits ago. As you can imagine, I had no intention of making those contacts info public. I needed to delete that file from my git repository, from all the commits I've committed since I added contacts.info.

I ended up finding a very useful tool for the job: BFG-Repo-Cleaner.

If you have a similar problem, here is a step-by-step guide on how to completely remove an unwanted file that has been committed several commits ago from your git repository:
  1. Download BFG-Repo-Cleaner;
  2. Clone a bare copy of your repository:
    • git clone --mirror https://github.com/difusal/my-repo.git
  3. Delete contacts.info from all the commits:
    • java -jar bfg-1.11.6.jar --delete-files contacts.info my-repo.git/
  4. Push the repository to save changes:
    • git push
Yes, it is just that simple! If you browse through your past commits, any trace of contacts.info should now have been completely deleted.