To retrieve a particular page from another web site using basic authentication, use this PHP script: <?php $path = $_GET[‘path’]; $username = “username”; $password = “password”; $uri = “https://example.com/$path”; $ch = curl_init($uri); curl_setopt_array($ch, array( CURLOPT_RETURNTRANSFER =>true, CURLOPT_USERPWD=> “$username:$password”, CURLOPT_HTTPAUTH=> CURLAUTH_ANY, CURLOPT_VERBOSE => 1 )); $out = curl_exec($ch); curl_close($ch); echo $out; ?> Use the path of […]
Using Curl With PHP to Retrieve Pages With Basic Authentication
Customizing the MediaWiki Toolbar Signature
One reason I enjoy the world of open source so much is that if I want something to be a certain way, I can make it be that way if I spend enough time. As an example, I use MediaWiki as a simple blog. It allows me to easily make an entry without much fuss. […]
Installing A Certificate on Chrome
Go into Chrome Settings: Way down at the bottom, click Show advanced settings. Find the HTTPS/SSL Manage certificates button: Push the button and you will be in Certificate manager: Click import, and you will be asked for the certificate. Navigate to your .p12 file and import: Enter your password and click OK when you see […]
Installing A Certificate on Firefox
Go to Options, select the Advanced icon, and the Enryption tab. Make sure that USE TLS 1.0 is checked, and click View Certificates: Click view certificates. Click the Your Certificates tab: Clikc Import. You will be asked to select your .p12 file: Enter the password for the certificate. You are only asked this when you […]
Installing A Certificate on iOS
Email yourself the .p12 cert, and open it: Install: Install now. Enter the password for the cert: Done when ready: If the certificate is a WebID, this is what it looks like: Choose a personal store: This is the cert we created in this article:
Installing A Certificate on Internet Explorer
In Internet Options, select Content: Click on Certificates: Click Import: Next to proceed. Find your certificate. In this case it is a WebID file: Enter a password for the key if there is one (don’t worry, you only have to enter this when you import the key the first time): Choose a personal store: Choose […]
Creating Your Own WebID Using Openssl
Create a configuration file like this: [ req ] default_md = sha1 default_bits = 2048 distinguished_name = req_distinguished_name encrypt_key = no string_mask = nombstr x509_extensions = req_ext UID = netadmintools UID_default=”https://netadmintools.com/foaf.rdf#me” [ req_distinguished_name ] commonName = netadmintools.com commonName_default = WebID for NetAdminTools Webmaster [ req_ext ] subjectKeyIdentifier = hash subjectAltName = critical,@subject_alt basicConstraints = CA:false […]
Creating an htpasswd file for NGINX
There is a python script available here that will create an htpasswd file. Here is how you configure the NGINX configuration file: location / { ……………………….. auth_basic “Restricted”; auth_basic_user_file /opt/nginx/conf/htpasswd; ……………………….. } Here is how you use the utility: /opt/nginx/conf# htpasswd.py -c -b htpasswd username password Just restart NGINX and you will get a basic […]
Backing up WordPress via Import/Export
It is quite easy to back up and restore WordPress with the WordPress Importer plugin. First, back up your blog by going to your dashboard, and tools/import: To restore your articles to another system, just select import and the WordPress: Choose the file that you exported: Assign the author as you wish. For us, we […]
Adding Hostname to WordPress
We often move our WordPress install around to different machines, and wanted to know what host the WordPress install serving the page was. We are using the mon-caheir theme, as part of MCJ, but this should work similarly with other themes. Edit wordpress/wp-content/themes/mon-cahier/header.php, find the line that contains site-description, and change it so it looks […]
We’re Back on Mosaic Again…
Back when NetAdminTools started out in 1997, NCSA Mosaic was still being maintained (back when a friend was a friend). Mosaic was a decent choice for a browser back then, especially on GNU/Linux distributions. Today it is useful to see just how Frankenstein your site looks without Javascript and CSS. Sure… it is less and […]
Apache and System V IPCs
Apache and some other programs need System V Inter-Process Communication (IPC) enabled in the Linux kernel. If you get this error when starting Apache: [emerg] (38)Function not implemented: Couldn’t create accept lock then it is possible that System V IPC is not enabled. If you are creating a custom Linux kernel, the option you want […]
Quick and Reasonably Secure WordPress install
Rather than relying on the security provided by the default WordPress install, we have utilized some other security measures. We changed the prefix to the wordpress table names so zero-day SQL exploits which depend on default installations will not work. Defeating zero day exploits is significant because new WordPress vulnerabilities emerge often, and exploits may […]
HTML Color Chart
Here is an HTML Color Chart:
Fixing Access Denied Error When Activating Office SharePoint Server Publishing Infrastructure
If you don’t activate Publishing Resources when you first install SharePoint (MOSS 2007), when you try and activate it later via site collection features, you might see an access denied error when activating. You can manually activivate Publishing Resources via stsadm: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> stsadm -o activatefeature -name PublishingResources -url http://website Operation […]
Changing Administration Port on SharePoint 2007
SharePoint 2007 chooses a random port for administration. This is particularly difficult when choosing the single server configuration. Use the stsadm command to change the administration port number on MOSS 2007 / WSS 3.0. Go to this directory: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> Enter this command: stsadm -o setadminport -port 4444 It will take […]
Setting Joomla Directory Permissions
The main thing that needs to be changed during a Joomla install is the directory permissions. Here is a shot of the install application before fixing the permissions: administrator/backups Unwriteable administrator/components Unwriteable administrator/modules Unwriteable administrator/templates Unwriteable cache Unwriteable components Unwriteable images Unwriteable images/banners Unwriteable images/stories Unwriteable language Unwriteable mambots Unwriteable mambots/content Unwriteable mambots/editors Unwriteable mambots/editors-xtd […]
Converting RSS Feeds to HTML with Perl
There is an old perl script called rss2html.pl available here that will convert XML feeds to HTML.. Let’s take the Security Focus feed (http://www.securityfocus.com/rss/vulnerabilities.xml) and create some HTML: perl rss2html.pl http://www.securityfocus.com/rss/vulnerabilities.xml Here is what the output looks like when rendered: SecurityFocus Vulnerabilities Vuln: TWiki Arbitrary File Upload Vulnerability Vuln: OpenOffice Arbitrary Macro Execution Vulnerability […]
Implications of JavaScript Onkeypress Event and AJAX
Check out this article: Using JavaServer Faces Technology with AJAX This shows a web application that will autocomplete what you type by sending data from a partial field entry to the server. These partial field entries are a web request of some kind to some site. This shows the fine line between endpoints of a […]
Setting Background and Font Properties with CSS
If you wish to simply set a default background color and font style for your web pages, create a css file like this: body { background-color: #000000; font-size: 14pt; color: #00FF00; font-family: monospace ; } td { background-color: #000000; font-size: 14pt; color: #00FF00; font-family: monospace ; } pre { background-color: #000000; font-size: 10pt; color: #00FF00; […]