Posts

Showing posts with the label linux

Shorthand for nmap to scan all ports

Simply write a dash ( - ) after the -p switch as follow: nmap 1.2.3.4 -p- #1

Linux : Run commands consecutively and grep output of all of them

Simply enclose the commands you want to grep in parentheses. Examples : > (./task1.sh && ./task2.sh) | grep "fail" > (./task1.sh ; ./task2.sh) | grep "error"

Browse entire Active Directory catalog from apache/svn

If you want subversion to be able to browse your entire Active Directory catalog, you have to use the port 3268 (globalcatLDAP) instead of the 389 in your apache configuration: AuthLDAPURL "ldap://youradserver:3268/DC=yourdomain,DC=local?sAMAccountName?sub?(objectClass=*)" #1 #2

linux : show current subfolders size

The following command show the size used by each subfolder in the current folder ordered by size and in a human readable format : paste <(du -xs *) <(du -xhs *) | sort -n | cut -f3,4

Use squid on ubuntu server linked with a domain controler in order to force NTLM authentication

(This installation was made on an ubuntu server 10.10) Install squid: sudo apt-get install squid You can already test the installation by configuring your web browser to use your server on port 3128 as the proxy server. You should receive an error web page generated by squid or the requested web page. In order to request your active directory server, you have to install the following packages: sudo apt-get install samba krb5-user libpam-krb5 winbind During the installation, you could be prompted for some information. Just leave the default values, we will modify the config files later. Edit /etc/krb5.conf and add or edit the following values : [libdefaults] default_realm = YOURDOMAIN.COM [...] [realms] STARWARS.LOCAL = { kdc = dc admin_server = dc default_domain = YOURDOMAIN.COM } [...] [domain_realm] .yourdomain.com = YOURDOMAIN.COM yourdomain.com = YOURDOMAIN.COM [...] where yourdomain.com is your network domain (respect the character casing !) and dc i...