Error in TesseractTransform in alfresco - transform

I am tring to search content from image but unfortunately i got error. I am trying to use tesseract ocr tool. my service-context.xml code is as follow
> <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC
> '-//SPRING//DTD BEAN//EN'
> 'http://www.springframework.org/dtd/spring-beans.dtd'> <!--
> This file is part of the Tesseract Alfresco Integration written by
> Simon White.
>
> The Integration is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation, either version 3 of the License, or
> (at your option) any later version.
>
> The Integration is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with the Integration. If not, see <http://www.gnu.org/licenses/>. --> <beans> <bean
> id="transformer.Tesseract"
> class="org.alfresco.repo.content.transform.ProxyContentTransformer"
> parent="baseContentTransformer"> <property name="worker"> <ref
> bean="transformer.worker.Tesseract" /> </property> <property
> name="explicitTransformations"> <list>
> <bean
> class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
> <property name="sourceMimetype">
> <value>image/png</value>
> </property>
> <property name="targetMimetype">
> <value>text/plain</value>
> </property>
> </bean>
> <bean
> class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
> <property name="sourceMimetype">
> <value>image/jpeg</value>
> </property>
> <property name="targetMimetype">
> <value>text/plain</value>
> </property>
> </bean>
> <bean
> class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
> <property name="sourceMimetype">
> <value>image/gif</value>
> </property>
> <property name="targetMimetype">
> <value>text/plain</value>
> </property>
> </bean> </list> </property> </bean>
>
>
> <bean id="transformer.worker.Tesseract"
> class="smwc.alfresco.ocr.TesseractTransformWorker"> <property
> name="mimetypeService"> <ref bean="mimetypeService" />
> </property> <property name="executer"> <bean
> name="transformer.Tesseract.Command"
> class="org.alfresco.util.exec.RuntimeExec">
> <property name="commandsAndArguments">
> <map>
> <entry key=".*">
> <list>
> <value>/home/alfresco-4.2.f-3/ocr.sh</value>
> <value>${source}</value>
> <value>${target}</value>
> </list>
> </entry>
> </map>
> </property> </bean> </property> <property name="checkCommand"> <bean
> name="transformer.Tesseract.CheckCommand"
> class="org.alfresco.util.exec.RuntimeExec">
> <property name="commandsAndArguments">
> <map>
> <entry key=".*">
> <list>
> <value>/home/alfresco-4.2.f-3/ocr.sh</value>
> <value>-v</value>
> </list>
> </entry>
> </map>
> </property> </bean> </property> </bean>
>
> </beans>
and ocr.sh as follows
#Number of Parameters
PARAM=$#
#Test parameters
if [[ $PARAM -lt 2 ]];
then
echo “Usage: $0 out.pdf input*.png”
echo “out.pdf is the desired output file”
echo “input*.png or input*.tif is a list of files to be converted”
exit 1
fi
#Outputfile
OUTFILE=$1
shift
#PDF output?
ATEST=$(basename $OUTFILE)
BTEST=$(basename $ATEST .pdf)
if [[ ${OUTFILE: -4} != ".pdf" ]]
then
echo “FILE $OUTFILE is not a pdf-file.”
exit 1
fi
#Do not overwrite existing output files
if [ -e $OUTFILE ]; then
echo “File $OUTFILE exists – not overwritten.”
exit 3
fi
LIST=
#Convert input files
for (( I=1; $I < $PARAM; I++ ))do
FILE=$1
shift
echo "Working on: $FILE"
#Convert
# /home/user/tesseract-ocr/api/tesseract $FILE $BTEST nobatch hocr
tesseract $FILE $BTEST$I -l en hocr
/usr/bin/hocr2pdf -i $FILE -o $I.pdf < $BTEST$I.html
#Eingangsliste der PDFS anlegen
LIST="$LIST$I.pdf "
done
#Concatination
echo "Concatenating PDF as $OUTFILE"
/usr/bin/pdftk $LIST output $OUTFILE
#cleaning up
echo "Cleaning up"
rm *html
for (( J=1;J<PARAM;J++ ))do
rm $J.pdf
done
echo "Finished."
problem is when i restart my alfresco server and upload any png image at that i got following error
Execution result:
os: Linux
command: /home/alfresco-4.2.f-3/ocr.sh /home/alfresco-4.2.f-3/apache-tomcat/temp/Alfresco/TesseractTransformWorker_source_8694251634210177054.png /home/alfresco-4.2.f-3/apache-tomcat/temp/Alfresco/TesseractTransformWorker_target_1748466871282546000.txt
succeeded: false
exit code: 2
out:
err: Cannot run program "/home/alfresco-4.2.f-3/ocr.sh": error=13, Permission denied
at smwc.alfresco.ocr.TesseractTransformWorker.transform(TesseractTransformWorker.java:171)
at org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:98)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:211)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.indexProperty(ADMLuceneIndexerImpl.java:1509)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.createDocumentsImpl(ADMLuceneIndexerImpl.java:907)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.createDocuments(ADMLuceneIndexerImpl.java:726)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl$6.execute(ADMLuceneIndexerImpl.java:2247)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl$6.execute(ADMLuceneIndexerImpl.java:2243)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl$1.execute(AbstractLuceneIndexerImpl.java:682)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.doInReadthroughTransaction(AbstractLuceneIndexerImpl.java:667)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.readDocuments(ADMLuceneIndexerImpl.java:2242)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.updateFullTextSearch(ADMLuceneIndexerImpl.java:2180)
at org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl$1.execute(FullTextSearchIndexerImpl.java:232)
at org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl$1.execute(FullTextSearchIndexerImpl.java:220)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:342)
at org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl.index(FullTextSearchIndexerImpl.java:218)
at org.alfresco.repo.search.impl.lucene.fts.FTSIndexerJob.execute(FTSIndexerJob.java:46)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
please help me to solve this problem
Thanks

