Thursday, September 26, 2013

How to force a browser refresh

Generally speaking, ALT-F5 will do a non-cached refresh, while F5, CTRL-R, and Refresh button will do a cached refresh. That is, the browser will not retrieve the latest information from the server, unless you perform a ALT-F5.

Firefox

  1. 1
    Press and Hold Alt (while Clicking Refresh in the TOOLBAR)

  2. 2
    Tools => Options => Advanced => Network => Offline Storage => Clear Now


Internet Explorer

  1. 1
    Press and Hold Ctrl-F5 (CTRL-R does a Cached Refresh)

  2. 2
    Press and Hold Ctrl (while Clicking Refresh in the TOOLBAR)

  3. 3
    Tools => Internet Options => General => Browser History => Delete


Netscape Navigator

  1. 1
    Press and Hold Ctrl-F5

  2. 2
    Press and Hold Ctrl-(while Clicking Refresh in the TOOLBAR)


Opera

  1. 1
    Press F5

  2. 2
    Press and Hold Shift-(while Clicking Refresh in the TOOLBAR)

  3. 3
    Tools => Preferences => Advanced => History => Empty Now


Apple Safari

  1. 1
    Press and Hold Ctrl-F5

  2. 2
    Press and Hold Ctrl-(while Clicking Refresh in the TOOLBAR)

  3. 3
    Press and Hold Ctrl-Alt-E or ( Edit => Empty Cache )


Google Chrome

  1. 1
    Press and Hold Ctrl-F5

  2. 2
    Press and Hold Ctrl-(while Clicking Refresh in the TOOLBAR)

  3. 3
    WRENCH => Tools => Clear Browsing data => Select Options, then "Clear Browsing data"

Sunday, August 18, 2013

How to add an RSS Feed to your Blogger Blog, 5 easy steps.

Thought this might help a couple folks:


Step 1. Acquire the URL to the feed that you would like to add.
In this case, I just brought up the context menu and clicked "Copy link address"

Step 2.  Go to your account dashboard and click "Layout"
Step 3. Click "Add a Gadget"
This will bring up a new window. If you don't see it, look for it behind your other windows.
Step 4. Scroll down and click "Feed"

Still with me? :-)

Step 5. Add the Feed URL to the dialog box. Click "Continue".

If you copied it to your clipboard, you can just "Ctrl-v" and paste it right in.
Easy peezy!







Sunday, August 11, 2013

For those of your who code PHP, please see the enclosed link.

There is far too much disinformation running around out there on the Intertoobs about which way to code PHP. Best practices are seemingly in conflict from source to source, or just missing altogether.

To solve that, check this out:

http://www.phptherightway.com/

Do it!

Thursday, April 4, 2013

"Help, I've been blacklisted/greylisted on Drupal.org!" - Here is some insight into this problem.

When attempting to access drupal.org, some users have reported seeing something about "http:BL" had greylisted them.

What is http:BL?
Http:BL is a way for website administrators to take advantage of the data generated by Project Honey Pot and keep malicious or suspicious IPs off their websites. The service works by publishing DNS records for IPs we have seen conducting suspicious or malicious behavior online. Website administrators can then use this data in order to restrict access to their web servers for these IPs.
 
The fact that you have been greylisted or blacklisted means that "Project Honeypot" has determined that your IP has been connected with questionable activity. According to Project Honeypot:

"Project Honey Pot is the first and only distributed system for identifying spammers and the spambots they use to scrape addresses from your website. Using the Project Honey Pot system you can install addresses that are custom-tagged to the time and IP address of a visitor to your site. If one of these addresses begins receiving email we not only can tell that the messages are spam, but also the exact moment when the address was harvested and the IP address that gathered it."

 You can contact site administrators to get your IP address "whitelisted", this allows your IP to connect to their servers once again. In the case of Drupal use http://drupal.org/httpbl/whitelist  The delay between submitting the request to become whitelisted and it actually happening will increase each subsequent time you get greylisted. Additionally ask for support in the IRC channel #drupal-infrastructure. Even if you can't access IRC directly for whatever reason you can access it easily using http://webchat.freenode.net/
Of course you could also use a proxy, something like www.hidemyass.com 

In any case, I would run a full scan on your system to make sure you don't have any malware/etc running that could be carrying out spam or DDOS activities from your computer. This will result in your IP being greylisted again.

