Elinks User Agent Override

To manually set the useragent for the e-links web browser, edit this file:

~/.elinks/elinks.conf

The syntax for setting or overriding the user agent is something like this:

set protocol.http.user_agent = "Firefox/2.0.0.4"

Or possibly this for a more realistic agent string:

set protocol.http.user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060426 Firefox/1.5.0.4"

Elinks User Agent Override

Posted in Web Development | Tagged , , , , , , , | Leave a comment

If This Then That and your Privacy

Here is a little chart showing “If This Then That” and your facebook privacy. Guess it needs a lot of items to work, but wow.

If This Then That and your Privacy

Posted in Marketing, Social Media, Tech Tips, Web Development | Tagged , , | Leave a comment

Use Google Chrome as a Screensaver

You can use Google Chrome‘s --kiosk mode to create a full-screen screensaver of sorts. This might be good if you have a webpage or intranet page you’d like to display. Here’s how I did it for a windows computer:

Create a file such as c:\screensaver.bat and add the following code. Replace with your location of chrome.exe

@echo off
taskkill /im chrome.exe
start /wait "" "C:\Documents and Settings\Google\Chrome\Application\chrome.exe" --kiosk http://www.mysite.com
rem ## run any command here you'd like after the "screensaver" finishes ##

Next, set that to run as a scheduled task after the computer has been idle for 5 minutes (or however long you choose).

You can then listen with jQuery / javascript to close the page when the mouse moves. Here is code that closes the page when the mouse moves more than 20 pixels. You could also bind it to a keyboard event.

<html>
<head>
<script type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</head>
<body>

<h1>hello</h1>

<div id="log"></div>

    <script type="text/javascript">

    var startx = '';
    var starty = '';



jQuery('html').bind('mousemove',function(event){


    if(startx == ''){
        startx = event.pageX;
        starty = event.pageY;
    }else
    {

        deltax = Math.abs(event.pageX - startx);
        deltay = Math.abs(event.pageY - starty);

        var msg = '';
        msg += "distance x ";
        msg += deltax;

        msg += "distance y ";
        msg += deltay;

        $("#log").html("<div>" + msg + "</div>");

        if(deltax > 20 || deltay > 20){
            closeWindow();
        }

    }


});


function closeWindow(){
    setTimeout(function(){

        window.open('', '_self', '');
        window.close();

    },1000);
}


    </script>

</body>
</html>
Posted in Software, Tech Tips, Web Development | Tagged , , , , , , , , | Leave a comment

Fix “Post Types Order” plugin error with HTTPS

The WordPress Plugin Post Types Order by NSP CODE is helpful in as it allows you to

Order Posts and Post Types Objects using a Drag and Drop Sortable javascript capability

But unfortunately the plugin does not work with wordpress HTTPS / SSL admin – or at least not without errors:

Fix "Post Types Order" plugin error with HTTPS

Fix

But the good news is that there is an easy fix with changing just a few lines of code:

At the top of the post-types-order.php page there are two constant definitions:

define('CPTPATH', ABSPATH.'wp-content/plugins/post-types-order');
define('CPTURL', get_option('siteurl').'/wp-content/plugins/post-types-order');

And the second one needs to use the plugins_url() function that WordPress recommends instead:

define('CPTPATH', ABSPATH.'wp-content/plugins/post-types-order');
define('CPTURL', plugins_url().'/post-types-order');

After that you should stop receiving the HTTPS error for some insecure content when you are in the WP administration interface.

Posted in Tech Tips, Web Development | Tagged , , , , , | Leave a comment

Google Chrome: Disable Automatic Updates

Are you tried of Google Chrome automatically installing updates? You can disable it on both Windows and Mac machines:

Windows Machines

Open registry editor. Locate:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update

Add a new DWORD value named DisableAutoUpdateChecksCheckboxValue and set it to 1 to disable automatic updates or 0 to re-enable them.

Mac OS X

Open terminal and run the following command:

defaults write com.google.Keystone.Agent checkInterval 0

To re-enable automatic updates for google chrome use this command:

defaults write com.google.Keystone.Agent checkInterval 1

This also works for Chromium and beta versions of GoogleChrome.

Posted in Mac, Tech Tips, Web Development | Tagged , , , , | Leave a comment

How to install Pianobar on Mac OS X

You will need homebrew to install gnutls unless you want to install it manually. Get homebrew at http://mxcl.github.com/homebrew/

