Affichage des articles dont le libellé est Ubuntu. Afficher tous les articles
Affichage des articles dont le libellé est Ubuntu. Afficher tous les articles

mercredi 11 décembre 2013

How to add git remote repository on server

first you connect ssh to your server, then you can set up an empty repository for them by running git init with the --bare option, which initializes the repository without a working directory:

$ cd /var/www/GIT_REPOSITORY
$ mkdir newRemoteProject
$ cd newRemoteProject
$ git --bare init


then you should change the permission into this new remote repository
$chmod -R 777 /var/www/GIT_REPOSITORY/newRemoteProject

Then,all team can push the first version of their project into that repository by adding it as a remote and pushing up a branch. Note that someone must shell onto the machine and create a bare repository every time you want to add a project.

# on Johns computer
$ cd myproject
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin http://Server_Adresse/GIT_REPOSITORY/newRemoteProject
$ git push origin master

Note : the path to the remote repository is under /www because i have used gitweb with git over http.

mercredi 26 juin 2013

UBUNTU: HOW TO CHANGE THE COMPUTER NAME (HOSTNAME)




Change Your Computer Name (Ubuntu)
You might run into a situation that requires you to change your (hostname) computer name, either because you need it to meet a naming scheme or you’re just bored with it and want something better. By following these steps, you’ll give your computer a new identity in no time.
  1. To get started, press Ctrl – Alt – T on your keyboard to open the Terminal. Next, type the command below to open the hostname file.
  2. Type this commande into the terminal and remember that the current computer name is @aymen-Aspire-E1-571


gksu gedit /etc/hostname
3.   Then change the name to whatever you like and save the file.

4. Next, while command console is still open, type the command below to open the hosts file.
gksu gedit /etc/hosts

5. Finally, change the name shown to complete the change and save the file.

6. Close all open windows and restart your system.
After your system has restarted, it will have the new computer name.

How do I increase the permgen size of Tomcat Server ?





  • Increase the Heap size from the catalina.sh file



Tomcat production server sometime will hit the following java.lang.OutOfMemoryError: PermGen space error.


java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

you should increase the memory by make change in catalina.sh.

Cataline.sh is located at \tomcat folder\bin\catalina.sh
Assign following line to JAVA_OPTS variable and add it into catalina.sh file.
export CATALINA_OPTS="-Xms512m -Xmx1024m"
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 
-server -Xms2536m -Xmx2536m
-XX:NewSize=256m -XX:MaxNewSize=1024m -XX:PermSize=1536m 
-XX:MaxPermSize=1536m -XX:+DisableExplicitGC"

  • Increase the Heap size from the the Eclipse IDE


if you are using tomcat sever with eclipse you need to resolve this exception by modifying the tomcat arguments :
If you see java.lang.OutOfMemoryError: PermGen space errors, you need to increase the permanent generation space available to Eclipse.
PermGen is the permanent generation of objects in the VM (Class names, internalized strings, objects that will never get garbage-collected). An easy, if somewhat memory-hungry fix is to enlarge the maximum space for these objects by adding


  • double click on the tomcat server
  • Click to Open Launch Configuration

  • Choose the Arguments tab and add the following parameters
     -Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m





  • Be Careful !!!!
you have to be careful when increasing the heap size of your tomcat server and jvm.


 As you can see, if you allocate a large Java Heap (2 GB+) for a 32-bit JVM process, the native memory space capacity will be reduced automatically, opening the door for JVM native memory allocation failures.
you will get the following exception :OutOfMemoryError: unable to create new native thread


For a 64-bit JVM process, your main concern, from a JVM C-Heap perspective, is the capacity and availability of the OS physical, virtual and swap memory.
 What you will learn shortly is that this JVM problem is very often related to native memory depletion; either at the JVM process or OS level. For now please keep in mind that:



  • A 32-bit JVM process is in theory allowed to grow up to 4 GB (even much lower on some older 32-bit Windows versions).
  • For a 32-bit JVM process, the C-Heap is in a race with the Java Heap and PermGen space e.g. C-Heap capacity = 2-4 GB – Java Heap size (-Xms, -Xmx) – PermGen size (-XX:MaxPermSize)
  • A 64-bit JVM process is in theory allowed to use most of the OS virtual memory available or up to 16 EB (16 million TB)






samedi 15 juin 2013

Apt-Get Update: failure to fetch; can't connect to any sources

the first sample methode to resolve apt-get update errors is to add an alternate DNS servers (the public DNS servers run by Google) by putting this lines  to your /etc/resolv.conf(tested on ubuntu)


 nameserver 8.8.8.8 

also there is another  method that is the best way I have found since I run server edition and have no GUI tools! Below I will show you how :
Actually for me it made this easier by putting all into the /etc/network/interfaces file. The same configurations that you would have written to resolv.conf can now be in the same file as your network adapter configurations like the example below:


 # The loopback network interface  
 auto lo  
 iface lo inet loopback  
 # The primary network interface  
 auto eth0  
 iface eth0 inet static  
     address 192.168.1.2  
     netmask 255.255.255.0  
     network 192.168.0.0  
     broadcast 192.168.1.255  
     gateway 192.168.1.1  
     dns-nameservers 8.8.8.8  
     dns-search local  

that all !! Hope it Helps SomeOne :)