Search For curl

FREE THOUGHT · FREE SOFTWARE · FREE WORL

  Search Feed

Google

Clusty

Ask.com

Yahoo

Bing

Technorati

PortaPutty Auto-Reconnecting SSH Tunnels on an Encrypted TrueCrypt Portable USB Key w GPG

Ok I just came back up to write the intro.. I’m trying to keep it short to avoid getting bogged down by the coolness of each step. Here is what goes on. When I logon to my XP machine at work, I bring my usb key and plug it in first. On logging a window pops up first and it’s a password prompt to mount my encrypted drive leonardo. It also checks a keyfile that is located on my usb key, but all I do now is type in my password. That causes my encrypted folder to be accessible to me like a normal drive, and it autoruns a startup batch file.

The batch file causes Portable versions of Firefox (all my bookmarks, my settings) to load, and launches Portable Mozilla Thunderbird (IMAP makes this work well), which is my favorite program (great GPG features and open-source!). Also Some Adobe CS4 software is loaded from the hard drive, like DreamWeaver. In the background, a service we created executes a PortaPuttY plink command to create forwarded tunnels from various remote servers and accounts, all using key-based encryption. These tunnels are automatically reconnected if they are disconnected, meaning you can use a socks 5 if you want or even better!

Part 1 of 5

Tagged: , , , , , , , , | 4 Comments | Continue...




Custom bash_profile for Advanced Shell Users

Looking for some advanced uses for the shell? Here is some of my best. The shell is where 70% of my work takes place, and I have at least one terminal open almost 100% of the time, for viewing tailing color-coded logs, and of course for the SSH Tunnels that I use to route various networking through, like my email. So I decided that to standardize and create a bash_profile containing the most time-saving and helpful functions that I could use on all the various hosting environments would really be some sweet sugar, so here is my constant Work-in-progress.

It works for all shells I encounter, including BackTrack, Debian, Knoppix, Arch Linux, etc. Also works for many hosting environments I use including DreamHost, HostGator, WiredTree, and pretty much any linux VPS.

I also rely on this heavily from within shell scripts I write to access all the functions and stuff in this .bash_profile, and to do that I just do like:

#!/bin/bash
 
source ~/.bash_profile &>/dev/nulll
 
pm "PM is a function to output nice messages with color"
yn "Are you enjoying the shell" && pm "Thats great!" || pm "Perhaps you're better suited for DOS"
yn "Show Calendar" && aa_calendar
yn "Show Fortune" && aa_fortune

Tagged: , , , , , , , , , | 4 Comments | Continue...


Optimizing Servers and Processes for Speed with ionice, nice, ulimit

NICE Levels ChartTo prepare for several upcoming articles on AskApache that are focused on optimizing Servers and Sites from a server admin level, here is an article to introduce the main tools that we will be using. These tools are used to optimize CPU time for each process using nice and renice, and other tools like ionice are used to optimize the Disk IO, or Disk speed / Disk traffic for each process. Then you can make sure your mysqld and httpd processes are always fast and prioritized.

Tagged: , , , , , , , , , , , | 2 Comments | Continue...


Mirroring an Entire Site using Rsync over SSH

Website Mirrors with RsyncSometimes there is an urgent need for creating an exact duplicate or “mirror” of a web site on a separate server. This could be needed for creating Round Robin Setups, Load-Balancing, Failovers, or for just plain vanilla backups. In the past I have used a lot of different methods to copy data from one server to another, including creating an archive of the whole directory and then using scp to send the file over, creating an archive and then encrypting it and then sending that file over using ftp, curl, etc., and my persistence at learning new ways to do things has paid off because now I use rsync to keep an exact replica of the entire directory on an external server, without having to use all the CPU and resources of other mirroring methods.

Tagged: , , , , , , | 1 Comment | Continue...


Password Protection Plugin Status

Enumerating Permissions can be Annoying

