LDAP AuthType Basic

.htaccess file should contain:


AuthType Basic
AuthBasicProvider  ldap
AuthzLDAPAuthoritative  off
AuthName  "Company users only (LDAP)"
AuthLDAPURL  ldap://LPAP.0.0.IP/ou=people,dc=company,dc=net?cn?sub
AuthLDAPBindDN cn=proxyusername,ou=role,dc=company,dc=net
AuthLDAPBindPassword password
require valid-user

 

or if you want to specify the exact user group:

 

AuthType Basic
AuthName "Company users only"
AuthBasicProvider ldap  
AuthLDAPURL ldap://LPAD.0.0.IP/dc=company,dc=net?uid NONE
AuthLDAPBindDN cn=proxyusername,ou=role,dc=company,dc=net
AuthLDAPBindPassword password
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
AuthzLDAPAuthoritative on
Require ldap-attribute gidNumber=10000

, , , ,

No Comments

Make iso on Mac OS X

drutil status
diskutil unmountDisk disk2
dd if=/dev/disk2 of=new_local_file.iso

, ,

No Comments

Remove “Comments are disabled” from pages on WordPress

I don’t think you need to say “Comments are disabled”

For example having theme in
wp-content/inove/

edit: comments.php

go to part code:

<?php if (!comments_open()) : // If comments are closed. ?>

and remove the stuff printed out.

No Comments

MySQL uninstall on Mac OS X Leopard Snow

MySQL uninstall on Mac OS X Leopard Snow

Commands to execute in terminal

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
manual edit /etc/hostconfig   -- remove mysql line
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

,

No Comments

Javascript input field validation without alert

Why

If you want to validate the html form and show nice message for the user

Javascript part

<script type="text/javascript">

function validate_input_form ( )
{
 valid = true;
 var ele = document.getElementById("missing_input_div_msg");
 ele.style.display = "none";    

 if ( document.forms["nameOfForm"]["input_name"].value == "" )
 {
 missing_input();
 document.forms["nameOfForm"]["input_name"].focus();
 valid = false;
 }
 return valid;
}

function missing_input() {
 var ele = document.getElementById("missing_input_div_msg");
 ele.style.display = "block";
}
</script>

And add modify your html form

<form method="post" id="nameOfForm" action="/"
 onsubmit="return validate_input_form()">

 <div id="missing_input_div_msg" style="display: none">
  This field should not be empty
 </div>                                        
 <input type="text" name="input_name" id="input_name"/>
</form>

, , ,

1 Comment

Comparing mysql database structure

If you have two databases and need to compare their structure. You might try mysqldump and using diff software see the differences. But the problem is that columns in tables might have not be ordered by the same way.

And here comes the script.

db_pass="password"
db_user="root"
db_name="med"
mysql  -u$db_user -p$db_pass -s -e'show tables' $db_name | tail +1 | while read TABLE
do
  echo
  echo == $TABLE ==
  mysql  -u$db_user -p$db_pass  -s -wi -e"describe $TABLE" $db_name | sort
done

And you will get tables ordered alphabetically and even columns.

Example output:

== user_info ==
Contact_information     text    YES             NULL
Description     varchar(255)    YES             NULL
Email   varchar(80)     YES             NULL
Full_name       varchar(60)     YES     MUL     NULL
Icon    blob    YES             NULL
User    varchar(16)     NO      PRI     NULL

, , , ,

No Comments

Recommended firefox plugins

Web Developer

AdBlock

SSLGuard

Modify Headers

Firebug

iMacros

ReloadEvery

User Agent Swither

,

No Comments

List open port on Mac OS

sudo lsof -i -P | grep -i "listen"

, ,

No Comments

Oracle database creation

CREATE TABLESPACE bugstesting DATAFILE
'/ora_data/dbs/bugstesting_data_upg_01.dbf' SIZE 104857600
AUTOEXTEND ON NEXT 104857600 MAXSIZE 3000M
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;

CREATE USER bugstesting IDENTIFIED BY bugstesting
DEFAULT TABLESPACE bugstesting
TEMPORARY TABLESPACE TEMP;

grant create session to bugstesting;
grant all privileges to bugstesting;
@?sql.sql

No Comments

Log cleaning in one line

You can delete old logs (-mtime +90 – here is 90 days old) :

find /var/logs/ -name "*.log.????-??-??.gz" -mtime +90 -exec rm -rf {} \;

Or you can gzip

find /var/logs/ -name "*.log.????-??-??" -mtime +7 -exec gzip {} \;

No Comments

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin