Posts

Showing posts with the label users

Migrate from manual-installed gitlab 7.8.1 to omnibus gitlab-ce 8.14.0

As you may already know, you can only restore your backups in the same gitlab version. So it means that you cannot move your old repositories to the newer version of gitlab using the backup/restore method. Fortunately there is another way to import those repositories into gitlab. Follow these instructions: In my case, I want to migrate my old repositories from a manual-installed gitlab v7.8.1 to omnibus gitlab-ce 8.14.0 instance which were installed on the same server. 1. Create a group folder in the gitlab-ce's repositories directory: sudo -u git mkdir /var/opt/gitlab/git-data/repositories/geniuses 2. Copy the old repositories (repositories in gitlab are bare ones): sudo cp -r /home/git/repositories/* /var/opt/gitlab/git-data/repositories/geniuses/ 3. Correct the permissions of the new folder and all of its sub-directories: sudo chown -R git:git /var/opt/gitlab/git-data/repositories/geniuses/ 4. Import the new copied repositories: sudo gitlab-rake gitlab:import:r...

Query only enabled users in MS Active Directory

You can use this filter to query only enabled users in MS Active Direcotory: (&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))

Bulk deleting users in WordPress

Image
To delete a whole bunch of users in WordPress you can do the following trick: 1. Click on Screen Option in the User screen and adjust the " Number of items per page: " do a number you want, such as 600. It will show 600 users. 2. Select all the users on the screen. 3. In Bulk Actions drop-down, select Delete , and click Apply

Active Directory authentication in Django

In this article I showed you how to authenticate users of your Django apps against a LDAP server. It's quite easy with open-sourced software huh?! But, if your current infrastructure is built on a proprietary software like MS Active Directory, you will need an extra effort to plug in your Django projects. I will show you how. Read on! Here are the important settings for django-auth-ldap module you need to set: * USER SEARCH : AUTH_LDAP_USER_SEARCH = LDAPSearch("OU=All Users,DC=MYAD,DC=COM", ldap.SCOPE_SUBTREE, ' (SAMAccountName=%(user)s)' ) * GROUP SEARCH : # Set up the basic group parameters. AUTH_LDAP_GROUP_SEARCH = LDAPSearch("OU=User Groups,OU=All Users,DC=MYAD,DC=COM", \                     ldap.SCOPE_SUBTREE, "(objectClass=organizationalUnit)") , #!important! set group type AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType() * USER FLAGS : AUTH_LDAP_USER_FLAGS_BY_GROUP = {     "is_active": ["CN=...