Monthly Archives: September 2013

knife bash completion – with fixed environments autocomplete

Steven Danna has written the best knife bash completion script that I’ve seen for use with managing chef servers and the chef software by opscode. Update: Steven has now made an update so this is working! There was always one little thing wrong with it though: knife environment edit (etc) would not autocomplete – it would give an error The error was: -bash: _chef_environments: command not found The solution is pretty simple – you just need to edit the script and transpose two letters that were a typo from the file: _chef_environemnts should actually be: _chef_environments The difference is hard to spot but it’s key. Two other scripts for knife completion (that I don’t like as much) are this one by avishai-ish-shalom and a spinoff by vindimy – I think they are slower and not as user friendly. If you use zsh instead of bash there is also a zsh knife plugin which is part of oh-my-zsh that seems pretty good.

Posted in Server Administration, Tech Tips | Tagged , , | Leave a comment

Cpanel Set Default Webpage: defaultwebpage.cgi

On new cPanel servers if you try and access the site via IP or a domain name that does not yet have an account, you’ll be greeted with the Default Website Page response and redirected to /cgi-sys/defaultwebpage.cgi This is a little bit annoying because the page will set an expires time that is not immediate. That means in most browsers when you fix the error on your server (if you are the cPanel administrator) and try to check the site again, you’ll be automatically redirected to /cgi-sys/defaultwebpage.cgi and get the “Default Web Site Page” message even if your site has been correctly fixed. So that means you need to clear your browser’s cache each time it is messed up and you attempt a fix – this is a little annoying. What happens is that there is a default index.html file that uses meta refresh tag to forward you along to /cgi-sys/defaultwebpage.cgi The default index file is located at: /usr/local/apache/htdocs/index.html I’ve updated mine so it just displays an error on that page. You can even copy and paste the generated output from the defaultwebpage.cgi file into the index.html file (make a backup first if you’d like) and then the page will just show the error text and not redirect you to the cgi-bin directory and refuse to re-check the homepage without clearing the cache. Once you’re no longer being forwarded to the cgi-bin directory, you can just do some control+r or f5 to tell the browser to reload the page to … Continue reading

Posted in Tech Tips | Tagged | Leave a comment

ssh command returns “stdin: is not a tty”

If you run a command via ssh (secure shell) on linux and you get the following output: stdin: is not a tty The most common cause is the mesg y or similar command found in the file: /etc/bashrc What is mesg ? mesg is a Unix command that sets or reports the permission other users have to write to your terminal using the talk and write commands. How can I fix this issue? Option 1 would be to comment out the line. Option 2 would be to change the line to something like this to only invoke the command when you are actually using a connection with tty: if tty -s; then mesg y; fi

Posted in Linux, Server Administration | Tagged , | Leave a comment

Is there a Tagboard API?

After reading the Tagboard’s TOS and looking for what they say when discussing APIs, there is only a little bit of information. The TOS mentions APIs in regards that “… agree to the terms of the respective application programming interfaces (API) as follows…” So, no, it does not appear that they are allowing API access at this point.

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

Google Chrome Dinosaur

With the new version of Google Chrome around version 30.0, your page that shows: Unable to connect to the Internet Will have a cool picture of a dinosaur – a tyrannosaurus rex:

Posted in Marketing | Tagged , | Leave a comment

Failed to import Media – Solved

If you’re running WordPress and trying to export and import posts with the WordPress Importer you may be getting an error saying Failed to import Media Fortunately this plugin allows error debugging – you just have to turn it on. You can figure out what is causing the error by turning debugging on. There are two methods for this. First, you can edit the plugin file: /wp-content/plugins/wordpress-importer/wordpress-importer.php Change line 17: define( ‘IMPORT_DEBUG’, false ); to instead be true: define( ‘IMPORT_DEBUG’, true ); You can also edit your wp-config.php file and add this line: define( ‘IMPORT_DEBUG’, true ); That should hopefully help you stop this error: However since the plugin will attempt to redefine a constant that is already defined it may add errors to your log files, which means you should probably use the first method, or just remove line 17 from the plugin file.

Posted in Web Development | Tagged , | Leave a comment

WordPress: Enable Link Manager

