• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged ubuntu

Linux> Aliases

Jun08
2011
Written by Scott Rowley

Aliases can be a great way to more easily remember an oddball command or to shorten a long command. Aliases are stored in your .profile (or .bash_profile) or within a include file referenced from .profile.

A couple of quick examples before showing how to set them up:
READ MORE »

Posted in BASH, Ubuntu - Tagged alias, basic, conditional, epoch, ggrep, grep, if, include, linux, Perl, print, profile, reload, solaris, time, unix, whois

BASH> Colorize your ‘cat’ output

Apr07
2011
Written by Scott Rowley

Ok, well thats a bit misleading. We won’t actually be using ‘cat’ but ‘pygmentize’ and its not perfect, but its better than 1 single color

This runs on Debian/Gentoo based Linux systems

apt-get update
apt-get install pygmentize

Once thats been installed what I did was to make an alias in my .profile

alias pcat='pygmentize'

Make sure to reload your .profile if you’ve added your alias

cd ~
. .profile

Example cat and pcat outputs:
Cat OutputPygmentize Output

Posted in BASH - Tagged alias, BASH, cat, pcat, pygmentize

Web Dev> Password protect apache directory with LDAP & .htaccess

Apr06
2011
Written by Scott Rowley

First thing you’ll need to do is to enable the needed mods, ldap.load & authnz_ldap.load These come preloaded with most linux, you’ll just need to enable them.
On Ubuntu:

Enable LDAP Authentication

cd /etc/apache2/mods-enabled
ln -s ../mods-available/ldap.load ldap.load
ln -s ../mods-available/authnz_ldap.load authnz_ldap.load
apache2ctl graceful

.htaccess

You should now be able to implement the following wherever desired:
Example .htaccess file

Order deny,allow
Deny from All
AuthName "Restricted Page - login with LDAP credentials"
AuthType Basic
AuthBasicProvider ldap
AuthzLDAPAuthoritative on
AuthLDAPUrl ldap://ldap.example.com/ou=admins,o=LDAPROOT?adminUser
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
Require valid-user
Satisfy any
<Files .htaccess>
order allow,deny
deny from all
</Files>

Note that ‘?adminUser’ on the end of the AuthLDAPUrl line is whatever object you use in your configuration.

Apache Config

/etc/apache2/sites-available/default
Make sure the following is set (the default is AllowOverride AuthConfig)

AllowOverride All
Posted in Ubuntu, Web Development - Tagged htaccess, ldap, password, protect, security

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top