Monday, April 16, 2012

What's your preferred IDE?

Currently, still, it appears to be screen/byobu plus vim.

Probably I am missing all the niceties of something like netbeans, but here's how I set up a cakephp environment:

create a file that contains paths to sections...
---BEGIN FILE ---
cd /path/to/app/Controller
screen -t Controller
cd /path/to/app/Model
screen -t Model
cd /path/to/app/View
screen -t View
cd /path/to/app
screen -t app
cd /path/to/app/webroot/js
screen -t js
cd /path/to/app/webroot/css
screen -t css
cd /path/to/app/webroot/tmp/logs
screen -t logs
---END FILE ---

If you're using tmux instead of screen:
---BEGIN FILE---
cd /path/to/app/Controller
tmux new-window -n Controller
cd /path/to/app/Model
tmux new-window -n Model
cd /path/to/app/View
tmux new-window -n View
cd /path/to/app/
tmux new-window -n approot
cd /path/to/app/webroot/js
tmux new-window -n js
cd /path/to/app/webroot/css
tmux new-window -n css
cd /path/to/app/tmp/logs
tmux new-window -n log
---END FILE---


then simply source the file when you want create the screens for our application
To change between screens, the default mappings of ctrl-a, number will get you there.

I also use :split within vim to work on multiple documents within a given structure. I find this *generally* gives me a quick and easy way to handle the substructures I need and keeps me organized. The few other things most IDEs also have (like class trees and completion) I haven't yet had to use, but I figure I could also macro that as I need. On the logs screen, I can tail -f debug.log.

Tuesday, April 3, 2012

CakePHP helper to suggest input

What's it do?
makes it easier to make a gray suggest input box. Just use drop it as InputHelper.pm in View/Helper/ and call it where and how you need it. call it just like Form->input but add a sample text for the box.
$this->Input->input(fieldname, options array, 'sample text');

As an example, see what happens when you click in , click out, and change the content this box.




<?php App::uses('FormHelper', 'View/Helper');
/* helper to make default input help that disappears when clicked */
/* usage: $this--->Input-&gt;input */
class InputHelper extends FormHelper {
public function input($fieldname, $options=array(null), $fill) {
$options['class'] = ' dimmed';
$options['value'] = $fill;
$options['onClick'] = "if (this.value=='".$fill."') {this.value='';this.style.color='black'}";
$options['onBlur'] = "if (this.value=='') {this.value = '".$fill."'; this.style.color='gray'}";
$out = parent::input($fieldname, $options);
$out .= parent::hidden($fieldname . "_hidden", array('value' =&gt; $fill));
return $out;
}
}
?>

What's with the hidden? If you want to know what the original content was, you can test against this in your Controller to see if fieldname value is equal to fieldname_hidden value and don't store if it matches.

Friday, March 23, 2012

Apology

I made a post on another website and it went pretty bad.
It was a huge error in judgment, and all I have left that I can do is to post an apology.
I truly, deeply, honestly apologize for the post. It was all kinds of wrong, and indeed I made things worse trying to defend an indefensible position.

If such a thing can be in your heart to forgive, please do. If I could take it back, I would. But I realize it was wrong.

I'm sorry.

Thursday, February 2, 2012

Find out what services need credentials

Symptom: You need to adapt to a changing environment where certain Windows services may have been enabled under the credentials of a user who no longer has access to anything.

How do you get a list of servers, service, and credentials quickly?

wmic /node:server1,server2,server3,"server-4" services get DisplayName,StartName /Format:csv

Wednesday, January 18, 2012

Outlook Fast Search doesn't return results

Symptom: You're in outlook, and the search results aren't as expected, or not returning anything.

Check here: http://office.microsoft.com/en-us/outlook-help/instant-search-is-not-finding-items-HA010198085.aspx

VERIFY THAT YOUR OUTLOOK DATA FILES CAN BE INDEXED
Outlook indexes the following data files:

Personal Folders files (.pst)
Offline Folder files (.ost)
This includes Microsoft Windows Live Mail, IMAP, and POP e-mail accounts. If you use a Microsoft Exchange account (much more common in business e-mail systems than in a home or personal account), you must be connected to the server running Exchange and use Cached Exchange Mode for Instant Search to index your messages. Cached Exchange Mode uses an Offline Folders file (.ost) to save your information on your computer. To verify which data files are being indexed, do the following:
On the Tools menu, point to Instant Search, and then click Search Options.
Alternatively, click the arrow in the Instant Search pane, and then click Search Options on the menu.

Under Indexing, verify that the data files that you want to include in your search are selected in the Index messages in these data files list.
VERIFY THAT INDEXING IS COMPLETE
To verify the indexing status, do the following:

On the Tools menu, point to Instant Search, and then click Indexing Status.
Alternatively, click the arrow in the Instant Search pane, and then click Indexing Status on the menu.

Verify that the dialog box reports 0 items remaining. If not, indexing is not complete and needs to finish before all of your Outlook items can be searched.
INDEXING STATUS REPORTS "0 ITEMS REMAINING," HOWEVER, SEARCH RESULTS ARE NOT CORRECT
If the Indexing Status reports 0 items remaining and Instant Search is still not returning the correct search results, exit Outlook and restart your computer. When you start Outlook again, verify that Outlook is indexing your items properly by doing the following:

On the Tools menu, point to Instant Search, and then click Indexing Status.
Alternatively, click the arrow in the Instant Search pane, and then click Indexing Status on the menu.

Verify that the number of items in the Indexing Status dialog box has increased. If the number has not increased, you must wait until indexing is complete for the results.


While you're looking at the checkboxes for what is supposed to be indexed, if you would like to start from scratch, clear the box[es] and OK through to exit the index search. Then go back and check them again, and OK out. This is what will take a few hours, but it will now index your email as if it never had done it before. Verify on occasion. The numbers should increase for a while, then decrease back to zero. Once completed, your index has been rebuilt.

Thursday, July 7, 2011

Can't send ctrl-alt-del via UVNC UltraVNC

well, it's not fun from the viewer, but let's say you've installed UltraVNC and rebooted the remote computer. Now you can't send Ctrl-Alt-Del to log in.

On screen keyboard can help for Windows 7 and (I think? Vista). You know that button in the bottom left? Turn on the on screen keyboard. Press the ctrl key, then the alt key, then the del key and you're in.

Tuesday, July 5, 2011

Captive portal follows you home

had an issue with a client where the hotel's captive portal followed him home with IE9. flushdns didn't work, neither cache and cookie delete. This was specifically an issue with onsite local connections, so I added the IP address to "local sites" in IE and it seemed to have resolved.

Blog Archive