Skip to content

Instantly share code, notes, and snippets.

View flamencist's full-sized avatar

Alexander Chermyanin flamencist

View GitHub Profile
@flamencist
flamencist / ResetPasswordInAD.cs
Created April 8, 2020 19:34
reset password using ldap4net
using(var connection = new LdapConnection())
{
connection.Connect();
connection.TrustAllCertificates();
connection.Bind();
var attribute = new DirectoryModificationAttribute()
{
Name = "unicodePwd",
LdapModOperation = Native.LdapModOperation.LDAP_MOD_REPLACE
(function (window) {
'use strict';
function EndOfLineFormatter() {
var os = {
ANDPHONE: 9,
ANDTAB: 6,
BLACKBERRY: 10,
IPAD: 5,
IPHONE: 8,
LINUX: 3,
using System;
using System.Diagnostics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Bash
{
internal class BashExecutor
{
#!/bin/bash
readonly THEME_NAME="Windos-10-Light"
readonly CURSOR_THEME_NAME="Win8"
readonly ICON_THEME_NAME="Windows 10"
function set_theme(){
local theme=$1
local cursor=$2
local icon=$3
gsettings set org.gnome.metacity theme "${theme}"
@flamencist
flamencist / linux_openldap_pinvoke
Created February 15, 2018 21:28
linux_openldap_pinvoke
using System;
using System.Runtime.InteropServices;
namespace KerberosAuth
{
public static class NativeMethods
{
[DllImport("libldap-2.4.so.2")]
public static extern int ldap_init(string host, int port);
[DllImport("libldap-2.4.so.2")]
using System;
using Novell.Directory.Ldap;
namespace KerberosAuth
{
class Program
{
static void Main(string[] args)
{