Related

Can't open remote ssh directory after update

I have been using VSCode on a Windows laptop for an ssh remote directory on a Linux machine. Things were working fine until an update of VSCode 1.68.0 and now I can't open the remote directory.
On Windows, the output says:
[12:55:24.183] Log Level: 2
[12:55:24.185] remote-ssh#0.82.1
[12:55:24.185] win32 x64
[12:55:24.226] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[12:55:24.227] "remote.SSH.useLocalServer": false
[12:55:24.227] "remote.SSH.showLoginTerminal": false
[12:55:24.227] "remote.SSH.remotePlatform": {"runon":"linux","pfuntner-kube":"linux","everyday":"linux","kube":"linux","ubuntu":"linux"}
[12:55:24.227] "remote.SSH.path": C:\cygwin64\bin\ssh.exe
[12:55:24.228] "remote.SSH.configFile": c:\users\jpfuntne\.ssh\config
[12:55:24.228] "remote.SSH.useFlock": true
[12:55:24.228] "remote.SSH.lockfilesInTmp": false
[12:55:24.228] "remote.SSH.localServerDownload": auto
[12:55:24.229] "remote.SSH.remoteServerListenOnSocket": false
[12:55:24.229] "remote.SSH.showLoginTerminal": false
[12:55:24.229] "remote.SSH.defaultExtensions": []
[12:55:24.229] "remote.SSH.loglevel": 2
[12:55:24.229] "remote.SSH.enableDynamicForwarding": true
[12:55:24.230] "remote.SSH.enableRemoteCommand": false
[12:55:24.230] "remote.SSH.serverPickPortsFromRange": {}
[12:55:24.230] "remote.SSH.serverInstallPath": {}
[12:55:24.239] SSH Resolver called for host: ubuntu
[12:55:24.239] Setting up SSH remote "ubuntu"
[12:55:24.247] Using commit id "4af164ea3a06f701fe3e89a2bcbb421d2026b68f" and quality "stable" for server
[12:55:24.254] Install and start server if needed
[12:55:24.257] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[12:55:24.568] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[12:55:24.574] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[12:55:24.575] Running script with connection command: "C:\cygwin64\bin\ssh.exe" -T -D 65341 -F "c:\users\jpfuntne\.ssh\config" ubuntu bash
[12:55:24.591] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[12:55:25.421] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[12:55:25.421] Got some output, clearing connection timeout
[12:55:26.367] > 28e76cc256c4: running
[12:55:26.405] > Acquiring lock on /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb42
> 1d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
[12:55:26.430] > Installing to /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d20
> 26b68f...
> 28e76cc256c4%%1%%
> Downloading with wget
[12:55:33.759] > wget download failed
> failed: Connection timed out.
> printenv:
> SHELL=/bin/bash
> PWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.235.230 65347 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=5
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.235.230 65347 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu
> _=/usr/bin/printenv
[12:55:33.764] >
> Trigger local server download
> 28e76cc256c4:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/ubuntu/.vscode-server/bin/==
> destFolder2==4af164ea3a06f701fe3e89a2bcbb421d2026b68f==
> 28e76cc256c4:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026
> b68f/vscode-scp-done.flag and vscode-server.tar.gz to exist
[12:55:33.765] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"}
[12:55:33.765] Downloading VS Code server locally...
[12:55:33.770] >
>
[12:55:34.131] Resolver error: Error: Server returned 404
at v (vscode-file://vscode-app/c:/Users/jpfuntne/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:622:38476)
at k.download (vscode-file://vscode-app/c:/Users/jpfuntne/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:623:1592)
[12:55:34.136] ------
On Linux, all I have is:
$ find .vscode-server -type f | xargs -r ls -ld
-rw-rw-r-- 1 ubuntu ubuntu 0 Jun 15 12:55 .vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
-rw-rw-r-- 1 ubuntu ubuntu 0 Jun 15 12:55 .vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/vscode-server.tar.gz
$
When I was first having trouble, I did rm -rf .vscode to fix things but it didn't help.
Can anyone help?
I tried to start VSCode again today. At first I thought it had the same problem but it looks like things are working ok now and I got in!
[07:14:44.009] Log Level: 2
[07:14:44.010] remote-ssh#0.82.1
[07:14:44.010] win32 x64
[07:14:44.048] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[07:14:44.048] "remote.SSH.useLocalServer": false
[07:14:44.049] "remote.SSH.showLoginTerminal": false
[07:14:44.049] "remote.SSH.remotePlatform": {"runon":"linux","pfuntner-kube":"linux","everyday":"linux","kube":"linux","ubuntu":"linux"}
[07:14:44.049] "remote.SSH.path": C:\cygwin64\bin\ssh.exe
[07:14:44.049] "remote.SSH.configFile": c:\users\jpfuntne\.ssh\config
[07:14:44.049] "remote.SSH.useFlock": true
[07:14:44.049] "remote.SSH.lockfilesInTmp": false
[07:14:44.049] "remote.SSH.localServerDownload": auto
[07:14:44.050] "remote.SSH.remoteServerListenOnSocket": false
[07:14:44.050] "remote.SSH.showLoginTerminal": false
[07:14:44.050] "remote.SSH.defaultExtensions": []
[07:14:44.050] "remote.SSH.loglevel": 2
[07:14:44.050] "remote.SSH.enableDynamicForwarding": true
[07:14:44.050] "remote.SSH.enableRemoteCommand": false
[07:14:44.050] "remote.SSH.serverPickPortsFromRange": {}
[07:14:44.050] "remote.SSH.serverInstallPath": {}
[07:14:44.056] SSH Resolver called for host: ubuntu
[07:14:44.056] Setting up SSH remote "ubuntu"
[07:14:44.062] Using commit id "4af164ea3a06f701fe3e89a2bcbb421d2026b68f" and quality "stable" for server
[07:14:44.068] Install and start server if needed
[07:14:44.071] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[07:14:44.354] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[07:14:44.386] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[07:14:44.387] Running script with connection command: "C:\cygwin64\bin\ssh.exe" -T -D 63895 -F "c:\users\jpfuntne\.ssh\config" ubuntu bash
[07:14:44.400] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[07:14:46.375] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[07:14:46.375] Got some output, clearing connection timeout
[07:14:47.361] > cb747be286c8: running
> Acquiring lock on /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb42
> 1d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> Installing to /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d20
> 26b68f...
> cb747be286c8%%1%%
> Downloading with wget
[07:14:54.685] > wget download failed
> failed: Connection timed out.
> printenv:
> SHELL=/bin/bash
[07:14:54.692] >
> PWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.240.153 63898 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=63
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.240.153 63898 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu
> _=/usr/bin/printenv
[07:14:54.695] >
> Trigger local server download
> cb747be286c8:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/ubuntu/.vscode-server/bin/==
> destFolder2==4af164ea3a06f701fe3e89a2bcbb421d2026b68f==
> cb747be286c8:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026
> b68f/vscode-scp-done.flag and vscode-server.tar.gz to exist
>
[07:14:54.697] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"}
[07:14:54.698] Downloading VS Code server locally...
[07:14:58.248] Downloaded VS Code server to c:\Users\jpfuntne\AppData\Local\Temp\03ba8324-01be-4f4c-bd89-538da94836ae
[07:14:58.253] Renamed VS Code server to c:\Users\jpfuntne\AppData\Local\Temp\vscode_server_1655378098249\vscode-server.tar.gz
[07:14:58.257] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[07:14:58.555] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[07:14:58.581] Expecting scp to be next to ssh at C:\cygwin64\bin\scp.exe
[07:14:58.582] Testing scp with "C:\cygwin64\bin\scp.exe"
[07:14:59.442] scp exited with code: 1
[07:14:59.442] Got stderr from scp: usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
[-i identity_file] [-J destination] [-l limit]
[-o ssh_option] [-P port] [-S program] source ... target
[07:14:59.443] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[07:14:59.445] Copying file to remote with "C:\cygwin64\bin\scp.exe" -F "c:\users\jpfuntne\.ssh\config" "vscode-server.tar.gz" "vscode-scp-done.flag" ubuntu:"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"
[07:14:59.447] Using cwd: file:///c%3A/Users/jpfuntne/AppData/Local/Temp/vscode_server_1655378098249
[07:14:59.447] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[07:15:00.744] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[07:15:01.620] > vscode-server.tar.gz 0% 0 0.0KB/s --:-- ETA
[07:15:02.630] > vscode-server.tar.gz 32% 17MB 17.0MB/s 00:02 ETA
[07:15:03.645] > vscode-server.tar.gz 66% 36MB 17.1MB/s 00:01 ETA
[07:15:04.691] > vscode-server.tar.gz 100% 54MB 17.4MB/s 00:03
[07:15:04.705] >
[07:15:04.722] > vscode-scp-done.flag 0% 0 0.0KB/s --:-- ETA
[07:15:04.736] > vscode-scp-done.flag 100% 9 0.7KB/s 00:00
[07:15:06.150] "Copy server to host" terminal command done
[07:15:06.702] > Found flag and server on host
> cb747be286c8%%2%%
> tar --version:
[07:15:06.717] >
> tar (GNU tar) 1.30
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by John Gilmore and Jay Fenlason.
[07:15:08.979] > Checking /home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.l
> og and /home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.pid
> for a running server
[07:15:09.019] > Starting server with command... /home/ubuntu/.vscode-server/bin/4af164ea3a06f701
> fe3e89a2bcbb421d2026b68f/bin/code-server --start-server --host=127.0.0.1 --accep
> t-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level
> all &> "/home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.
> log" < /dev/null
> printenv:
> SHELL=/bin/bash
> PWD=/home/ubuntu
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.240.153 63898 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=63
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.240.153 63898 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b
> 68f
> _=/usr/bin/printenv
> rm: cannot remove '/home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d
> 2026b68f.token': No such file or directory
[07:15:09.029] >
> Spawned remote server: 60287
[07:15:09.036] >
> Waiting for server log...
[07:15:09.052] >
[07:15:09.080] > Waiting for server log...
[07:15:09.146] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
[07:15:09.171] > cb747be286c8: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==35689==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==1==
> downloadTime====
> installTime==2258==
> extInstallTime====
> serverStartTime==122==
> connectionToken==1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a==
[07:15:09.184] > cb747be286c8: end
[07:15:09.184] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==35689==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==1==
downloadTime====
installTime==2258==
extInstallTime====
serverStartTime==122==
connectionToken==1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a==
[07:15:09.185] Remote server is listening on 35689
[07:15:09.185] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":35689},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a"},"installTime":2258,"serverStartTime":122,"didLocalDownload":true,"installUnpackCode":"success"}
[07:15:09.193] Starting forwarding server. localPort 63909 -> socksPort 63895 -> remotePort 35689
[07:15:09.195] Forwarding server listening on 63909
[07:15:09.195] Waiting for ssh tunnel to be ready
[07:15:09.257] [Forwarding server 63909] Got connection 0
[07:15:09.260] Tunneled 35689 to local port 63909
[07:15:09.260] Resolved "ssh-remote+ubuntu" to "127.0.0.1:63909"
[07:15:09.272] ------
[07:15:09.300] [Forwarding server 63909] Got connection 1
[07:15:09.650] [Forwarding server 63909] Got connection 2
On Linux:
$ find .vscode-server -type f | wc
1798 1798 196423
$

