Configure Netbeans IDE for C/C++ (Windows)

Linux can compile C/C++ with Netbeans out of the box, as long as you have the compiler installed (like gcc and g++).

Usually the following commands are enough:

sudo apt-get install build-essential
sudo apt-get install valgrind

In Windows you have to do this manually:

  1. From https://sourceforge.net/projects/mingw/:
    1. Download mingw
    2. Install it to the suggested (default) directory. If you want to use a custom directory, make sure the selected path does not contain spaces or other special characters (like greek letters etc)
    3. From the Mingw Installation manager, click and install at least the following packages:
      1. mingw-developer-toolkit
      2. mingw32-base
      3. msys-base
      4. mingw32-gcc-g++
  2. Press winkey+pause to load Windows Settings Manager. At Advanced system settings →Advanced→environment variables:
    1. Add the following text at the end of the PATH environment variable (not user variable):
      %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin
  1. At Netbeans→Tools→Plugins:
    1. check C/C++ feature and activate it
  2. Create a new C++ project and run it:
    1. From the “Resolve Missing native tools” just click “Restore defaults”. It should autodetect the settings. If it fails there is a sample configuration at the end of the post.
  3. Restart Netbeans
  4. Preferably, logout and login too.

If you have problem configuring Mingw, here is a sample of a handy configuration (mingw at default directory):

mingwnetbeans

Install & Uninstall Java

Install Java

NOTE: if you want to develop to Android then:

  1. install an 64bit version
  2. install Oracle Java as shown below

You can use 32bit but it does not worth it.

OpenJava

If you want the default (OpenJava) then:

  1. sudo apt-get update
  2. sudo apt-get install default-jre
  3. sudo apt-get install default-jdk

Oracle Java

But preferably if you are going to develop in Java, install Sun version instead:

  1. sudo apt-get install python-software-properties
  2. sudo add-apt-repository ppa:webupd8team/java
  3. sudo apt-get update
  4. sudo apt-get install oracle-java7-installer            (or 8 etc)
  5. sudo update-alternatives –config java (to select default Java)

If you want to setup JAVA_HOME:

  1. sudo update-alternatives –config java
  2. From the menu above, write down the path of the version you want (eg /usr/lib/jvm/java-7-oracle)
  3. edit /etc/environment (vim, nano etc)
  4. add or update the line: JAVA_HOME=”YOUR_PATH”
  5. reload environment: source environment

Uninstall Java

If you want to completely uninstall java then:

  1. Remove packages:
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
  1. Purge config files:
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
  1. Remove Java config and cache directory:
sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf
  1. Remove manually installed JVMs:
sudo rm -rf /usr/lib/jvm/*
  1. Remove Java entries, if there is still any, from the alternatives:
for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g;
  1. Search for possible remaining Java directories:
sudo updatedb
sudo locate -b '\pack200'

And look for entries with jre or jdk and delete them

At the sidebar menu you can find links to scripts that do all those steps at once.

 

 

references:

https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

http://askubuntu.com/questions/84483/how-to-completely-uninstall-java

Can’t delete this file

If you can’t delete that file in windows, then:

  1. First, make sure you don’t have an app running right now that uses it (doh). Check network access too if you share it.
  2. Make sure you do have proper privileges to delete it
  3. Try unlocker to unlock and delete it
  4. Install cygwin and delete it with cygwin (really)
  5. Reboot to safe mode and delete it from there

The 4th option is the most rare and catchy, but it works very efficiently. You do have to use it if, for some reason, the filename of the file becomes corrupted.

Foobar vs Windows Media Player

When the context menu (right click) does not contain options of foobar (like “enqueue in foobar” or “play in foobar”):

http://www.christiano.ch/wordpress/2010/06/05/add-enqueue-and-play-in-foobar-options-in-mp3-right-click-context-menu/

In summary:

  1. Enable Foobar context menu via:
    1. Preferences → shell integration → enable “Folder context menus”:

pfff02

  1. Prevent Windows player from suppressing other player’s options
    1. Control panel→default programs→Set program access and computer defaults → disable the “Enable access to this program”:

pfff01

Deamazon Ubuntu

 

  1. At Ubuntu settings
    1. at → Privacy
      1. Clear “Include online results” checkbox
  2. At command prompt:
    1. sudo apt-get remove unity-lens-shopping
    2. sudo apt-get remove unity-scope-video-remote
    3. sudo apt-get remove unity-scope-musicstores
    4. sudo apt-get remove unity-webapps-service
  3. At dconf-editor:
    1. At com → canonical → unity → webapps
      1. remove everything under : allowed-domains
      2. remove everything under : dontask-domains
      3. remove everything under : preauthorized-domains

 


References:

http://askubuntu.com/questions/192269/how-can-i-remove-amazo…

http://askubuntu.com/questions/214755/how-to-remove-unity-we…

http://xchamitha.blogspot.com/2012/11/de-amazonising-ubuntu-…


repost from:

https://news.ycombinator.com/item?id=4888234

Launcher

The following settings disable default launcher of Unity

Install compiz plugins:

sudo apt-get install compizconfig-settings-manager
sudo apt-get install compiz-plugins

Open compizconfig-settings-manager

Click switcher:

  1. disable alt tab key binding
  2. disable shit alt tab key binding

Click Window management:

  1. Enable “Static Application Switcher”
  2. resolve conflicts
  3. set all anyway
  4. Click switcher
    1. set alt-tab to next window (all windows)
    2. set shift-alt-tab to previous window (all windows)

Personal portal to the Internet