Wednesday, April 3, 2013

Drupal 7 theming - Work in Progress - Template cheat sheet

page.tpl.php variables
General Variables
$base_path The base URL path of the Drupal installation.
$directory The directory where the current selected template is located.
$is_front TRUE if the current page is the front page.
$logged_in TRUE if the user is registered and logged in.
$is_admin TRUE if the user has permission to access administration pages.
Site Identity
$front_page URL of the front page
$logo Path to the logo image
$site_name Name of the site
$site_slogan Slogan of the site
$highlight Highlighted content, typically found at the top. See “$mission”
$title_prefix An array containing additional output populated by modules
$title The page title
$title_suffix An array containing additional output populated by modules.
$messages HTML for status and error messages
$tabs Tabs linking to any sub-pages beneath the current page
$action_links Actions local to the page
$feed_icons A string of all feed icons for the current page
$node The node object
$mission deprecated
Navigation
$main_menu An array containing the Main menu links for the site
$secondary_menu An array containing the Secondary menu links for the site
$breadcrumb The breadcrumb trail for the current page
html.tpl.php variables
$css An array of CSS files for the current page.
$language The language the site is being displayed in.
$language->dir $language->language contains the language direction. It will either be ‘ltr’ or ‘rtl’. contains its textual representation.
$head_title A modified version of the page title, for use in the TITLE tag.
$head_title_array An associative array containing title : The title of the current page, if any. name: The name of the site. slogan: The slogan of the site, if any, and if there is no title.
$head Markup for the HEAD section (including meta tags, keyword tags, and so on)
$styles Style tags necessary to import all CSS files for the page
$scripts Script tags necessary to load the JavaScript files and settings for the page
$page_top Initial markup from any modules that have altered the page.
$page Rendered page content
$page_bottom Final closing markup from any modules that have altered the page. This variable should always be output last, after all other dynamic content.
$classes String of classes that can be used to style contextually through CSS.
block.tpl.php variables
Available Variables
$title Block title
$content Block content.
$block->module Module that generated the block.
$block->delta An ID for the block
$block->region The block region embedding the current block
$classes String of classes that can be used to style contextually through CSS
$title_prefix An array containing additional output
$title_suffix An array containing additional output
Helper Variables
$classes_array Array of HTML class attribute values
$block_zebra Outputs ‘odd’ and ‘even’ dependent on each block region.
$zebra Same output as $block_zebra but independent of any block region.
$block_id Counter dependent on each block region.
$id Same output as $block_id but independent of any block region.
$is_front Flags true when presented in the front page
$logged_in lags true when the current user is a logged in member.
$is_admin Flags true when the current user is an administrator.
$block_html_id A valid HTML ID and guaranteed unique.






