Skip to content

Instantly share code, notes, and snippets.

View chandraprakashdwivedi's full-sized avatar
💭
cool

CP chandraprakashdwivedi

💭
cool
View GitHub Profile
<?php
$ldap_dn = "uid=".$_POST["username"].",dc=example,dc=com";
$ldap_password = $_POST["password"];
$ldap_con = ldap_connect("ldap.forumsys.com");
ldap_set_option($ldap_con, LDAP_OPT_PROTOCOL_VERSION, 3);
if(@ldap_bind($ldap_con,$ldap_dn,$ldap_password))
echo "Authenticated";
@chandraprakashdwivedi
chandraprakashdwivedi / gist:87ab8367eae70bdc1b4530a8ab842ec0
Created February 1, 2018 03:17 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys