Custom rubble in Aptana not activated automatically - aptana

I am new to Aptana, so I could be missing something obvious. My problem in that bundle I created does not get activated when Aptana is loaded. I have to update date of the rubble.rb file for it to work.
touch ~/Documents/Aptana Rubles/ioncubeEncode.ruble
After I do that, for the rest of that Aptana session things are peachy.
I do not think it is relevant, but here is bundle code, which works just fine (when it works):
require 'ruble'
#Ruble::Logger.log_level = :trace
bundle do |bundle|
bundle.author = "Sasha"
bundle.copyright = "None"
bundle.display_name = "Ioncube Encode"
bundle.description = "Encode just saved php file form base_local to base folder"
end
command "Ioncube Encode" do |cmd|
cmd.input = :document
cmd.output = :output_to_console
cmd.trigger = :execution_listener , "org.eclipse.ui.file.save"
cmd.invoke do |ctx|
source_path = ENV['TM_FILEPATH']
ext = File.extname(source_path)
if ext == '.php'
if ( source_path =~ /base_local/)
destination_path = source_path.sub('/base_local/','/base/')
#CONSOLE.puts "Ioncube Encoding: " + source_path + " to " + destination_path
exec="/usr/local/ioncube/ioncube_encoder5 -v --optimize more --without-loader-check " + source_path + " -o " +destination_path + " 2>&1"
IO.popen(exec, 'r+') do |io|
io.close_write
CONSOLE.puts io.read
end
end
end
end
end
This might not seem like a big deal but it bothers me - a lot.

Related

How do I let target image includes qmake in Yocto?

I'd like to add qmake tool to target image with yocto.
So, I've tried below.
# build/conf/local.conf
EXTRA_IMAGE_FEATURES += "dev-pkgs"
EXTRA_IMAGE_FEATURES += "tools-sdk"
EXTRA_IMAGE_FEATURES += "petalinux-qt"
EXTRA_IMAGE_FEATURES += "petalinux-qt-extended"
IMAGE_INSTALL_append = " qttools qttools-dev qttools-tools "
IMAGE_INSTALL_append = " packagegroup-qt5-toolchain-target "
As a result, it installed Qt libraries not qmake.
Please, let me know how to do...
I found it as below!
IMAGE_INSTALL_append = " qtbase-dev qtbase-mkspecs qtbase-tools "
I found it as below!
IMAGE_INSTALL_append = " qtbase-dev qtbase-mkspecs qtbase-tools "

Execute .jar file in .net core on Openshift container platform