You can either then try brew update to update the homebrew repositories.

To install pianobar using homebrew you can do

brew install pianobar

However, if after installation pianobar is giving you an error, check out the issues at https://github.com/PromyLOPh/pianobar/issues, and if your issue is listed you may need to install the very latest version of pianobar by doing a manual build.

To do this I’d recommend that you remove the homebrew installations of pianobar, and then manually build.

So, to remove the pianobar that was installed with homebrew, type

brew remove --force pianobar

Next see my notes about installing pianobar manually.

// download the root certificates into your home directory as ~/pianobar-cacert.pem
// these are needed to help pianobar make a secure connection to pandora
wget -O ~/pianobar-cacert.pem http://curl.haxx.se/ca/cacert.pem 

// add the path to the pianobar config file
// ================================================================
echo "tls_ca_path = $HOME/pianobar-cacert.pem" >> ~/.config/pianobar/config 

// install the dev tools
// ================================================================
brew install gnutls 


// change to your home directory, then clone the latest version of pianobar
// change to the directory created, make pianobar
cd ~
git clone https://github.com/PromyLOPh/pianobar.git
cd pianobar/
make clean && make CFLAGS="-O2 -DNDEBUG -W64"


// run pianobar from the current directory
./pianobar 


// note: just typing "pianobar" instead of "./pianobar" will fail if the current directory is not in your path

//after running pianobar you should get:

Welcome to pianobar (2011.11.09-dev)! Press ? for a list of commands. (i) Login... Ok. (i) Get stations... Ok. 

// you should then be able to run pianobar on subsequent runs
// by typing in ~/pianobar/pianobar no matter what your current directory is
Posted in Uncategorized | Leave a comment

What are the different Google Bot User Agents?

There are several Googlebots with different User-agents. Here is a short list of what they are, and what they are used for:

  • Googlebot : crawls pages for our web index and Google News
  • Googlebot-Mobile : crawls pages for our mobile index
  • Googlebot-Image : crawls pages for our image index
  • Mediapartners-Google : crawls pages to determine AdSense content
  • Adsbot-Google : crawls pages to measure AdWords landing page quality

Posted in Web Development | Tagged , , | Leave a comment

Most Common User Agents

Have you ever wondered what Most Common User Agents are? Often times people will post a list on their site, which soon becomes outdated. So, I decided I would create a list of the Most Common User Agents, which is dynamically generated and updated, and use data from my own website to keep the list of user-agent data up to date – which means the list stays up to date as new browsers are released, and is in effect a highly accurate representation of the most common useragents. Below you will find a table showing the most popular / most-used UserAgents and percentage of visitors who had that user-agent when they visited the site.

Your user agent is:
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)

