Recent Notes
Displaying keyword search results 111 - 120
Created by voodoo on April 14, 2011 13:16:18
Last update: April 14, 2011 13:17:48
From Fedora Project wiki : A security context , or security label , is the mechanism used by SELinux to classify resources, such as processes and files, on a SELinux-enabled system. This context allows SELinux to enforce rules for how and by whom a given resource should be accessed. A security context is typically shown as a string consisting of three or four words. Each word specifies a different component of the security context, namely, the user , role , type , and level of that file or process . Each word is separated by a colon. Use the -Z switch to display security context info. Display security context for Apache files:
$ ls -Z /var/www/ drwxr-xr-x. root root system_... Display security for files under...
Created by woolf on April 12, 2011 09:20:08
Last update: April 12, 2011 09:20:08
First try (this lists files by directory, including directories themselves):
ls -R -lrt
Second try:
find . -type f | xargs ls -lrt
Created by James on April 04, 2011 19:41:51
Last update: April 04, 2011 19:41:51
Use the nodeName attribute to get the name of the HTML tag, tagName is not recommended .
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by Dr. Xi on April 01, 2011 12:59:10
Last update: April 04, 2011 14:14:17
To configure Tomcat HTTP Basic Authentication with SSL:
Configure web app for basic authentication (add these in web.xml ):
<security-constraint>
<web-resource-collec...
Three elements are needed for this to work: security-constraint with the url-pattern to protect, login-config for the type of authentication method to use, and security-role for the role name(s) used in the security-constraint .
Add login info to conf/tomcat-users.xml :
<tomcat-users>
<role rolename="testUserRole...
Turn on SSL in conf/server.xml :
<Connector port="8443" protocol="HTTP/1.1" SSLEnab...
For default keystore file ${user.home}/.keystore , the keystoreFile attribute can be omitted. Otherwise, add keystoreFile="/path/to/keystore/file" .
The setup is different if you are using APR .
Created by James on March 29, 2011 11:37:53
Last update: March 29, 2011 11:37:53
The test page below reports the column and row indexes of the table cell you clicked.
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by James on March 29, 2011 11:34:53
Last update: March 29, 2011 11:34:53
The width() function returns the width of an element. The test page below shows how to retrieve widths for table cells. The row parameter can be omitted if columns in all rows are of same width.
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by James on March 29, 2011 11:28:33
Last update: March 29, 2011 11:30:12
The test page below shows how to count the number of columns for a given table row with jQuery:
$('table tr:eq('+row+') td').length
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by James on March 29, 2011 11:25:35
Last update: March 29, 2011 11:25:35
With jQuery, it is pretty easy to access a table cell: just use the $('table tr:eq('+row+') td:eq('+column+')') selector. Below is a test page:
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by Dr. Xi on October 16, 2008 20:45:40
Last update: March 28, 2011 20:23:22
Java's built-in classes are way too complex/flexible for a simple protocol like HTTP. This is a wrapper to simplify HTTP GET and POST.
import java.io.*;
import java.net.*;
imp...
A simple test:
import java.io.*;
import java.util.*;
...
Created by Dr. Xi on March 28, 2011 15:54:20
Last update: March 28, 2011 15:54:20
From the nc man page:
The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6.
To bind to port 8080:
nc -l 8080
To connect to the port above
nc localhost 8080
Type something in either window it will be echoed in the other.
To get the home page of google:
echo -e -n "GET / HTTP/1.1\r\nHost:www.google.com\...
To send email via SMTP:
nc -C localhost 25 << EOF
HELO host.example.com...
Port scan of localhost:
$ nc -z localhost 20-8080
Connection to localho...