Querying Active Directory Information

There are multiple ways of querying for a user’s information from Active Directory. If you are a fan of writing scripts, you can use PowerShell  [AdsiSearcher] type accelerator. However, if you are more of a visual GUI person, you can use DSQuery  tool that’s comes with Windows 7.

To run the tool, open CMD window, and type the following command:

"C:\Windows\System32\rundll32.exe" dsquery.dll,OpenQueryWindow

This will bring up a GUI where you can search active directory for users by their username, email or full names.

Creating Keyword shortcuts for long URLS

One of the ways of saving websites you visit often is by bookmarking them. This makes it easier for you to visit all your favorite websites without memorizing their web addresses. However, since there are so many useful websites out there, our bookmarks tend to be filled with things we found to be interesting, but don’t visit that often. This makes the bookmarking feature not that useful for storing the websites you visit daily.

If sites or pages on a site that you visit often have a very difficult to remember address (I.e http://corp.server-120423.domain.company.net/daily-reports-for-assets-allocation.html), you can create shortcuts so that instead of typing all of that, you can visit the same page by typing : asset-reports.

To do this, we leverage the ability to create custom search engine shortcuts in chrome:

  1. Right Click on Address Bar
  2. Click on “Edit Search Engines”
  3. Scroll to the “Other Search Engine” Section and click “Add”
  4. Give your shortcut a name, then the keyword you want to type (i.e asset-reports)
  5. Give the actual url that it should redirect to and click Add.
  6. Enjoy!

The following GIF shows the steps:

Resolving Multiple SLF4J Binding Warning

If you develop in Java long enough, you will eventually come across the Multiple Binding warning that looks something like the following:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/app/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/app/.m2/repository/org/slf4j/slf4j-log4j12/1.7.24/slf4j-log4j12-1.7.24.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/app/.m2/repository/org/apache/hive/hive-jdbc/1.1.0/hive-jdbc-1.1.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

In this specific case, the warning is stating that SLF4J was found in three different packages (logback-classic, slf4j and hive). Then it states which binding it actually picks up.

This is a warning that should have no consequences if left alone. As the SLF4J link mentioned in the warning notes:

The warning emitted by SLF4J is just that, a warning. Even when multiple bindings are present, SLF4J will pick one logging framework/implementation and bind with it. The way SLF4J picks a binding is determined by the JVM and for all practical purposes should be considered random. As of version 1.6.6, SLF4J will name the framework/implementation class it is actually bound to.

Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J’s purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways.

However, if you are a perfectionist like me, you don’t like seeing this warning every time you run your program. It’s pretty easy to remove the warning. You go through the packages that have SLF4J bindings, and exclude it from the dependency.

For example, if the binding was found in Hive, you update from dependency declaration to:

<dependency>
  <groupId>org.apache.hive</groupId>
  <artifactId>hive-jdbc</artifactId>
  <version>1.1.0</version>
  <classifier>standalone</classifier>
  <exclusions>
   <exclusion>
    <artifactId>jetty-all</artifactId>
    <groupId>org.eclipse.jetty.aggregate</groupId>
   </exclusion>
   <exclusion>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-log4j12</artifactId>
   </exclusion>
  <exclusion>
     <groupId>log4j</groupId>
     <artifactId>log4j</artifactId>
   </exclusion>
  </exclusions>

 </dependency>

Moving Uncommitted changes to new branch

If you’ve made changes that you would not like to the current checkout branch, but rather create a new branch for it, you can do so by creating a new branch first, and then committing the changes:

1. Create a new branch (before committing your changes)

git checkout -b <new-branch-name>

2. Add,commit and push your changes

git add src/main/java/somefile.java
git commit -m "my new changes"
git push origin <new-branch-name>

Stack used by popular websites

If you want to know what technology your favorite website uses, you’re often left with guessing or trying to figure it out by looking at website’s source code. And this only helps with learning what front end libraries they might be using.

There are a few resources available now to find what’s powering your favorite websites.

High Scalability is a website that gathers interviews and open information available on technology stack of various websites in one place:

Built With