Don’t ask me how because I won’t tell you, but on one of the hosts I was testing on that did not allow direct access I was able to get the Apache server running as dhapache to erroneously write a file into my users blog directory. This is a big security no-no and I now have my .htaccess file written into the blog directory where it should go, but instead of my php script’s user having write access to the file so I can modify it, its owned by dhapache! Because the file is owned by dhapache I shouldn’t even be allowed to know it exists, but there it is. So the next step was to try and take ownership of the .htaccess file so that I could modify it. I tried and tried but was unsuccessful, I couldn’t modify it so that was another dead end. Actually it took me awhile to figure out how to remove the file from my directory. Being that it was owned by dhapache I couldn’t delete or modify it using my php process or even through ftp/ssh! Sysadmins regularly run find commands that search the servers for any files owned by dhapache that should not be there as this is a big red flag that someone has found a way to manipulate dhapache which could potentially lead to modifying dhapache-owned server config files, which sometimes is all it takes to hack your website and server.. Luckily I was able to delete it by basically running the hack again to overwrite the file.

Tagged: , , , , , , | 2 Comments | Continue...


Serve External Javascript Files locally for Increased Speed

One way I speed up AskApache.com is by downloading external third-party javascript files to host on my own server instead of externally. In addition to the obvious speed boost, this lets you configure the caching and compression settings for the files.

Tagged: , , | 5 Comments | Continue...


About AskApache

Purpose and Goal of AskApache
To provide free access to knowledge and data with the goal of empowering people.. or more melodramatically: “Power to the People!”
Why the name AskApache? AskApache was chosen to show and pay respect to the contributors of the Apache Web Server. Literally it means to ask Apache when facing a problem, by searching the Open-Source, contacting a board/list, or browsing the documentation.
The Author
I work for a multimedia production / brand development & marketing company here in Indianapolis, the greatest city in the world! I started this blog in Dec., ‘06 to familiarize myself with WordPress as a blogging platform among other things for my job. I help expand/create a growing companies market-share online (and offline) by managing and building the brand and developing high-quality leads and loyal customers by building online funnels fed by SEO traffic and on/offline marketing campaigns. Other than the design and development costs for our minimum 12 month contract, we operate using a gain-share formula where we receive a percentage of the increased revenue that results from our services. This translates to fanatical attention to improving the bottom-line, and focus on long-term sustainable growth and overall success.
It’s important to me to note that unlike most systems set up like this, we are absolutely interested in creating customers/leads/whatever by providing real value for them. It’s much more difficult and takes a lot longer, but it is also self-sustaining as value attracts in an exponential manner. We are likely different than any model you’ve seen before in terms of lead-sales-marketing types.
My Background
I started on DOS, then Windows 2.11 (released 1989), and learned BASIC for my first language… then IBM PC assembly followed by Java, which I used as an excuse to stop learning assembly.. …

5 Comments | Continue...


Pimp out your FeedBurner Count

I’ve had a lot of people ask about the FeedBurner FeedCount image on AskApache. Specifically how to set it up with custom messages and different colors each page view… It is pretty sweet..

Tagged: , , , | Continue...


Fsockopen Power Plays

PHP’s fsockopen function lets you open an Internet or Unix domain socket connection for connecting to a resource, and is one of the most powerful functions available in the php language.

Tagged: , , , , , , , , , | 3 Comments | Continue...


Blocking Bad Bots and Scrapers with .htaccess

Block Bad RobotWant to block a bad robot or web scraper using .htaccess files? Here are 2 methods that illustrate blocking 436 various user-agents.

Tagged: , , , , , | 17 Comments | Continue...


Crazy Cache WordPress Plugin Released

AskApache Crazy Cache WordPress PluginA WordPress plugin that caches your entire blog for WP-Cache, I love this plugin and finally released it to the public!

19 Comments | Continue...


Faster Form Submission and Processing with fsockopen

Speedy Forms using background-requestsPart II: Example illustrating how to speed up GET/POST form submissions. Uses fsockopen to initiate a server-side background request to process the submitted data, so that the result page of the form is displayed to the client lightningly quick.

Tagged: , , , | 3 Comments | Continue...


Faster POST and GET Form Submissions… Shazam

Snoopy Fsockopen HTTP Class for PHPJust a very brief look at speeding up form submission by delegating the processing and bandwidth to your server, not your client.

Tagged: , , , , , , , , | 1 Comment | Continue...


