Tuesday, May 25th, 2010
This amazing bash linux prompt does more than meets the eye. If you want to know how to become really good with technology, linux is the secret sauce behind the AskApache articles. Open Source is elixir of the web. Thanks to everyone who helped me for the past 20 years. I use linux/bsd because homey don’t play, so this is geared to be as productive a prompt as I can make it.
Don’t have much time.. or just don’t care? Not a problem, here are the 3 lines to copy and paste – you can just paste them right in your shell to test it, or add to a startup script.
export AA_P="export PVE=\"\\033[m\\033[38;5;2m\"\$(( \`sed -n \"s/MemFree:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\` / 1024 ))\"\\033[38;5;22m/\"\$((\`sed -n \"s/MemTotal:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\`/ 1024 ))MB\"\\t\\033[m\\033[38;5;55m\$(< /proc/loadavg)\\033[m\";echo -en \"\""
export PROMPT_COMMAND="history -a;((\$SECONDS % 10==0 ))&&eval \"\$AA_P\";echo -en \"\$PVE\";"
export PS1="\\[\\e[m\\n\\e[1;30m\\][\$\$:\$PPID \\j:\\!\\[\\e[1;30m\\]]\\[\\e[0;36m\\] \\T \\d \\[\\e[1;30m\\][\\[\\e[1;34m\\]\\u@\\H\\[\\e[1;30m\\]:\\[\\e[0;37m\\]\${SSH_TTY} \\[\\e[0;32m\\]+\${SHLVL}\\[\\e[1;30m\\]] \\[\\e[1;37m\\]\\w\\[\\e[0;37m\\] \\n(\$SHLVL:\\!)\\\$ " && eval $AA_P
Tags: .bashrc, 404 Not Found, admin, Advanced, Apache, askapache, bash, bash_profile, CommandLine, Dig, Examples, Forms, GET, grep, HowTo, Kung-Fu, Linux, Login, mysql, Port, Prompt, PROMPT_COMMAND, PS1, Putty, ram, Redirect, server, servers, Shell, Shell History, SPEED, SSH, SSI, stat, trick, Username, Web Hosting
Posted in Apache, DreamHost, Featured, Hacking, Htaccess, Linux Unix BSD, Making Money, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster, WiredTree | 8 Comments »
Thursday, March 18th, 2010
NOT a typo.. 30x is measurable, well-documented, and easily tested. This is what open-source is about. I haven’t had time to post much the past year, I’m always working! So I wanted to make up for that by publishing an article on a topic that would blow your mind and be something that you could actually start using and really get some benefit out of it. This is one of those articles that the majority of web hosting companies would love to see in paperback, so they could burn it.
Tags: Advanced, Apache, askapache, Backups, Bandwidth, Boot, Cache, chmod, console, devshm, DreamHost, File System, filesystem, grep, Hard Drive, HowTo, HTTPS SSL, ionice, Linux, memory bandwidth, mysql, Private Server, ram, rsync, Scripts, Security, server, servers, Shell, shell script, SLRAM, SPEED, speed improvements, SSI, stat, SymLinks, tmpfs, trick, Vulnerability, Web Hosting, webhosts, WordPress, WP-Super Cache
Posted in Apache, Cache, DNS, DreamHost, Featured, Hacking, Htaccess, Linux Unix BSD, Mod_Rewrite, PHP, Security, Server Administration, Shell Scripting, Web Design, Web Hosting, Web Tools, Webmaster, WiredTree, WordPress, WordPress Plugins | 7 Comments »
Tuesday, February 23rd, 2010
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
Tags: 401, Apache, askapache, ASP, Backups, Bandwidth, bash, bash_profile, Boot, compression, curl, Defrag, Email, encryption, filesystem, Firefox, Flash, GET, Google, GPG, Hard Drive, ionice, Linux, Login, Nice, PageDefrag, password, Performance, Pipelining, Plink, Port, post, Prompt, Putty, ram, rsync, Security, server, servers, Shell, SOCKS, SPEED, SSH, SSH Tunnels, SSI, stat, trick, TrueCrupt, tutorial, USB Drives
Posted in Apache, Cache, Featured, Hacking, Htaccess, Linux Unix BSD, Making Money, Security, Web Design, Web Hosting, Web Tools, Webmaster, WiredTree | 7 Comments »
Saturday, October 10th, 2009
To 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.
Tags: 503, Advanced, Apache, askapache, Backups, Bandwidth, bash, Blocking, Boot, Bottleneck, caching, compression, CPU, CSS, curl, Disk IO, DNS, Examples, feed, fifo, GET, httpd, ionice, iostat, Javascript, Linux, mysql, Nice, Optimization, pagefile, Performance, Perl, PHP, Port, ram, Renice, Round Robin, rsync, Scripts, Security, server, servers, Shell, shell script, Shell Scripting, Socket, SPEED, SSH, SSI, stat, taskset, trick, Ulimit, Web Hosting, WordPress, wp-config.php
Posted in Apache, Cache, Featured, Linux Unix BSD, Review, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster | 3 Comments »
Monday, October 5th, 2009
If you ever wanted to know the best way to defragment and speed up your Windows-Based PC, I mean you really wanted to know, here is the 2nd part to my article on Windows Speed Optimizing that details the process I have found works really well. Definately not a quick process, and certainly not the best ever, just my best ever and one that you only have to do once to get the benefits.
This article has a lot of incredibly useful (and FREE) tools I recommend, which you can grab and use without reading the article..
Tags: 301 Redirect, admin, Advanced, Apache, askapache, ASP, Backups, Boot, Cache, CommandLine, compression, console, Defrag, Defragmentation, Deframenting, Disk IO, File System, Firefox, Forms, GET, Google, Hard Drive, Linux, Login, MyDefrag, nsa, Optimization, PageDefrag, pagefile, PDF, Performance, PHP, Port, ram, Registry Optimization, Scanners, Scripts, Shell, SPEED, SpinRite, SSI, stat, trick, tutorial, UltraDefrag, Windows XP, Windows XP Optimization
Posted in Cache, Featured, Firefox, Hacking, Linux Unix BSD, Review, Webmaster, Windows | 6 Comments »
Saturday, June 13th, 2009
Ever wanted to execute commands on your server through php? Now you can. I’m calling this file (see below) shell.php and it allows you to run commands on your web server with the same permissions that your php executable has.
Tags: 302 Redirect, 403 Forbidden, Ajax, Apache, Apache Htaccess, askapache, Backups, bash, chmod, console, errordocument, Flash, GET, Hacking, Htaccess, htaccess tutorial, HTTP-EQUIV, Javascript, Linux, Login, Mod_Rewrite, password, PHP, Port, ram, Redirect, Rewrite Tricks, rewritecond, rewriterule, Scripts, Security, server, Shell, shell console, shell script, Shell Scripting, SSI, stat, tutorial
Posted in Ajax, DreamHost, Featured, Hacking, Htaccess, Javascript, Linux Unix BSD, Mod_Rewrite, PHP, Security, Server Administration, Shell Scripting, Web Hosting, Web Tools, Webmaster | 15 Comments »
Tuesday, April 14th, 2009
The goal is to add the HostGator server to be an exact mirror of the static.askapache.com domain, then to add that server as a 2nd A record to my DNS zone. That way half the visitors to the size will be taking up resources and bandwidth on the HostGator server instead of mine.
Round Robin A records in DNS are intended to evenly distribute queries between each host of the same name. Using some tricks straight out of a hackers toolbox we can verify if the distribution is taking place. (It is.)
Tags: 500, 503, admin, Apache, askapache, ASP, Bandwidth, Cache, caching, CNAME, CSS, Dig, DNS, DreamHost, experiments, GET, HostGator, HowTo, Htaccess, HTTPS SSL, Javascript, Linux, Logs, Networking, Nice, PHP, Port, Powweb, Prompt, PS1, Round Robin, rsync, Security, server, servers, Shell, SPEED, SSH, SSI, stat, trick, Web Hosting
Posted in Ajax, Apache, Apache Modules, Cache, Featured, Linux Unix BSD, Web Hosting | 5 Comments »
Friday, April 10th, 2009
Sometimes 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.
Tags: admin, Apache, askapache, Backups, Bandwidth, bash, chmod, compression, curl, debugging, DreamHost, Email, encryption, Forms, GET, Gmail, HostGator, HTTPS SSL, Linux, Login, Logs, password, PHP, Port, ram, Round Robin, rsync, Security, server, Shell, shell script, SPEED, SSH, SSH Tunnels, SSI, stat, WordPress
Posted in Apache, Featured, Linux Unix BSD, Security, Shell Scripting, Web Hosting | 2 Comments »
Saturday, January 10th, 2009
Skip this – still under edit
I discovered these tips and tricks mostly while working as a network security penetration specialist hired to find security holes in web hosting environments. Shared hosting is the most common and cheapest form of web-hosting where multiple customers are placed on a single machine and “share” the resources (CPU/RAM/SPACE). The machines are configured to basically ONLY do HTTP and FTP. No shells or any interactive logins, no ssh, just FTP access. That is when I started examining htaccess files in great detail and learned about the incredible untapped power of htaccess. For 99% of the worlds best Apache admins, they don’t use .htaccess much, if AT ALL. It’s much easier, safer, and faster to configure Apache using the httpd.conf file instead. However, this file is almost never readable on shared-hosts, and I’ve never seen it writable. So the only avenue left for those on shared-hosting was and is the .htaccess file, and holy freaking fiber-optics.. it’s almost as powerful as httpd.conf itself!
Most all .htaccess code works in the httpd.conf file, but not all httpd.conf code works in .htaccess files, around 50%. So all the best Apache admins and programmers never used .htaccess files. There was no incentive for those with access to httpd.conf to use htaccess, and the gap grew. It’s common to see “computer gurus” on forums and mailing lists rail against all uses and users of .htaccess files, smugly announcing the well known problems with .htaccess files compared with httpd.conf – I wonder if these “gurus” know the history of the htaccess file, like it’s use in the earliest versions of the HTTP Server- NCSA’s HTTPd, which BTW, became known as Apache HTTP. So you could easily say that htaccess files predates Apache itself.
Once I discovered what .htaccess files could do towards helping me enumerate and exploit security vulnerabilities even on big shared-hosts I focused all my research into .htaccess files, meaning I was reading the venerable Apache HTTP Source code 24/7! I compiled every released version of the Apache Web Server, ever, even NCSA’s, and focused on enumerating the most powerful htaccess directives. Good times! Because my focus was on protocol/file/network vulnerabilites instead of web dev I built up a nice toolbox of htaccess tricks to do unusual things. When I switched over to webdev in 2005 I started using htaccess for websites, not research. I documented most of my favorites and rewrote the htaccess guide for webdevelopers. After some great encouragement on various forums and nets I decided to start a blog to share my work with everyone, AskApache.com was registered, I published my guide, and it was quickly plagiarized and scraped all over the net. Information is freedom, and freedom is information, so this blog has the least restrictive copyright for you. Feel free to modify, copy, republish, sell, or use anything on this site ;)
Tags: .htaccess examples, 301 Redirect, 302 Redirect, 401, 403 Forbidden, 404 Not Found, 500, 503, admin, Advanced, Apache, Apache Htaccess, apache ssl, askapache, ASP, authorization, Backups, Bandwidth, bash, Blocking, Boot, Cache, Cache-Control, caching, cheatsheet, chmod, code snippets, compression, Cookies, CSS, debugging, DreamHost, Email, error log, errordocument, Etags, Examples, experiments, feed, FeedBurner, File System, FilesMatch, filesystem, Firefox, Flash, Forms, GET, Google, Hacking, hotlinking, HowTo, Htaccess, htaccess files, htaccess guide, htaccess rewrite, htaccess tricks, htaccess tutorial, Htpasswd, HTTP Error, HTTP Headers, HTTP-EQUIV, httpd, httpd.conf, HTTPS SSL, hyper text transfer protocol, If-Modified-Since, Javascript, Last-Modified, Linux, Login, Logs, mad skills, mod_include, mod_python, Mod_Rewrite, Mod_Rewrite examples, Mod_Security, Mod_Setenvif, mysql, Nice, nsa, password, password protection, PDF, Performance, Perl, PHP, php.ini, phpinfo, Port, post, Powweb, Prompt, Python, ram, Redirect, Redirection, Request Method, Rewrite Tricks, rewritecond, rewriterule, Robot, robots, Sample .htaccess, Scripts, Security, SEO, seo secrets, server, server config, servers, SetEnvIf, Shell, Socket, Source Code, SPEED, SSH, SSI, stat, SymLinks, trick, tutorial, ultimate htaccess, Username, Web Hosting, WordPress
Posted in Apache, Apache Modules, Cache, DreamHost, Featured, Google, Hacking, Htaccess, Linux Unix BSD, Mod_Rewrite, SEO, Security, Web Design, Web Hosting, Web Tools, Webmaster, WordPress | 71 Comments »
Wednesday, November 19th, 2008
Unix file permissions are one of the more difficult subjects to grasp.. Well, ok maybe “grasp” isn’t the word.. Master is the right word.. Unix file permissions is a hard topic to fully master, mainly I think because there aren’t many instances when a computer user encounters them. I’ve done a lot of research on it the past couple weeks… and now here’s everything I’ve learned so far.. cuz you guys AskApache Regs Rock!
Tags: 301 Redirect, 302 Redirect, 401, 403 Forbidden, 404 Not Found, 500, 503, Apache, askapache, ASP, Backups, bash, bash_profile, Cache, chmod, Dig, DreamHost, fifo, File Permissions, File System, filesystem, Fsockopen, GET, Hacking, Htaccess, httpd, Linux, Login, password, Perl, PHP, php.ini, Port, Python, ram, Scripts, Security, server, servers, Sessions, Shell, Socket, Source Code, SSH, SSI, stat, trick, umask, Web Hosting
Posted in Apache, Featured, Hacking, Linux Unix BSD, PHP, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster | 5 Comments »
Wednesday, October 1st, 2008
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.
Tags: Advanced, Analytics, Apache, askapache, bash, Cache, caching, compression, curl, debugging, DNS, Google, Google Analytics, Htaccess, Javascript, Mod_Rewrite, Nice, Pipelining, Port, Renice, Rewrite Tricks, Scripts, server, servers, Shell, shell script, Shell Scripting, SPEED, SSI, umask, Web Hosting
Posted in Apache, Cache, Javascript, Linux Unix BSD, Shell Scripting, Web Hosting | 5 Comments »
Friday, September 26th, 2008
List of mainly obscure security software geared more for the master pentester. These are mostly for unix, bsd, and mac and many are difficult to install and setup (require custom servers, inside access points, obscure libraries). Only programs that output data are included, so no actual exploits or anything. Most of these output extremely useful albeit extremely technical information.
Tags: admin, Advanced, Apache, askapache, ASP, Bandwidth, Boot, Cache, CommandLine, console, Cookies, debugging, Dig, DNS, Email, encryption, Ethernet, feed, File Permissions, filesystem, Forms, GET, Google, Hacking, HTTPS SSL, Linux, Login, Logs, Networking, Nice, nsa, password, PDF, Performance, Perl, PHP, Port, post, Prompt, Putty, ram, Redirect, Scanners, Scripts, Security, server, servers, Sessions, Shell, shell script, Sniffing, Socket, SOCKS, Source Code, SPEED, SSH, SSH Tunnels, SSI, stat, Vulnerability, Vulnerability Scanners, Windows XP, Wireshark
Posted in Security | 3 Comments »
Saturday, August 9th, 2008
Scrolls the latest log entries for multiple log files to the current screen or to any other monitor or TTY in color using syntax highlighting, making debugging easier and saving a lot of time for multi-monitor workstations.
Tags: Apache, askapache, bash, CCZE, debugging, Elite, error log, Examples, fifo, GET, Htaccess, htaccess files, httpd, Linux, Logs, Mod_Security, Nice, Perl, PHP, php.ini, post, ram, Redirect, Redirection, Renice, Security, server, Shell, Shell History, shell script, SPEED, SSH, SSI, stat, SymLinks, trick, Web Hosting
Posted in Apache, DreamHost, Featured, Hacking, Linux Unix BSD, PHP, Security, Server Administration, Shell Scripting, Web Hosting, Web Tools, Webmaster | 4 Comments »
Monday, August 4th, 2008
Enter your DOMAIN_ROOT and the location of your wp-config.php or config.php, and this script finds all the mysql settings by parsing the phpbb or wordpress config file, then creates GPG encrypted backups, and saves your settings for future automation.
Tags: Apache, askapache, Backups, bash, debugging, encryption, GET, GPG, grep, Linux, mysql, Nice, password, PHP, phpBB, Renice, Security, Shell, shell script, umask, WordPress, wp-config.php
Posted in DreamHost, Featured, Linux Unix BSD, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster, WordPress, phpBB | 3 Comments »