net core application which internally calls a java (.jar) file using .net Process class. I have used cmd.exe to run .jar file along with parameters. I have deployed this application on Openshift Container Platform. But as openshift is running on Linux, so cmd.exe is not available.
Below is code in .net core to execute jar file.
Process cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.WorkingDirectory = Common.JarWorkingDir;
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.Arguments = "/K java -jar " + string.Format("{0} {1}", '"' + Common.JarFilePath + '"', '"' + sourceCodePath + '"');
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardInput = true;
cmd.Start();
cmd.StandardInput.WriteLine("exit");
cmd.StandardInput.Flush();
cmd.WaitForExit();
So Jar file is unable to execute. Any alternative to execute this jar with .net on OpenShift. Please help.
OpenShift is essentially Kubernetes running Linux containers. In other words, your code should act as if it is running on Linux.
Instead of cmd.exe, use bash (or, sh, or really, whatever shell is pre-installed in your container):
Process cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.WorkingDirectory = Common.JarWorkingDir;
cmd.StartInfo.FileName = "bash";
cmd.StartInfo.Arguments = "-c 'java -jar " + string.Format("{0} {1}", '"' + Common.JarFilePath + '"', '"' + sourceCodePath + '"'');
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardInput = true;
cmd.Start();
cmd.StandardInput.WriteLine("exit");
cmd.StandardInput.Flush();
cmd.WaitForExit();
You can maybe even remove some of the lines. CreateNoWindow, for example, is not required because .NET Core does not create windows on Linux at all.
If you have no shell expressions, perhaps you can even get things to be simpler and simplify from this:
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.FileName = "bash";
cmd.StartInfo.Arguments = "-c 'java -jar " + string.Format("{0} {1}", '"' + Common.JarFilePath + '"', '"' + sourceCodePath + '"'');
to something like this:
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.FileName = "java";
cmd.StartInfo.Arguments = $"-jar \"{Common.JarFilePath}\" \"{sourceCodePath}\"";
Oh, and watch out for the quoting in your Arguments variable. If you wrap the entire command after -c with single quotes, you should be fine, but if you are doing something trickier - if Common.JarFilePath isn't a simple file name - it may not work so well. Definitely test and tweak that. Maybe consider EscapeAndConcatenate.

Invoke-Webrequest ASP.Net Error

I have a script which I use to load a webpage, retrieve information from said webpage, then output said information to a file. It had been working perfectly until today, when I have been getting an error which reads:
invoke-webrequest : Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
/foo/Reports/SearchLocation.asp, line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.
At C:\path.ps1:7 char:12
+ $url = invoke-webrequest "http://url/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
I do not believe there have been any changes to the site which it is pulling its data from, and the file it is getting the input information from has no formatting errors.
Some googling around leads me to believe that the issue is that the page has more than 4 mb worth of data to load, and the default buffer size is 4 mb, but I can't find any instructions for how to change the buffer size in PowerShell.
I came across the clear-webconfiguration cmdlet, but I'm not certain whether or not that is what I need, or how exactly to implement it within my script. Here is the main portion of my code:
foreach($c in $csv){
[array]$tags = $null
$url = invoke-webrequest "http://url.com" -UseDefaultCredentials
$table = $url.ParsedHTML.getElementsByTagName('table')[7]
$rows = $table.getElementsByTagName('tr')
if($c.'Was this user on the old file?' -eq 'Yes'){
if($table.innerText -like "*N/A*" ){
$man = $c.'Manager Name' -replace ',',';'
$badusers += $c.'User ID' + "," + $c.Name + "," + $man + "," + $c.'CC'
}
else{
foreach($row in $rows){
$bcol = $row.getElementsByTagName('td') | Where-Object{$_.cellIndex -eq 1} | select -First 1
$ccol = $row.getElementsByTagName('td') | Where-Object{$_.cellIndex -eq 7} | select -First 1
$bcol = $bcol.innerText
$ccol = $ccol.innerText
if($ccol -ne $c.'CC'){
$tags += $bcol + ",," + $c.'CC' + "," + $c.'User ID'
}
}
if($tags -ne $null){
$results += $tags
}
}
}
}
Any help on solving this issue is much appreciated.

Failed to Import-Module MSOnline in ASP.NET

We have created a mini web program for running PowerShell in asp.net. the PowerShell command is running fine. but when we try to import the MSOnline module, it will be shown the following error:
Could not load file or assembly
'file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll'
or one of its dependencies. An attempt was made to load a program with
an incorrect format.
Dim Ps As PowerShell = PowerShell.Create()
Dim tempScript As String = "Import-Module MSOnline " + Environment.NewLine
tempScript = tempScript + "$username = 'xxx#xxx.com' " + Environment.NewLine
tempScript = tempScript + "$password = 'abcd1234' " + Environment.NewLine
tempScript = tempScript + "$secureStringPwd = $password | ConvertTo-SecureString -AsPlainText -Force " + Environment.NewLine
tempScript = tempScript + "$creds = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $secureStringPwd " + Environment.NewLine
tempScript = tempScript + "Connect-MsolService -Credential $creds " + Environment.NewLine
tempScript = tempScript + "Get-MsolDomain" + Environment.NewLine
Ps.Commands.AddScript(tempScript)
' Execute the script
Dim results = Ps.Invoke()
PS C:> $PSVersionTable | Out-String
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.34209
BuildVersion 6.3.9600.17400
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
Update : 3-Aug-2017
Try to use process.start to call a CMD, and then the cmd call a powershell, but it failed also. same error message.
Private Function RunBatch() As String
Dim proc As New Process
Dim strBuilder As StringBuilder = New System.Text.StringBuilder
proc.StartInfo.FileName = "C:\temp\enableMFA.bat"
proc.StartInfo.UseShellExecute = False
proc.StartInfo.RedirectStandardOutput = True
proc.Start()
proc.WaitForExit()
Dim output() As String = proc.StandardOutput.ReadToEnd.Split(CChar(vbLf))
For Each ln As String In output
strBuilder.Append(ln & vbNewLine + vbLf)
Next
Return strBuilder.ToString
End Function
Error Message:
C:\Users\admin\Desktop\Preview\Preview\bin\Debug>powershell -File
"C:\temp\enableMFA.ps1"
Import-Module : Could not load file or assembly
'file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll'
or
one of its dependencies. An attempt was made to load a program with an
incorrect format.
At C:\temp\enableMFA.ps1:1 char:1
Import-Module MSOnline
~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidOperation: (:) [Import-Module], BadImageFormatException
FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Finally fixed the issue by change the CPU to x64, this is the steps
Right click the project >> properties >> complie >> Target CPU to x64
Go to TOOLS >> Options >> Projects and Solutions >> Web Projects >> use 64bit IIS Express
** Remember close the VS2013 and open the project again **
** Thx for the hints from David Brabant**

Neocomplete and Eclim don't work together

with the default set up, there nothing shows about the auto completion,either no autocomplete shows up nor <C-X><C-U> key, the later shows "pattern not found", Is there anyone can tell me how to make it working?
here my vimrc file:
set nocompatible
syntax on
set laststatus=2
set encoding=utf-8
set guifont=Anonymous\ Pro\ for\ Powerline:h13
let g:Powerline_symbols = 'fancy'
if has("gui_running")
set guioptions=egmrt
set transparency=10
set guifont=menlo:h14
endif
imap jj <Esc>
set autoindent
set tabstop=4
set shiftwidth=4
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
" original repos on github
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'tpope/vim-rails'
Bundle 'Shougo/neocomplcache'
Bundle 'nanotech/jellybeans.vim'
Bundle 'Rip-Rip/clang_complete'
Bundle 'osyo-manga/neocomplcache-clang_complete'
colorscheme jellybeans
Bundle 'godlygeek/tabular'
Bundle 'Lokaltog/vim-powerline'
Bundle 'tpope/vim-haml'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'vim-ruby/vim-ruby'
Bundle 'kchmck/vim-coffee-script'
" vim-scripts repos
Bundle 'DrawIt'
Bundle 'tComment'
Bundle 'sudo.vim'
Bundle 'Align'
" non github repos
"Bundle 'git://git.wincent.com/command-t.git'
filetype plugin indent on " required!
nmap 88 :TagbarToggle<CR>
nmap 99 :NERDTreeToggle<CR>
" use neocomplcache & clang_complete
" add neocomplcache option
let g:neocomplcache_force_overwrite_completefunc=1
" add clang_complete option
let g:clang_complete_auto=1
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplcache_dictionary_filetype_lists = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
imap <C-k> <Plug>(neocomplcache_snippets_expand)
smap <C-k> <Plug>(neocomplcache_snippets_expand)
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
" SuperTab like snippets behavior.
"imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" AutoComplPop like behavior.
"let g:neocomplcache_enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplcache_enable_auto_select = 1
"let g:neocomplcache_disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
"inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {}
endif
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
"autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
Put this in your vimrc
let g:EclimCompletionMethod = 'omnifunc'
Check out http://eclim.org/vim/code_completion.html for more information.

Resources