This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2011 Jesper de Jong | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%s@xxx.xx' % username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - | |
# stuff we need to build from source | |
apt-get install libpcre3-dev build-essential libssl-dev | |
# get the nginx source | |
cd /opt/ | |
wget http://nginx.org/download/nginx-0.8.54.tar.gz | |
tar -zxvf nginx* | |
# we'll put the source for nginx modules in here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Fully native C++ WinRT application example | |
// Programmed by fincs | |
// | |
#include <windows.h> | |
#include <roapi.h> | |
#include <wchar.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A warning occurred (42 apples) | |
An error occurred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to be able to import ldap run pip install python-ldap | |
import ldap | |
if __name__ == "__main__": | |
ldap_server="x.x.x.x" | |
username = "someuser" | |
password= "somepassword" | |
# the following is the user_dn format provided by the ldap server | |
user_dn = "uid="+username+",ou=someou,dc=somedc,dc=local" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For example do you prefer this C++ DirectXTK code: | |
std::unique_ptr<DirectX::SpriteBatch> m_pSpriteBatch; | |
m_pSpriteBatch = std::unique_ptr<DirectX::SpriteBatch>(new DirectX::SpriteBatch(m_d3dContext.Get())); | |
Or do you prefer this C# XNA/MonoGame code... | |
SpriteBatch _spriteBatch; | |
_spriteBatch = new SpriteBatch(graphicsDevice); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Tree<T> : ICollection<T>, IList<T> where T : IComparable<T> | |
{ | |
public class TreeNode : ICollection<T>, IList<T> | |
{ | |
public TreeNode(T value, Tree<T> tree) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generate new personal ed25519 ssh key | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>" | |
# generate new host cert authority (host_ca) ed25519 ssh key | |
# used for signing host keys and creating host certs | |
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network | |
eval "$(ssh-agent -s)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name phpmyadmin.yourdomain.com; | |
access_log /var/log/nginx/phpmyadmin_access.log; | |
error_log /var/log/nginx/phpmyadmin_error.log; | |
root /usr/share/phpmyadmin; | |
index index.php; | |
OlderNewer