Skip to content

Instantly share code, notes, and snippets.

View blizzz's full-sized avatar

Arthur Schiwon blizzz

  • Milky Way
View GitHub Profile
@blizzz
blizzz / testCancel.php
Created September 30, 2014 15:06
OC Paged Result Cancellation test script
<?php
$RUNTIME_NOAPPS = true;
require_once 'lib/base.php';
\OC_App::loadApp('user_ldap');
OCA\user_ldap\lib\Helper::clearMapping('user');
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
@blizzz
blizzz / batchCreateGroups.php
Created October 7, 2014 16:13
batch create ldap groups
#!/usr/bin/php
<?php
$adn = 'uid=foobar,ou=barfoo,dc=foo,dc=bar';
$apwd = 'owncloudagent';
$host = 'ldap.foo.bar';
$port = 389;
$cr = ldap_connect($host, $port);
ldap_set_option($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($cr, $adn, $apwd);
@blizzz
blizzz / batchCreateUsers.php
Created October 7, 2014 17:07
batch create ldap users
#!/usr/bin/php
<?php
$adn = 'uid=foobar,ou=barfoo,dc=foo,dc=bar';
$apwd = 'owncloudagent';
$host = 'ldap.foo.bar';
$port = 389;
$cr = ldap_connect($host, $port);
ldap_set_option($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($cr, $adn, $apwd);
@blizzz
blizzz / names.dat
Last active August 29, 2015 14:07
Names
a:2:{s:3:"sns";a:3773:{i:0;s:5:"Smith";i:1;s:5:"Jones";i:2;s:6:"Taylor";i:3;s:8:"Williams";i:4;s:5:"Brown";i:5;s:6:"Davies";i:6;s:5:"Evans";i:7;s:6:"Wilson";i:8;s:6:"Thomas";i:9;s:7:"Roberts";i:10;s:7:"Johnson";i:11;s:5:"Lewis";i:12;s:6:"Walker";i:13;s:8:"Robinson";i:14;s:4:"Wood";i:15;s:8:"Thompson";i:16;s:5:"White";i:17;s:6:"Watson";i:18;s:7:"Jackson";i:19;s:6:"Wright";i:20;s:5:"Green";i:21;s:6:"Harris";i:22;s:6:"Cooper";i:23;s:4:"King";i:24;s:3:"Lee";i:25;s:6:"Martin";i:26;s:6:"Clarke";i:27;s:5:"James";i:28;s:6:"Morgan";i:29;s:6:"Hughes";i:30;s:7:"Edwards";i:31;s:4:"Hill";i:32;s:5:"Moore";i:33;s:5:"Clark";i:34;s:8:"Harrison";i:35;s:5:"Scott";i:36;s:5:"Young";i:37;s:6:"Morris";i:38;s:4:"Hall";i:39;s:4:"Ward";i:40;s:6:"Turner";i:41;s:6:"Carter";i:42;s:8:"Phillips";i:43;s:8:"Mitchell";i:44;s:5:"Patel";i:45;s:5:"Adams";i:46;s:8:"Campbell";i:47;s:8:"Anderson";i:48;s:5:"Allen";i:49;s:4:"Cook";i:50;s:6:"Bailey";i:51;s:6:"Parker";i:52;s:6:"Miller";i:53;s:5:"Davis";i:54;s:6:"Murphy";i:55;s:5:"Price";i:56;s:4:"Bell"
@blizzz
blizzz / serverSupportsPagedResults.php
Created October 21, 2014 17:42
Tests whether the server specified by parameters supports Paged Results (RFC 2696)
<?php
if($argc < 4 || $argc === 5) {
print('Usage: php -f ' . $argv[0] . ' HOST PORT BASE [DN] [PWD]' . PHP_EOL);
die;
}
$host = $argv[1];
$port = $argv[2];
$host .= ':' . $port;
$base = $argv[3];
$dn = $argc > 4 ? $argv[4] : '';
@blizzz
blizzz / getUserGroupMemberships.php
Created November 21, 2014 11:08
displays groups belonging to a specified user and users belonging to a specified group
<?php
if($argc !== 3) {
print('Usage: php -f ' . $argv[0] . ' UID GID' . PHP_EOL);
die;
}
require_once 'lib/base.php';
\OC_App::loadApps(array('authentication'));
@blizzz
blizzz / primGrTest.php
Created January 28, 2015 10:05
Returns intermediate results on resolving a user's primary group
#!/usr/bin/php
<?php
use OCA\user_ldap\lib\FilesystemHelper;
use OCA\user_ldap\lib\LDAP;
use OCA\user_ldap\lib\LogWrapper;
use OCA\User_LDAP\lib\user\Manager;
use OCA\User_LDAP\lib\Access;
use OCA\User_LDAP\lib\Connection;
@blizzz
blizzz / primGrGetUsers.php
Created January 28, 2015 15:00
get fron and count users in a primary group
#!/usr/bin/php
<?php
use OCA\user_ldap\lib\FilesystemHelper;
use OCA\user_ldap\lib\LDAP;
use OCA\user_ldap\lib\LogWrapper;
use OCA\User_LDAP\lib\user\Manager;
use OCA\User_LDAP\lib\Access;
use OCA\User_LDAP\lib\Connection;
@blizzz
blizzz / setMail.php
Created September 25, 2015 11:19
PHP script that add's an email to an LDAP user
<?php
$dn = 'uid=zombie27755,ou=zombies,dc=owncloud,dc=bzoc';
$adn = 'uid=owncloudagent,ou=Users,dc=owncloud,dc=bzoc';
$apwd = '*******';
$mail = '[email protected]';
$host = 'ldap.owncloud.bzoc';
$port = 389;
$kv = array('mail' => $mail);
#!/bin/bash
if [ $# -ne 2 ]; then
echo "split pdf to single pages"
echo "Usage:"
echo "$0 Inputfile Outputtrunk"
echo "Example:"
echo "\"$0 input.pdf out-\" results in out-1.pdf, out-2.pdf .. out-n.pdf"
exit
fi