Speed Up Google Analytics, use local ga.js

Google Analytics ga.js SpeedHost Google Analytics ga.js file locally for increased speed! Makes web pages load faster.

8 Comments | Continue...


Fetch Feed Subscribers from Google Reader with CURL

PHP CURL is a binding that uses libcurlPHP curl example utilizing cookies, POST, and SSL options to login to Google Reader and fetch the number of subscribers for a particular feed url.

2 Comments | Continue...


Fetch Feed Subscribers from Google Reader

Powered By

Continue...


SetEnvIf and SetEnvIfNoCase Examples

SetEnv, SetEnvIf, and SetEnvIfNoCase directives conditionally set environment variables accessible by scripts and apache based on HTTP Headers, Variables, and Request information.

Tagged: , , , , , | 4 Comments | Continue...


HTTP Status Codes and .htaccess ErrorDocuments

There are a total of 57 HTTP Status Codes recognized by the Apache Web Server. Wouldn’t you like to see what all those headers and their output, ErrorDocuments look like?

Tagged: , , , , , , , | 19 Comments | Continue...


PHP5 Custom Install Shell Script Example

Today I successfully learned how to compile and run multiple custom php installations for a DreamHost account, and to get it working I came upon a simple shell script that I made a couple changes to.

1 Comment | Continue...


The Latest and Greatest php.ini

Grab the latest php.ini developmental version and discover new or previously hidden php runtime configuration settings… ahead of everyone else!

Continue...


Awk Tutorial and Introduction

While researching a unix/linux tool awk I came upon one of the most thorough and helpful tutorials I’ve ever seen devoted to a particular topic. It’s old-school just the way I like it. I contacted the author, Bruce Barnett because I just HAD to have this article for my readers, who are predominantly running solaris/unix/bsd/linux and he kindly gave permission.

1 Comment | Continue...


Online Dojo JavaScript Compressor/Obfuscator

ATTN: I’ve moved to a new server recently and haven’t had time to get this back up yet.. For now I highly recommend Arthur Blakes Compressorator, which totally kills any other online js compressor suite..
AskApache Online Javascript Compressor
So how does this all work? And why should anyone choose this tool over the other ones that are available. The answer to both of those questions is in the design of the the Dojo compressor. Instead of brittle regular expressions, the Dojo compressor is based on Rhino, a JavaScript engine from the Mozilla project.
Being based on a real parse stream, the Dojo compressor can get a better idea for the context of a token (variable name, etc.) than the regular-expression based tools. This allows us to achieve the over-riding goal of a compressor that would be acceptable to the Dojo project: it must never mangle a public API.
API Safety
There are many “obfuscators” available in addition to size reduction tools. Over the years, many people have attempted to “encrypt” or otherwise obfuscate JavaScript sent over the wire to browsers, and it never pans out. Why not? For starters, JavaScript (as implemented in browsers) is completely interpreted. This means that any further compilation beyond source transformations will not work everywhere, and the tool provides a “decryption” tool along with the “encrypted” or obfuscated source, the unencrypted version will be available at runtime for anyone with a debugger to see. For those tools that just transform source code by mangling variable names, it’s even easier to revert their changes. Therefore, obfuscation and encryption aren’t useful goals. Size reduction, on the other hand, is a useful goal.
But not if your size-reduction tool breaks things. There are, of course, many increments available for the “compression” process. Potential choices available to a tool author include:

removing…

Comments OffContinue...


Login to Google AdSense using PHP

Demo php cURL code, that automatically logs into Google AdSense, using cookies and post fields with the POST method.

1 Comment | Continue...


Speed Up Google Analytics with urchin.js

Update: This article is a bit dated, to get the newest and latest Google Analytics Speed Tips, check out the 3 part update about Hosting, Cookie Domains, and JavaScript Loading and Failproofs

Ever notice that sometimes your sites take a while to load all the way because google’s urchin.js file is taking forever? You may recognize this problem when you see something similar to this in your browsers status bar “Transferring data from google-analytics.com…”