percent string system user_agent_string_md5
4.5% Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
Win7 64-bit
b9b67149893cf58ea98c6d61dc5cbb5c
3.0% Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Chrome 16.0
Win7 64-bit
82ca5abd7233bb4cefb2bf3c841cfe4f
2.8% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7 Safari 5.0
MacOSX
8b62386c813736bfae144aee5270045b
2.4% Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
WinXP 32-bit
990d835906a99267553e4ec6dc3ed45a
1.9% Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 Chrome 16.0
Win7 64-bit
add42b56f41044cca42bbd076d3392c6
1.7% Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) IE 9.0
Win7 64-bit
7793979e70bb01e23833a4f7789d7a63
1.5% Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
Win7 32-bit
61bfabcb3a96faa38cd57badca0157a3
1.5% Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Chrome 16.0
WinXP 32-bit
9908d6e424e31c27af910d5ff972723c
1.3% Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
MacOSX
af3f1433c591d1d508cfa5c8d71218d0
1.2% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Chrome 16.0
MacOSX
5b0b3f77f6f70ddc5820e75d059f262a
1.1% Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Chrome 16.0
Win7 32-bit
fc7f971acbbcc48b954f8e990f4f23fd
1.0% Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
MacOSX
4dbac16c3da10b0c3a791b8959c661fc
1.0% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7 Safari 5.0
MacOSX
13ee8513d6fb7f97aef6635309b91f40
0.9% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 Chrome 16.0
MacOSX
3d86cc7a2ca671d337190b3b570d033d
0.7% Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) IE 6.0
WinXP 32-bit
71738f6b3bb879de20a949a3cb84fe14
0.7% Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3 iPhone
iPhone OSX
1fbccf4ad5841a3b1902e34cefcf6969
0.7% Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 Chrome 16.0
WinXP 32-bit
01c43d0403197325d3e690eba1bde0e6
0.7% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Chrome 16.0
MacOSX
9f3510e4ab6d3709de89ba9d698a93a6
0.6% Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7 Chrome 16.0
Win7 64-bit
715731ebf3fcbd4bedf35d5c9f044006
0.6% Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 Chrome 16.0
Win7 32-bit
abb8ee9df7b6e17fbb57f67c38296f02
0.6% Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) IE 9.0
Win7 32-bit
fdc83df8ef7c4b5238f839dcae57a919
0.5% Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) IE 6.0
WinXP 32-bit
a5ecd7e3ca14fcb38a69343d1d47985a
0.5% Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
Linux
83eadab4f0aca1a5cde420fc4da779da
0.5% Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Firefox 3.5
WinXP 32-bit
641d9db2a89b326fb277363eb120bfed
0.5% Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3 iPad
iPhone OSX
eeba827200728e190c1aadf70a27d07e
0.5% Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0 Firefox 10.0
Win7 64-bit
a8f81f03ade7cdb2b5dfc1724fc7360e
0.5% Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Firefox 9.0
WinVista 32-bit
55acc71f55ed4da024b5e6b1c4b13817
0.5% Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64) IE 6.0
WinXP 64-bit
3a111e6408666b9d2f04d2aaa1b3d685
0.5% Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 Chrome 16.0
MacOSX
6f1013f4708b6315fb1d018b5afc1dc9
0.5% Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30) IE 7.0
WinXP 32-bit
3d91c1ab3c54258daeffd4319d00d5a9
0.5% Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 Firefox 3.5
WinXP 32-bit
9058afed49e3dca6bf061cdf8160250f

All user agents less common than 0.5% have been omitted.

Posted in Tech Tips, Web Development | Tagged , , , , , , , | Leave a comment

ColorPicker Applescript for Mac OS X

Below is a Color Picker / Color Chooser Applescript for Mac OS X. The code originally appeared on `http://assortedgeekery.com/scripts/ChooseColor` but is no longer available there (404) so I’ve posted it here.

It gives you a system-based color chooser, and after selecting a color you are able to copy the value to the clipboard as a RGB value or a HEX code. Screenshots and code below.

ColorPicker Applescript for Mac OS X

ColorPicker Applescript for Mac OS X

Download the Application:
download-color-picker-application

Or get the code and create it yourself:

(*
    Choose Color
    Chris Biagini
    updated Aug. 4, 2005

    Republished via http://techblog.willshouse.com/?p=2222

    Invokes the Apple color picker from anywhere, and prepares some useful
    information about the color you chose.
*)

property my_color : {0, 32896, 65535}

set my_color to choose color default color my_color

set red to round (first item of my_color) / 257
set green to round (second item of my_color) / 257
set blue to round (third item of my_color) / 257

set red_web to dec_to_hex(red)
set green_web to dec_to_hex(green)
set blue_web to dec_to_hex(blue)

set red_web to normalize(red_web, 2)
set green_web to normalize(green_web, 2)
set blue_web to normalize(blue_web, 2)

set red to normalize(red, 3)
set green to normalize(green, 3)
set blue to normalize(blue, 3)

set decimal_text to "R: " & red & " G: " & green & " B: " & blue
set web_text to "#" & red_web & green_web & blue_web

set dialog_text to decimal_text & return & "Web: " & web_text

set d to display dialog dialog_text with icon 1 buttons {"Cancel", "Copy as Decimal", "Copy for Web"} default button 3

if button returned of d is "Copy as Decimal" then
	set the clipboard to decimal_text
else if button returned of d is "Copy for Web" then
	set the clipboard to web_text
end if

on dec_to_hex(the_number)
	if the_number is 0 then
		return "0"
	end if

	set hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
	set the_result to ""

	set the_quotient to the_number

	repeat until the_quotient is 0
		set the_quotient to the_number div 16
		set the_result to (item (the_number mod 16 + 1) of hex_list) & the_result
		set the_number to the_quotient
	end repeat

	return the_result

end dec_to_hex

on normalize(the_number, the_length)
	set the_number to the_number as string

	if length of the_number ? the_length then
		return the_number
	end if

	repeat until length of the_number is equal to the_length
		set the_number to "0" & the_number
	end repeat

	return the_number
end normalize
Posted in Uncategorized | Leave a comment