Here is how to turn on and re-enable the link manager in WordPress. As of Version 3.5, the Links Manager and blogroll are hidden for new installs and any existing WordPress installs that do not have any links. You might think you need to do something like this: add_theme_support(‘link_manager’); But actually the plugin that re-enables the link manager is but a single line of PHP code: add_filter( ‘pre_option_link_manager_enabled’, ‘__return_true’ ); Which brings back the familiar link manager ( /wp-admin/link-manager.php ):

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

Adwords: Disable Tablets with full browsers

AdWords Enhanced Campaigns are here and the real reason finally surfaces – Google wants to get rid of the gap between mobile and desktop ads. So much traffic is going mobile, but so many people have opted not to purchase advertising targeted towards mobile devices. There is a lot of debate about whether or not a lot of conversions occur with mobile devices. Don’t be too Quick to Dismiss I wish there was an option to control devices more easily in Search as well. However, I wouldn’t be as quick to dismiss tablets. Most of my clients see equal or greater conversions from tablets now, I use my 7″ Nexus all the time to browse and buy products and the data I see from Analytics suggests that the customers of my clients do as well. (via) What’s The Real Reason For AdWords Enhanced Campaigns? In addition to increasing adoption rates for mobile advertising in AdWords by greatly simplifying campaign creation, management and reporting for mobile search, Google wants to, eliminate the gap between mobile and desktop CPC’s. (via) How To Disable In adwords choose the “Settings” tab and that is where you can make adjustments. At this time you can select the “Mobile devices with full browsers” segment and tell your bid adjustment to go down 100%. However, it appears that this unfortunate and annoying behavior that won’t let you opt out of “Tablets with full browsers” is in fact by design from Google and there seems to be no … Continue reading

Posted in Marketing | Tagged , | Leave a comment

Sublime Text: Remember Position In File

When you close and re-open files in SublimeText there is a way you can get your cursor to go back to the same position. I really like this behavior in VI/VIM called autocmd / BufReadPost – which is done by editing / changing a configuration file, usually ~/.vimrc or /etc/vim/vimrc and enabling this part: ” Uncomment the following to have Vim jump to the last position when ” reopening a file “if has(“autocmd”) ” au BufReadPost * if line(“‘\””) > 1 && line(“‘\””) < = line(“$”) | exe “normal! g’\”” | endif “endif Sublime Text In Sublime Text this is done by a plugin called BufferScroll BufferScroll: Remember, restore and sync scroll, bookmarks, marks, folds and cursors. keys: multiple columns one buffer, follow mode, split, screen, pages, synchronize vertical scrolling There are two methods for installation: Installation with Package Manager If you’re not yet using Package Manager you may be missing out. At first I thought “ah, who needs that I can just drop in the files I need” but once I started using it I realized that I had been wasting my time by not using it. Installation is done by pasting some text into the console and then once it is installed… You can use Cmd+Shift+P (Windows Control+Shift+P) to bring up the “Command Palette” and then install lots of great addons in just a few strokes – like installing BufferScroll is as easy as choosing “Package Control: Install Package”: And then selecting “BufferSroll” from the list of packages … Continue reading

Posted in Tech Tips | Tagged | Leave a comment

Chipboard vs Cardboard

Cardboard Cardboard is a generic term for a heavy-duty paper of various strengths, ranging from a simple arrangement of a single thick sheet of paper to complex configurations featuring multiple corrugated and un-corrugated layers. Despite widespread use in general English, the term is deprecated in business and industry. Material producers, container manufacturers, packaging engineers, and standards organizations, try to use more specific terminology. There is still no complete and uniform usage. Often the term “cardboard” is avoided because it does not define any particular material. Chipboard Chipboard, more commonly called Paperboard is a thick paper based material. While there is no rigid differentiation between paper and paperboard, paperboard is generally thicker than paper. According to ISO standards, paperboard is a paper with a basis weight above 224 g/m2, but there are exceptions. Paperboard can be single or multi-ply. Paperboard can be easily cut and formed, is lightweight, and because it is strong, is used in packaging. Another end-use would be graphic printing, such as book and magazine covers or postcards. Sometimes it is referred to as cardboard, which is a generic, lay term used to refer to any heavy paper pulp based board. Paperboard is also used in fine arts for creating sculptures.

Posted in Marketing | Tagged | Leave a comment