node.tpl.php variables
Available Variables
$title The title of the node.
$content An array of node items. Use render($content) to print them all, or print a subset such as render($content[‘field_ example’]). Use hide($content[‘field_example’]) to temporarily suppress the printing of a given element.
$user_picture The node author’s picture from user-picture.tpl.php.
$date Formatted creation date
$name Themed username of node author output from theme_ username().
$terms the themed list of taxonomy term links output from theme_links().
$node_url Direct url of the current node.
$display_submitted Whether submission information should be displayed.
$submitted Submission information created from $name and $date during
$classes String of classes that can be used to style contextually through CSS
$title_prefix An array containing additional output populated by modules
$title_suffix An array containing additional output populated by modules
Other variables
$node Full node object
$type Node type
$comment_count Number of comments attached to the node.
$uid User ID of the node author.
$created Time the node was published formatted in Unix timestamp.
$classes_array Array of HTML class attribute values.
$zebra Outputs either “even” or “odd”.
$id Position of the node. Increments each time it’s output.
$terms Outputs taxonomy terms associated to nodes
Node Status
$view_mode View mode, e.g. ‘full’, ‘teaser’.
$teaser Flag for the teaser state (shortcut for $view_mode == ‘teaser’)
$page: Flag for the full page state.
$promote lag for front page promotion state.
$sticky Flags for sticky post setting.
$status Flags for content status
$comment State of comment settings for the node.
$readmore Flags TRUE if the teaser content of the node cannot hold the main body content.
$is_front Flags TRUE if current page is the front page.
$logged_in Flags TRUE when the current user is a logged in member.
$is_admin Flags TRUE when the current user is an administrator.
comment.tpl.php variables
$author Author of the comment
$content An array of comment items. Use render($content) to print them all, or print a subset such as render($content[‘field_ example’])
$created Formatted date and time for when the comment was created
$changed Formatted date and time for when the comment was last changed.
$new New comment marker.
$permalink Comment permalink.
$submitted Submission information created from $author and $created
$picture Author's picture.
$signature Author's signature.
$status Comment status
$title Linked title.
$classes String of classes that can be used to style contextually through CSS
$title_prefix An array containing additional output populated by modules
$title_suffix An array containing additional output populated by modules
$comment Full comment object
$node Node object the comments are attached to
Template files
[themename].info Meta data, CSS, JavaScript, block regions
html.tpl.php Page wrapper for your theme. Here you have the DOCTYPE declaration, the <head> info, and page closer.
page.tpl.php Default theme implementation to display a single Drupal page.
region.tpl.php Default theme implementation to display a region.
block.tpl.php Default theme implementation to display a block.
node.tpl.php Default theme implementation to display a node.
node--[content-type].tpl.php Template for displaying a node of a specific content type.
page--front.tpl.php Default theme implementation to display a custom frontpage
node--blog.tpl.php Default theme implementation to display a node of type blog
page--node-[#].tpl.php Theme implementation to display page with node ID #
block--[region].tpl.php Theme implementation for block in region name
html.tpl.php code
$header <head profile=”<?php print $grddl_profile; ?>”> <?php print $head; ?> <title><?php print $head_title; ?></title> <?php print $styles; ?> <?php print $scripts; ?> </head>
body <body class=”<?php print $classes; ?>” <?php print $attributes;?>> <div id=”skip-link”> <a href=”#main-menu”><?php print t(‘Jump to Navigation’); ?></a> </div> <?php print $page_top; ?> <?php print $page; ?> <?php print $page_bottom; ?> </body>
Logo <?php if ($logo): ?> <a href=”<?php print $front_page; ?>” title=”<?php print t(‘Home’); ?>” rel=”home” id=”logo”><img src=”<?php print $logo; ?>” alt=”<?php print t(‘Home’); ?>” /></a> <?php endif; ?>
Site Name <?php if ($site_name): ?> <?php if ($title): ?> <div id=”site-name”><strong> <a href=”<?php print $front_page; ?>” title=”<?php print t(‘Home’); ?>” rel=”home”><span><?php print $site_name; ?></span></a> </strong></div> <?php else: ?> <h1 id=”site-name”> <a href=”<?php print $front_page; ?>” title=”<?php print t(‘Home’); ?>” rel=”home”><span><?php print $site_name; ?></span></a> </h1> <?php endif; ?> <?php endif; ?>
Site Slogan <?php if ($site_slogan): ?> <div id=”site-slogan”><?php print $site_slogan; ?></div> <?php endif; ?>
Header <?php print render($page[‘header’]); ?>
Highlight <?php print render($page[‘highlight’]); ?>
Breadcrum <?php print $breadcrumb; ?>
Title Prefix <?php print render($title_prefix); ?>
Page Title <h1 class=”title” id=”page-title”><?php print $title; ?></h1>
Title Suffix <?php print render($title_suffix); ?>
Messages <?php print $messages; ?>
Tabs <?php print render($tabs); ?>
Help <?php print render($page[‘help’]); ?>
Content <?php print render($page[‘content’]); ?>
Action Links <ul class=”action-links”><?php print render($action_links); ?></ul>
Main Menu <?php print theme(‘links__system_main_menu’, array( ‘links’ => $main_menu, ‘attributes’ => array( ‘id’ => ‘main-menu’, ‘class’ => array(‘links’, ‘clearfix’), ), ‘heading’ => array( ‘text’ => t(‘Main menu’), ‘level’ => ‘h2’, ‘class’ => array(‘element-invisible’), ),)); ?>
Secondary Menu <?php print theme(‘links__system_secondary_menu’, array( ‘links’ => $secondary_menu, ‘attributes’ => array( ‘id’ => ‘secondary-menu’, ‘class’ => array(‘links’, ‘clearfix’), ), ‘heading’ => array( ‘text’ => t(‘Secondary menu’), ‘level’ => ‘h2’, ‘class’ => array(‘element-invisible’), ),)); ?>
Navigation <?php print render($page[‘navigation’]); ?>
Sidebar Region <?php print render($page[‘sidebar_first’]); ?>
Footer <?php print render($page[‘footer’]); ?>

test

Tuesday, March 26, 2013

Learn to use rsync For Transferring Files in Linux



rsync is a free software computer program for Unix and Linux like systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction.

So why do I care?

It can perform differential uploads and downloads of files over the network, transferring only the data that is different. This is great for doing backups between servers, or transferring contents between a development server and a production server. (Just what I used it for.) This is really neat because instead of needing to DL the files locally and then re-upload to the server, you just ask the servers to talk to each other.

 

How do I get it?

If your install of Linux doesn't already have it, use the appropriate package manager. (yum, apt-get, etc)
For example if you are using Debian or Ubuntu Linux, type the following command:

# apt-get install rsync


 

Copy file from a local computer to a remote server

Copy file from /www/backup_file.tar.gz to a remote server called epsilonk.com
$ rsync -v -e ssh /www/backup_file.tar.gz dummyaccount@epsilonk.com:~
Output:
Password:
sent 19009 bytes  received 35 bytes  2093.31 bytes/sec
total size is 19045

Copy file from a remote server to a local computer

Copy file /homedummyacount/some_file.txt from a remote server epsilonk.com to a local computer's /files directory:
$ rsync -v -e ssh dummyaccount@epsilonk.com:~/some_file.txt /files

Synchronize a local directory with a remote directory

$ rsync -r -a -v -e "ssh -l dummyaccount" --delete /local/www epsilonk.com:/www

Synchronize a remote directory with a local directory

$ rsync -r -a -v -e "ssh -l dummyaccount" --delete epsilonk.com:/www/ /local/www

Mirror a directory between my "old" and "new" web server/ftp

You can mirror a directory between an old (old.epsilonk.com) and new web server with the command
$ rsync -zavrR --delete --links --rsh="ssh -l user" my.old.server.com:/home/www /home/www

This assumes that ssh keys are set for password less authentication


The most common rsync command options

  • --delete : delete files that don't exist on sender
  • -v : Verbose 
  • -vv for more details that Verbose
  • -e "ssh options" : specify the ssh as remote shell
  • -a : archive mode
  • -r : recurse directories
  • -z : compress file data

As always though, consult the man.


Thanks to +Brian Downey of thelinuxfix.com for introducing me to rsync. :-) 

    Thursday, March 21, 2013

    Nikon D7100 review....

    I had been crouched next to the mailbox waiting for the mailman to arrive with my shiny new D7100...alas it finally showed up.


    I am currently writing up a full review, but in a nutshell. If you are a DX user but don't already have a D7000 and are pondering an upgrade....get one. If you have a D7000 already, (as I did prior to getting this.) it is more complicated flowchart.... I'll explain shortly.

    In short, Nikon hit a homerun with this camera.

    Tuesday, March 12, 2013

    Creating a Droplet with Photoshop

    In my last post I covered the basics of optimizing images for the web. Now I will go over how to automate that workflow for contributors or whatnot.

    Raindrops are falling on my head...

    Creating the droplet

    First we must create the actions that we wish to incorporate into our droplet:


    1. Open action tab (alt+F9 brings it up)
    2. Create new action set. Name it whatever you want, I called mine "Web Optimization".

      Create new action set











            


          3. Create new action. Name it whatever you want, I named mine "optimize and save".
                  Once you click record it will begin recording your actions so that they can be duplicated         
                  later upon calling this action . (You can pause recording at the bottom of the actions panel.)

          





















                4. Then proceed to optimize as seen in the last blog post.
                5. Once this is complete, then click the stop button at the bottom of the pane.
                6. Then File->Automate->Create Droplet...
              At this point you will encounter the dialog shown below:

























         Ensure that you save it somewhere you can find with the "choose" button.
        The destination defaults to "Save and close" but I prefer "Folder". This way you can create a naming convention that works well. Additionally I recommend checking the box for linux file name compatibility since that is likely where it will be hosted.

        This whole process creates an .exe that you then can merely drag files onto and it will optimize the files, and save them according to the naming convention that you have created. Even a non technical person can now optimize their own content. 

        Additionally this could be used to automate any number of other tasks.