Password protecting nginx

Create a Username/Password which will be stored in ‘useraccess’, a file I just made up.

htpasswd -b -c useraccess username password

-b: allows password in command line rather than prompt
-c: creates new passwd file, or rewrites and appends if the file already exists.

Now in the nginx config, under:

server {
location /protectedlocation {
Add the following

auth_basic "Message box title of password prompt";
auth_basic_user_file /path/to/useraccess;

Now restart nginx and go to the location you've just protected.  Please comment if this was useful.
Posted in Development, nginx, Uncategorized | Leave a comment

How to get around the Wikipedia blackout.

Copy and paste this into your address bar:


javascript:$("#content").css("display", "block");$("#mw-sopaOverlay").css("display","none");

 

To disable blackout on wordpress.com: (this does you no good because the url’s are rewritten)

javascript: jQuery("span").removeClass("picture");jQuery(".posttitle").attr("style", "background: #FFFFFF ! important");jQuery("small span").attr("style", "background: #FFFFFF ! important");jQuery("span span").attr("style", "background: #FFFFFF ! important");jQuery("span strong").attr("style", "background: #FFFFFF ! important");

Posted in Uncategorized | Leave a comment

Free Cloud Hosting for a year? Sign me up!

http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=amazon+free+tier

Posted in Linux, Server & Web Site Administration, Web Development & Administration, Web Hosting | Leave a comment

Unknown Terminal Type.

The terminal from a Xubuntu desktop isn’t executing any commands. The error is “ ‘unknown’: unknown terminal type. Check what terminal is set to by running: “ SET | MORE ”   Then scroll down to where you see the variable:  ” TERM= “.  If “ TERM=unknown “, simply fix this problem by typing:  TERM=xterm

Posted in Linux, Operating Systems, Server & Web Site Administration, Terminal Commands | Leave a comment

WordPress-Smart 404 Plugin

A great tool for not showing 404 pages on your wordpress website.  I’ve used this for a couple years now.  I just recently discovered that if you type in a url with a keyword that cannot be found in your posts or pages, this plugin will show a 404 page.  The whole point of this plugin is to be smart right?  Well as a fix for now I’ve just made it default to your lastest post if it cannot find the keywords in the uri.  Fix can be found @ Pastebin: http://pastebin.com/1qb4h11V

Posted in Wordpress | Leave a comment

Reveal Password in web browser – Asterisks Revealed

StumbleUpon
Thank you stumble upon, for your weekly interesting emails.  Every email I’ve gotten from StumbleUpon has in fact held my interested.  One of the few sites I actually allow weekly emails from.  Thanks to those emails I’ve found this little handy javascript.


javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j

 
Posted in Development, JavaScript, Software, Web Browsers | Leave a comment

Speeding up Windows Vista file transfers over the network.

Speed up Windows Vista File Transfers over the NetworkVista performs very fast on advanced networking environment, but introduced too much overhead in normal home office environment, you just need to disable some settings to reduce the overhead, all is done in 2 simple steps.

Unless you equipped with advanced PC and networking devices, your can expect performance dropped by 20~50% during files transfer as compare to XP, so lets’ find the reasons and solve the problems now:

  • 1. Remote Differential Compression – This protocol calculates, compress and only transfer files with updated version, hence files synchronization works extremely well on lower bandwidth networking, but slows down normal networking with extra overheads in compression. Using a faster processor can improve Remote Differential Compression as Vista trade processing power over networking bandwidth by compressing the data before transferring it. You should always disable this features on older and slower computer, because you have more bandwidth than processing power!
  • 2. TCP Auto Tuning Features – This feature maximize your gigabit networking by automatic and constantly adjusting itself to adapt to the maximum bandwidth available by your hardware; It performs very well on high bandwidth environment, but not very good on low bandwidth networking due to extra overheads of detection, and also went bad when using unsupported hardware such as firewall or routers.
    You can disable these features and speed up Vista network file transfers  20% to 30%. Just remember to enable them if you upgrade your computer or networking in the future.

To disable Remote Differential Compression, go to Control Panel -> Programs -> Turn Windows Features On or Off, uncheck Remote Differential Compression and then press OK button.

To disable TCP Auto tuning, open run by holding  the Windows key and pressing R.  Then type CMD. exe then hold Ctrl & Shift while pressing Enter to run as Administrator. At the command prompt type netsh interface tcp set global autotuning=disabled  …  Tada!  Now type exit to return to Windows.

If you’re unsure whether or not autotuning is already disabled, use command: netsh interface tcp show global at command prompt.

Autotuning Disabled

Autotuning Enabled

 

 

 

 

 

If you decided to turn on this feature after upgraded your hardware, do the same but type netsh interface tcp set global autotuning=normal to turn on the TCP auto tuning feature.

You can try to send some files now, you should notice more improvement on your file transmission, your file is send across network or disk much faster!

Posted in techblog | Leave a comment

Updating timezone information on my VPS

Haha because of having a VPS I cannot set the time on it, from what I can tell.  All though I cannot change the time, i can update the timezone.  This is a very easy to do command:

export TZ=America/Chicago

BAM! After running this command I run the command:  date   to make sure it worked.

Posted in techblog | Leave a comment

Webmin / Virtualmin Log In – ACCESS DENIED

Ever tried logging into Virtualmin/Webmin too many times whilst typing the wrong password?  Well I have.. After 3-5 attempts it gives me ACCESS DENIED FOR …[ip]…

Searching low and high on how to unban myself from virtual min it was as simple as logging into shell and restarting webmin with the following command:

/etc/init.d/webmin restart

I didn’t need to unban my ip, it just worked.  If this doesn’t work for anyone, please post and I’ll help you figure it out.

Posted in Cent OS, Linux, Virtualmin, Webmin | Leave a comment

Enabling DOMDocument in php

How to enable DOMDocument in php.

Putty SSH Shell Login

Well you can take the time to recompile php, but that’s just a pain. Now if you have SSH Shell access to your linux server running php, this can be pretty easy. I’m running CentOS 5, let me know if this doesn’t work for you. Run the following command in your shell (logged in with root):

yum install php-xml

BAM! Let it find all the files needed, say YES to download, then let it install and restart your apache to reload all your php and it’s modules.

httpd -k restart
Posted in techblog | Leave a comment