Wednesday, March 7, 2012

notepad++ contoh pemograman or plugin example

You would like to create own plugin for notepad++ and looking for some examples?
Just take existing sources and good guide.

What also you need? Right, Visual Studio to write/compile/build/debug. Look here.
or buy it

Friday, March 2, 2012

otrs Cc and Bcc autocomplete


If you miss autocomplete in Cc or Bcc fields just add piece of code into AgentCustomerSearch.dtl template

        
    Core.Agent.CustomerSearch.Init($("#Cc"), $QData{"ActiveAutoComplete"});
    Core.Agent.CustomerSearch.Init($("#Bcc"), $QData{"ActiveAutoComplete"});

Enjoy!

Monday, January 23, 2012

That assembly does not allow partially trusted callers

It's really good described in "Improving Web Application Security: Threats and Countermeasures" article. Most common solution is bit of code in web.config file, which doesn't help me a lot.

<system.web>
<trust level="Full" originUrl=""/>
</system.web>

another popular way to recompile assembly with [assembly: AllowPartiallyTrustedCallers] attribute also was not solution for me.


After all I have added assembly to GAC, restarted IIS and whooops, exception gone!
you will not find gacutil.exe into Framework directory
C:\Windows\Microsoft.NET\Framework\v2.0.50727\
it's located into SDKs directory
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\

So you should install problem assembly into GAC like
gacutil.exe -i itextsharp.dll


P.S.: it won't eliminate exception with GoDaddy hosting :( according to the article your code must be adapted to Medium trust level :(

Monday, January 2, 2012

disable autocomplete on login page


you need to add autocomplete property like
        


<div class="Field"> 

<input type="text" id="User" name="User"  class="W50pcautocomplete="off" 

readonly="readonly"/>
</div>



Wednesday, December 14, 2011

how to enable auto complete in OTRS To field?

have you any idea how to remove autocomplete=off in AgentTicketCompose ?
i would like to use cached in browser emails instead of AJAX request and spent two days to find the piece of code!

Thus you should open AgentCustomerSearch.dtl file and comment out one string:
        

//    Core.Agent.CustomerSearch.Init($("#CustomerAutoComplete"), $QData{"ActiveAutoComplete"});


Done!

Similar: how to disable autocomplete 

Tuesday, December 13, 2011

PV-WAVE Program And Function List in notepad++


Following instruction can be applied for first installation of Notepad++ on Windows 7.

- get keywords and FunctionList Plugin config here.
- unpack from archive into %APPDATA%\Notepad++\ directory
CAUTION!: it will be userDefineLang.xml and FunctionListRules.xml files overwritten!!

- OR -

you can find userDefineLang.xml file and insert    <UserLang name="pvwave" ext=""> section into it,
also find FunctionListRules.xml file and insert  <Language name="pvwave" imagelistpath=""> section.

Resulting screenshot:

Enjoy it!

Thursday, December 1, 2011

HOWTO: send mail using perl on windows without sendmail

Q: How to send mail using perl on windows without sendmail?
A: You need Mail::Sender module and available SMTP Server

e.g.
Simple single part message
        $sender = new Mail::Sender {
                smtp => 'mail.yourISP.com',
                from => 'somebody@somewhere.com',
                on_errors => undef,
        }
                or die "Can't create the Mail::Sender object: $Mail::Sender::Error\n";
        $sender->Open({
                to => 'mama@home.org, papa@work.com',
                cc => 'somebody@somewhere.com',
                subject => 'Sorry, I\'ll come later.'
        })
                or die "Can't open the message: $sender->{'error_msg'}\n";
        $sender->SendLineEnc("I'm sorry, but thanks to the lusers,
                I'll come at 10pm at best.");
        $sender->SendLineEnc("\nHi, Jenda");
        $sender->Close()
                or die "Failed to send the message: $sender->{'error_msg'}\n";


read more here

yet another good option is Email::Sender module
usage:

  my $message = Email::MIME->create( ... );
  # produce an Email::Abstract compatible message object,
  # e.g. produced by Email::Simple, Email::MIME, Email::Stuff

  use Email::Sender::Simple qw(sendmail);
  use Email::Sender::Transport::SMTP qw();
  use Try::Tiny;

  try {
    sendmail(
      $message,
      {
        from => $SMTP_ENVELOPE_FROM_ADDRESS,
        transport => Email::Sender::Transport::SMTP->new({
            host => $SMTP_HOSTNAME,
            port => $SMTP_PORT,
        })
      }
    );
  } catch {
      warn "sending failed: $_";
  };