Skip to content

Instantly share code, notes, and snippets.

View sarahhodne's full-sized avatar
🏳️‍⚧️

Sarah Hodne sarahhodne

🏳️‍⚧️
View GitHub Profile
› irb -Ilib -I. -rldap
>> l = LDAP.new('ldap.cluenet.org')
=> #<LDAP:0x0000010097b458>
>> l.version = 3
=> 3
>> l.start_tls
=> true
>> l.search('cn=imaginary.cluenet.org,ou=servers,dc=cluenet,dc=org', '(cn=*)', :subtree)
=> [#<LDAP::Message:0x00000100952af8>, #<LDAP::Message:0x00000100952ad0>, #<LDAP::Message:0x00000100952a80>, #<LDAP::Message:0x00000100952a58>, #<LDAP::Message:0x00000100952a08>, #<LDAP::Message:0x000001009529e0>, #<LDAP::Message:0x00000100952990>, #<LDAP::Message:0x00000100952968>, #<LDAP::Message:0x00000100952918>]
>> l.search('cn=imaginary.cluenet.org,ou=servers,dc=cluenet,dc=org', '(cn=*)', :subtree)
#!/bin/sh
HOSTNAME=$(hostname -f)
USER=$1
/usr/bin/ldapmodify <<LDIF
dn: cn=atd,cn=svcAccess,cn=${HOSTNAME},ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
plugin :ping do
author 'Henrik Hodne <[email protected]>'
version Yuzu::VERSION
on :ping do |args|
raw "PONG #{args.join(' ')}"
end
end
#!/bin/sh
HOSTNAME=$(hostname)
SERVICE=$1
/usr/bin/ldapmodify <<LDIF
dn: cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: authorizedService
authorizedService: ${SERVICE}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cluenet VPN Control Panel - Cluenet</title>
<link rel="stylesheet" href="css/screen.css" media="screen, projection">
[08/15/2010 -:- 11:00:24 AM] <Curacao> A porridge of pixels is bad
[08/15/2010 -:- 11:10:31 AM] <matschaffer> Curacao: nice expression :)
[08/15/2010 -:- 11:10:54 AM] <matschaffer> danlucraft: my wife got lost in some manga, so I'm back at it again :)
[08/15/2010 -:- 11:10:57 AM] Curacao ([email protected]) left IRC. (Remote host closed the connection)
[08/15/2010 -:- 11:11:09 AM] <danlucraft> matschaffer: heh
[08/15/2010 -:- 11:11:56 AM] <matschaffer> I think I found a solution. I'm currently trying to implement a lost_shell_focus in addition to lost_application_focus
[08/15/2010 -:- 11:14:23 AM] <matschaffer> hrmm… although it might be more pragmatic to just have the project plugin refresh on gained_focus all the time
[08/15/2010 -:- 11:21:22 AM] <matschaffer> yeah, that worked. Could be some side effects, but so far everything seems to test fine
[08/15/2010 -:- 11:22:20 AM] <matschaffer> ha! nevermind. that broke a lot
[08/15/2010 -:- 11:25:21 AM] Curacao ([email protected]) joined the channel
class String
def has_newlines?
self.include?("\n")
end
end
"some oneline string".has_newlines? # => false
"some multiline\nstring".has_newlines? # => true
require 'digest/sha1'
if ARGV.first.nil? || ['-h', '--help', '-?'].include?(ARGV.first)
puts "Usage: #{$0} <glob>"
exit 1
end
files = Dir[ARGV.first].sort
files.each do |file|
#include <stdlib.h>
int main(int argc, char **argv)
{
char *command;
int i, size;
size = 0;
for (i=0; i<argc; i++) {
static VALUE rldap_msg_get_val(VALUE obj, VALUE key)
{
RLDAP_MSG_WRAP* wrapper;
char* attr;
BerValue** values;
VALUE ary;
int i, length;
BerValue* value;
char* strval;
VALUE str;