Translate

Thursday, October 22, 2015

How to Export Active Directory user information to a CSV File


Probably you may be tempted to try to export users using the  dsquery command, but   is not the best way.


When I was trying to do this, I found  a specific command to perform  this task.

CSVDE is one of the best option to export  AD users via command line. It is necessary to note that  CSVDE  has to be executed on your domain controller,otherwise it will not work.

This is the syntax:


csvde -d "OU=Finance,OU=Users,DC=Mydomain,DC=Com" -l dn,userAccountControl,sAMAccountName,userPrincipalName,whenCreate -r "(&(objectCategory=Person)(objectClass=user))" -f usersExported.csv -u


Parameters:

-d:   Distinguished name
-l :   Ldap attributes
-r :  Ldap attributes list
-f :  File name
-u : Unicode format


Wednesday, October 21, 2015

How to disable textbox autocomplete


As you may notice, your browser  is capable to suggest some options that you  have written already in the past. If you are building a  web form, you  will probably need to deactivate  the autocomplete behaviour. To do this, add the following html attribute as is shown below.



<input type="text" name='user_id' autocomplete='off' />

Thursday, September 3, 2015

How to rename a tag in GIT






In this post, I will teach you how to rename a tag in git.

Actually, it is pretty easy.


I am going to rename the tag called myOldTag to myNewTag.

Step 1: we create an alias called "myNewTag"
  
     git tag myNewTag myOldTag

  

Step 2: we delete the myOldTag  tag locally
  
     git tag -d myOldTag

  

Step 3: we tell to git repository that myoldTag has been deleted
  
     git push origin :refs/tags/myOldTag

  

Step 4: we save the changes on GIT
  
     git push --tags

  

Monday, August 10, 2015

How to create a symbolic Link in linux



Basically, to create a symbolic  link in Linux you have to use the  command called ln as follows:
  
    ln -s /var/www/myapp/web/ /html/customerapp

  
the command ls has two parameter the target(/var/www/myapp/web/) and the source (/html/customerapp). The target  is the existing file/diretory and the source the file to be created.


Wednesday, August 5, 2015

Routing Error No route matches [GET] "/users/logout"




The message "Routing Error No route matches [GET] "/users/logout" is because you are sending the request via get and should be delete, so to fix it you have two options:

 The first one  is the  better, change the tag  link_to to button_to, doing that, rails will  do  the dirty work to send it as  a delete request.

The second one is not recommended, since DELETE is the appropiete RESTFUL query , but it works. Got to devise.rb change  config.sign_out_via = :delete to config.sign_out_via = :get



 

Thursday, July 30, 2015