Time To Setup?
4 minutes I got tired of seeing that all the time and so I set up an automated cronjob that runs every 12 hours and downloads the latest version from google, and saves it to my website directory, then I reference /urchin.js instead of http://www.google-analytics.com/urchin.js.. and my site loads a lot faster!
Take a look at the source for this page if you want to see what is going on (look at the bottom)
There are 2 pretty major things that you accomplish by hosting urchin.js locally

You Enable persistant connections
You ensure that the correct 304 Not Modified header is sent back to your site visitors instead of reserving the entire file.

The urch.sh shell script
Create a shell script called urch.sh.. this will be executed every 1/day or 1/wk, whatever you want. The following script removes the local urchin.js, then it wgets the latests version into the local directory.
#!/bin/sh
rm /home/user/websites/askapache.com/z/j/urchin.js
cd /home/user/websites/askapache.com/z/j/
wget http://www.google-analytics.com/urchin.js
chmod 644 /home/user/websites/askapache.com/z/j/urchin.js
cd ${OLDPWD}
exit 0;
Improved shell script
I realized right away that a more modular shell script would be needed.. I admin like 50+ web-sites and it would be stupid to have to type the same block of code 50 times, wget the same file 50 times, etc.. So this version downloads the urchin.js file into a temporary directory, then it copies it OVER the old file for each directory. So 1 GET request…

Tagged: , | 11 Comments | Continue...


Downloading Multiple Files with Curl Simultaneously

Wouldn’t it be great if you could use php and curl to download multiple files simultaneously using built-in curl functions? You can!

11 Comments | Continue...


Rigging the DreamHost Site of the Month Contest

Since I was disqualified and accused of cheating, which is absolutely false, I decided to go ahead and do the crime I have been punished for. That’s right, I’m going to show YOU how I could have rigged the DHSOTM contest to hopefully make the statement that I absolutely did not cheat and I absolutely want to be re-instated as the winner.

Continue...


SEO Redirects without mod_rewrite

Web Professionals use mod_rewrite to issue 301 and 302 Redirects for Search Engines. Sometimes you may not have mod_rewrite.c or you want an alternative redirect method. Using mod_alias RedirectMatch you can use REGEX in Redirect commands!

Tagged: , | 11 Comments | Continue...


301 Redirect with mod_rewrite or RedirectMatch

301 Redirects using Apache mod_rewrite or RedirectMatch in .htaccess or httpd.conf

4 Comments | Continue...


Control htaccess Basic Authentication with PHP and mod_rewrite

Control htaccess Basic Authentication with PHP and mod_rewrite

4 Comments | Continue...


DreamHost Server IP Address List

A list of all DreamHost Servers and corresponding IP address. The dreamhost.com DNS zone is currently having troubles, so most hostnames within this zone are not resolving.

4 Comments | Continue...


Sending POST form data with php CURL

CURL Guide for sending POST data form request with PHP and CURL

Tagged: , , , , | 17 Comments | Continue...


Custom PHP.ini tips and tricks

Tagged: , , | 9 Comments | Continue...


Fight Blog Spam with Apache

Fighting Blog Spam with Apache htaccess and other methods.

1 Comment | Continue...


HTTP Packet Capturing to debug Apache

This article is a quick and easy HowTo detailing the use of Wireshark or another network sniffing program to debug your Apache .htaccess or httpd.conf files.

1 Comment | Continue...




Youtube experiment.. just testing!.. 5 autostarting songs..
My Picks


The love of liberty is the love of others; the love of power is the love of ourselves.
-- William Hazlitt


Newest Posts
Tech Topics
Website Speed Tips Series
  1. Turn On Compression
  2. Add Future Expires Header
  3. Add Cache-Control Headers
  4. Turn Off ETags
  5. Remove Last-Modified Header
  6. Use Multiple SubDomains

Good Causes

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. Tim Berners-Lee



It's very simple - you read the protocol and write the code. -Bill Joy

HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C | TLDP | WAI | DISA | ICSI | GIAC | SANS RR | GHOST | DEFCON | NIST | DHS CYBER | NIST | Phrack | GDB | IEEE | GIT | GNU LIBC

↑ TOPExcept where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. HTTPD based on NCSA HTTPd

Site Map | Contact Webmaster | Email AskApache | Glossary | License and Disclaimer | Terms of Service