Linux: how do I turn a text file into a variable that is a list of strings?

I used the split command to generate the files: fileaa .. fileaz and fileba ... filebd. I have written these names to the file filenames.list.txt that looks like this:
fileaa fileab fileac filead fileae fileaf fileag fileah fileai fileaj fileak fileal fileam filean fileao fileap fileaq filear fileas fileat fileau fileav fileaw fileax fileay fileaz fileba filebb filebc filebd
I want to write this list from the text file into a variable in the following script:
file='fileaa fileab fileac filead fileae fileaf fileag fileah fileai fileaj fileak fileal fileam filean fileao fileap fileaq filear fileas fileat fileau fileav fileaw fileax fileay fileaz fileba filebb filebc filebd'
for k in {1..30}
do
cat header$k.txt $file > run_mash$k.sh
done
The final result that I want is the following
cat header1.txt fileaa > run_mash1.sh
cat header2.txt fileab > run_mash2.sh
.
.
cat header26.txt fileaz > run_mash26.sh
cat header27.txt fileba > run_mash27.sh
.
.
cat header30.txt filebd > run_mash30.sh
I got it working:
File list: /tmp/listfiles.txt
~ > cat /tmp/listfiles.txt at 14:35:53
fileaa fileab fileac filead fileae fileaf fileag fileah fileai fileaj fileak fileal fileam filean fileao fileap fileaq filear fileas fileat fileau fileav fileaw fileax fileay fileaz fileba filebb filebc filebd
Script: /tmp/script.sh
~ > cat /tmp/script.sh at 14:35:56
#!/bin/bash
file=`cat /tmp/listfiles.txt`
IDX=1
for i in $file
do
echo "cat header${IDX}.txt $i > run_mash${IDX}.sh"
((IDX++))
done
Example execution:
~ > bash /tmp/script.sh INT at 14:36:56
cat header1.txt fileaa > run_mash1.sh
cat header2.txt fileab > run_mash2.sh
cat header3.txt fileac > run_mash3.sh
cat header4.txt filead > run_mash4.sh
cat header5.txt fileae > run_mash5.sh
cat header6.txt fileaf > run_mash6.sh
cat header7.txt fileag > run_mash7.sh
cat header8.txt fileah > run_mash8.sh
cat header9.txt fileai > run_mash9.sh
cat header10.txt fileaj > run_mash10.sh
cat header11.txt fileak > run_mash11.sh
cat header12.txt fileal > run_mash12.sh
cat header13.txt fileam > run_mash13.sh
cat header14.txt filean > run_mash14.sh
cat header15.txt fileao > run_mash15.sh
cat header16.txt fileap > run_mash16.sh
cat header17.txt fileaq > run_mash17.sh
cat header18.txt filear > run_mash18.sh
cat header19.txt fileas > run_mash19.sh
cat header20.txt fileat > run_mash20.sh
cat header21.txt fileau > run_mash21.sh
cat header22.txt fileav > run_mash22.sh
cat header23.txt fileaw > run_mash23.sh
cat header24.txt fileax > run_mash24.sh
cat header25.txt fileay > run_mash25.sh
cat header26.txt fileaz > run_mash26.sh
cat header27.txt fileba > run_mash27.sh
cat header28.txt filebb > run_mash28.sh
cat header29.txt filebc > run_mash29.sh
cat header30.txt filebd > run_mash30.sh
Just remove the echo inside the script to make the script execute all the cat commands`.|
Regards.

How to fix cucumber.runtime.CucumberException: java.lang.NoSuchMethodException

I am getting the following Error:
> XXX Created runtime cucumber.runtime.RuntimeOptions#477b4cdf
> cucumber.runtime.CucumberException: java.lang.NoSuchMethodException:
> cucumber.runtime.SerenityBackend.<init>(cucumber.runtime.io.ResourceLoader,
>
> io.cucumber.stepexpression.TypeRegistry)
> at cucumber.runtime.Reflections.newInstance(Reflections.java:53)
> at cucumber.runtime.Reflections.instantiateSubclasses(Reflections.java:35)
> at cucumber.runtime.Runtime.loadBackends(Runtime.java:89)
> at cucumber.runtime.Runtime.<init>(Runtime.java:42)
> at net.serenitybdd.cucumber.CucumberWithSerenityRuntime.createSerenityEnabledRuntime(CucumberWithSerenityRuntime.java:38)
> at net.serenitybdd.cucumber.CucumberWithSerenityRuntime.using(CucumberWithSerenityRuntime.java:28)
> at net.serenitybdd.cucumber.CucumberWithSerenity.createRuntime(CucumberWithSerenity.java:58)
> at cucumber.api.junit.Cucumber.<init>(Cucumber.java:63)
> at net.serenitybdd.cucumber.CucumberWithSerenity.<init>(CucumberWithSerenity.java:39)
> . . .
>
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> Caused by: java.lang.NoSuchMethodException: cucumber.runtime.SerenityBackend.<init>(cucumber.runtime.io.ResourceLoader,
> io.cucumber.stepexpression.TypeRegistry)
> at java.lang.Class.getConstructor0(Class.java:3082)
> at java.lang.Class.getConstructor(Class.java:1825)
> at cucumber.runtime.Reflections.newInstance(Reflections.java:45)
> ... 22 more
>
> Process finished with exit code -1
It's a Maven project with Serenity.
I hope you can help me with the error, I would be very grateful

/etc/rc.local fails to launch script (supercollider) on boot

In Debian running headless on an arm-based single-board computer (C.H.I.P.), I have this in my /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
source /usr/local/bin/gpio.sh
gpio_export CSID5
gpio_direction CSID5 out
gpio_output CSID5 1
gpio_export XIO_P1
gpio_direction XIO_P1 in
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
export DISPLAY=:0
cd /home/chip/Inhibition
now=$(date +"%m_%d_%Y")
date >> "log_$now.log"
jackd -P99 -dalsa -Phw:1 -p8192 -n3 -s -r44100 &
sleep 30
sclang main.scd >> "log_$now.log"
exit 0
when running the script as root with
/etc/rc.local
everything runs as expected.
However when booting the last command (sclang main.scd >> "log_$now.log") is never run. (sclang is the command line interpreter of supercollider). I did try running some test commands to see whether executions stops when launching jack but these commands are executed as expected - it's just supercollider that fails to start at boot time.
any ideas?
PS I remember setting this up in a similar way in a Raspberry pi running Raspbian - can't confirm it now, but I am almost sure that the code was like that.
EDIT
I tried comparing the shell environments from the command prompt (once booted) and from within rc.local (env1 is the command shell, env2 is the rc.local shell):
diff env1 env2
1,2c1,4
< BASH=/bin/bash
< BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
---
> AP_EINT1=193
> AP_EINT3=35
> BASH=/bin/sh
> BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
4,5c6,7
< BASH_ARGC=()
< BASH_ARGV=()
---
> BASH_ARGC=([0]="1")
> BASH_ARGV=([0]="start")
7,8c9,10
< BASH_LINENO=()
< BASH_SOURCE=()
---
> BASH_LINENO=([0]="0")
> BASH_SOURCE=([0]="/etc/rc.local")
11c13,25
< COLUMNS=120
---
> CSICK=129
> CSID0=132
> CSID1=133
> CSID2=134
> CSID3=135
> CSID4=136
> CSID5=137
> CSID6=138
> CSID7=139
> CSIHSYNC=130
> CSIPCK=128
> CSIVSYNC=131
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
12a27
> DISPLAY=:0
13a29,30
> GPIO=1017
> GPIO_HASH=([TWI1_SCK]="47" [UART1_TX]="195" [LCD_D22]="118" [LCD_DE]="121" [LCD_D23]="119" [LCD_D20]="116" [LCD_D21]="117" [PWM0]="34" [CSICK]="129" [CSID3]="135" [LCD_D13]="109" [CSID2]="134" [LCD_D12]="108" [CSID1]="133" [LCD_D11]="107" [CSID0]="132" [LCD_D10]="106" [CSID7]="139" [CSID6]="138" [CSID5]="137" [LCD_D15]="111" [CSID4]="136" [LCD_D14]="110" [LCD_D19]="115" [LCD_D18]="114" [LCD_HSYNC]="122" [AP_EINT3]="35" [AP_EINT1]="193" [XIO_P3]="1019" [CSIHSYNC]="130" [LCD_CLK]="120" [XIO_P2]="1018" [XIO_P1]="1017" [TWI2_SCK]="49" [XIO_P0]="1016" [XIO_P7]="1023" [XIO_P6]="1022" [XIO_P5]="1021" [XIO_P4]="1020" [TWI1_SDA]="48" [UART1_RX]="196" [CSIVSYNC]="131" [LCD_D2]="98" [LCD_D3]="99" [LCD_D4]="100" [LCD_D5]="101" [LCD_D6]="102" [LCD_VSYNC]="123" [LCD_D7]="103" [TWI2_SDA]="50" [CSIPCK]="128" )
15,18d31
< HISTFILE=/root/.bash_history
< HISTFILESIZE=500
< HISTSIZE=500
< HOME=/root
21c34,35
< IFS=$' \t\n'
---
> IFS='
> '
23,27c37,58
< LC_ALL=en_US.UTF-8
< LC_CTYPE=UTF-8
< LINES=32
< LOGNAME=root
< LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
---
> LCD_CLK=120
> LCD_D10=106
> LCD_D11=107
> LCD_D12=108
> LCD_D13=109
> LCD_D14=110
> LCD_D15=111
> LCD_D18=114
> LCD_D19=115
> LCD_D2=98
> LCD_D20=116
> LCD_D21=117
> LCD_D22=118
> LCD_D23=119
> LCD_D3=99
> LCD_D4=100
> LCD_D5=101
> LCD_D6=102
> LCD_D7=103
> LCD_DE=121
> LCD_HSYNC=122
> LCD_VSYNC=123
29,30c60
< MAIL=/var/mail/root
< MAILCHECK=60
---
> OLDPWD=/
36,38c66,67
< PPID=489
< PS1='${debian_chroot:+($debian_chroot)}\u#\h:\w\$ '
< PS2='> '
---
> POSIXLY_CORRECT=y
> PPID=1
40a70
> PWM0=34
42c72
< SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
---
> SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix
44,48c74,80
< SUDO_COMMAND=/bin/su
< SUDO_GID=1000
< SUDO_UID=1000
< SUDO_USER=chip
< TERM=xterm-256color
---
> TERM=dumb
> TWI1_SCK=47
> TWI1_SDA=48
> TWI2_SCK=49
> TWI2_SDA=50
> UART1_RX=196
> UART1_TX=195
50,53c82,94
< USER=root
< USERNAME=root
< XDG_SESSION_ID=c1
< _=clear
---
> XIO_BASE=1016
> XIO_BASE_FILE=/sys/class/gpio/gpiochip1016/base
> XIO_LABEL_FILE=/sys/class/gpio/gpiochip1016/label
> XIO_P0=1016
> XIO_P1=1017
> XIO_P2=1018
> XIO_P3=1019
> XIO_P4=1020
> XIO_P5=1021
> XIO_P6=1022
> XIO_P7=1023
> _=
> now=10_27_2016
the only weird thing I notice is that /etc/rc.local has BASH set to /bin/sh instead of /bin/bash - I thought that this could be a problem since I do change some env variables so I moved my script (from the first export and bellow) to a run.sh file (which again does work OK on its own) and added this to my /etc/rc.local:
/bin/bash /home/chip/Inhibition/run.sh
unfortunately the results are the same - jack does run but no sclang after that.

How to make Vim autosuggest Lua methods when typing?

For auto-completion, I have installed the youcompleteme and vim-lua-ftplugin, but when I try to trigger the auto-completion, I get the error
> 处理 function
> xolox#lua#omnifunc..xolox#lua#getomnivariables..xolox#lua#dofile..xolox#misc#os#exec
> 时发生错误: 行 163:
> E605: 异常没有被捕获: vim-misc 1.17.6: External command failed with exit code
> 139!^#Command line: sh -c '('\''lua'\'' '\''/home/meijie
> ru/.vim/bundle/vim-lua-ftplugin/misc/lua-ftplugin/omnicomplete.lua'\''
> '\''argcheck'\'' '\''argcheck.doc'\'' '\''argcheck.dump'\'' '\'
> 'argcheck.env'\'' '\''argcheck.graph'\'' '\''argcheck.init'\''
> '\''argcheck.usage'\'' '\''argcheck.utils'\'' '\''base64'\''
> '\''bit32' \'' '\''cjson'\'' '\''cjson.util'\'' '\''coroutine'\''
> '\''crypto'\'' '\''cwrap'\'' '\''cwrap.cinterface'\''
> '\''cwrap.init'\'' '\''cw rap.types'\'' '\''debug'\'' '\''dok'\''
> '\''dok.init'\'' '\''dok.inline'\'' '\''env'\'' '\''env.init'\''
> '\''fftw3'\'' '\''fftw3.cdefs '\'' '\''fftw3.defines'\''
> '\''fftw3.init'\'' '\''gnuplot'\'' '\''gnuplot.gnuplot'\''
> '\''gnuplot.hist'\'' '\''gnuplot.init'\'' '\''gr aph'\''
> '\''graph.Edge'\'' '\''graph.graphviz'\'' '\''graph.init'\''
> '\''graph.Node'\'' '\''graphicsmagick'\'' '\''graphicsmagick.conv
> ert'\'' '\''graphicsmagick.exif'\'' '\''graphicsmagick.Image'\''
> '\''graphicsmag
> 请按 ENTER 或其它命令继续
> 处理 function
> xolox#lua#omnifunc..xolox#lua#getomnivariables..xolox#lua#dofile
> 时发生错误: 行 41:
> E171: 缺少 :endif
> 请按 ENTER 或其它命令继续
> 处理 function xolox#lua#omnifunc 时发生错误:
> 行 10:
> E171: 缺少 :endif
I'm mostly working in torch7. I'd really appreciate a way of getting library methods suggested while typing.

Resources