Skip to content

Instantly share code, notes, and snippets.

Remo Harsono remoharsono

  • Oprent
  • Indonesia
Block or report user

Report or block remoharsono

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
remoharsono / ldap_search.php
Created Oct 21, 2019
My LDAP Search Implementing Pagination
View ldap_search.php
define("LDAP_PORT", "389");
define("BASE_DN", "dc=mycompany,dc=co,dc=id");
define("PAGE_SIZE", 100); // limit
define("LDAP_USER", "");
define("LDAP_PASSWORD", 'secret');
remoharsono / ldap.php
Last active Oct 18, 2019
PHP: Login to LDAP
View ldap.php
define("LDAP_HOST", "ldap://");
define("LDAP_VERSION", 3);
function authLDAP($ldap_username, $ldap_password) {
$ret = array();
if ($ldap_connection = ldap_connect(LDAP_HOST)) {
ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, LDAP_VERSION);
if ($ldap_bind = @ldap_bind($ldap_connection, $ldap_username, $ldap_password)) {
$ret['result'] = 'OK';
remoharsono / gist:ec3631383481920aa458762b7caba19c
Created Aug 13, 2019 — forked from niczak/gist:2003485
PHP/SOAP and Microsoft Exchange
View gist:ec3631383481920aa458762b7caba19c
Proof of concept testing to see if we can get
PHP/SOAP talking to EWS. Thanks to Thomas Rabaix
for his documentation on NTLM auth in SOAP and to
Erik Cederstrand for his article on SOAP/Exchange.
remoharsono / method_chaining.php
Created Aug 8, 2019
a simple sample of PHP Method Chaining
View method_chaining.php
// taken from:
class DBManager
private $selectables = array();
private $table;
private $whereClause;
private $limit;
public function select() {
View axios_file_upload.html
<!DOCTYPE html>
<meta charset="UTF-8">
<input type="file" name="filename" id="fileName">
<input type="button" value="Upload" onclick="btnUpload_click()">
remoharsono /
Created Jul 17, 2019 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View sanitize_filename.php
function sanitize_file_name( $filename ) {
$filename_raw = $filename;
$special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', chr( 0 ) );
* Filters the list of characters to remove from a filename.
* @since 2.8.0
* @param array $special_chars Characters to remove.
* @param string $filename_raw Filename as it was passed into sanitize_file_name().
remoharsono /
Created Apr 18, 2019 — forked from rubinovitz/
A python script for downloading all of the instagram photos of a certain hashtag I wrote for a friend in 20 minutes (forgive sloppiness). Warning: you're only allowed 30 API requests an hour. Requires your own access token set as environment variable "access_token".
from datetime import datetime
import urllib2
import urllib
import json
import os
def ajaxRequest(url=None):
Makes an ajax get request.
url - endpoint(string)
remoharsono / supervisord.conf
Created Mar 20, 2019 — forked from lenciel/supervisord.conf
supervisor configuration file for sentry
View supervisord.conf
; - Shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".
; - Comments must have a leading space: "a=b ;comment" not "a=b;comment".
; Put this file in /etc/supervisord.conf
file=/tmp/supervisor.sock ; (the path to the socket file)
remoharsono /
Created Mar 16, 2019 — forked from turicas/
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <> to run this script
# Download unifont.ttf from <> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <>
from image_utils import ImageText
You can’t perform that action at this time.