why does "gcloud dns records --zone="imaginout" edit" fail on OSX? - google-compute-engine

On OSX this brings up a vi editor. You can write the file and exit but it will still fail then output a long error stack. If you then do "echo $?" it outputs 1, indicating that vi returned an error status.

The problem may be that your ~/.vimrc is causing an error in the legacy vi editor. Try moving the .vimrc to another name then run the command again. Fixed it for me.

Related

minicom throwing an error minicom: cannot open /dev/modem: No such file or directory

I have tried to connect my Jetson Nano with TTL UART cable using minicom. When I typed
sudo minicom
It showed an error
minicom throwing an error minicom: cannot open /dev/modem: No such file or directory
Later I tried with
sudo minicom -s
It worked
sudo is always a way...
What minicom tells you with this message that it has tried to open a interface called /dev/modem. It is telling you, that it can't be opened due to insufficient permissions.
On my system /dev/modem does not even exist! Anyhow, minicom expects in it's settings the /dev/modem as default. That's why it's trying to connect to that.
So, the solution is minicom -s, where you actually enter the settings of minicom. Her you'll find the the settings to properly configure your board. If you run this with sudo, you are able to also save your settings, if you want to. You might want to change those settings to e.g. /dev/ttyUSB0 or something.

InstallShield 2014, Custom Actions and executing sql files into MySQL

I am building an installer for our product which works well. I've managed to build custom actions to install our services including a MySQL server.
The problem I have is executing a sql file to build the schema structures.
I have a custom action which uses mysql.exe and the command line arguments:
--port=### --user=### --password=### < "[INSTALLDIR]db\EmptyStruct.sql"
It tries to execute this ok but the cmd window which pops up, during the install, just runs through the mysql.exe command line options, which says to me that the command line it gets passed is not correct. However if I run the command manually after the install, it works perfectly.
Does anyone has any ideas please.
I'm making a few assumptions here:
You have a Windows Installer exe custom action that specifies mysql.exe and a command line as you showed
You are expecting the contents of [INSTALLDIR]db\EmptyStruct.sql to be redirected to mysql.exe's standard input
This will not happen. Behind the scenes, Windows Installer's exe custom action support uses the CreateProcess API and this API will interpret command lines literally. However the redirect < needs special handling to actually perform redirection.
To get that behavior, you must use a layer of indirection. For example, you could run cmd.exe as the exe, and give it a command line that will make it interpret and run the command line mysql.exe --port= ... < "[INSTALLDIR]...". However, if you didn't already have a command prompt showing, this would cause one to show up. If you want to avoid that, you could write a custom wrapper that performs the redirection for you, either as a C++ DLL or, say, InstallScript action.
Alternately, if there is a parameter that tells mysql.exe to run a script from a file, you could pass that instead of using redirection. I wasn't able to find evidence of such a parameter in a quick web search.
Thanks for your comments Michael and I used cmd.exe /k AddStruct.bat to accomplish the task!

bash.exe: warning: could not find /tmp, please create

why my sublime text giving me warning: bash.exe: warning: could not find /tmp, please create
although it is building and running the code correctly.
Please help me just got irritated by seeing this warning.
I have searched the whole web but i couldn't find any solution
This error message is misleading. At least for me it did not solve the problem after creating /tmp directory. Problem was solved after I killed sh.exe.
To piggyback on Kode Charlie's answer:
Open Start Menu
Type "cmd"
Press Enter
type "bash"
Press Enter
type "mkdir /tmp"
Press Enter
Close the command prompt window
Solved the error for me in Sublime Text 2.
In my case I am using windows. My solution was:
Find "bash.exe" at git folder installation - default is
"C:\Program Files\Git\bin";
Double click bash.exe;
At the command line type: mkdir /tmp
And done.
Try opening a bash-shell, and then:
$ mkdir /tmp
See if that makes the warning go away.
If you're using Git for Windows, just create the directory:
C:\Program Files\Git\tmp
Rebooting Windows fixed it for me.
To add to Necros answer, Not all windows 10 builds even come with bash
https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10
Seems like a harmless error that can be ignored. It also occurs when your /tmp/ is a mount to %TEMP%
C:\Program Files\Git\usr\bin>.\env bash
bash.exe: warning: could not find /tmp, please create!
bash: __git_ps1: command not found
/cygdrive/c/Program Files/Git/usr/bin
So for instance, you may get this error if you have a bash script with a shebang
#!/usr/bin/env bash
Although not SublimeText related, I had this warning when running make.exe from a "Git Bash" environment.
The cause ? Due to search path ordering, a different sh.exe was being executed. (I.e. not in /usr/bin)
$ sh
$ ps -s
4348 pty1 09:48:42 /usr/bin/ps
4836 pty1 09:48:40 /c/Users/Nigel/bin/sh
4400 pty1 09:48:36 /usr/bin/bash
4596 ? 09:48:36 /usr/bin/mintty
4808 ? 09:36:14 /usr/bin/mintty
512 pty0 09:36:14 /usr/bin/bash
After deleting the unwanted left-over C:\Users\Nigel\bin\sh.exe; the warning no longer appears.

dbext not finding sql snippets to execute

I'm trying to use the dbext vim plugin to connect to a MySQL database.
When I give commands like <Leader>se I get an error:
Can't open file
/var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/vQ0XMX3/7
That file doesn't exist. But the SQL I expect to be executed does exist in:
/var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/vQ0XMX3/dbext.sql
So it looks as if the plugin is writing a temp file in one location and looking for it in another.
I'm sure the plugin can't be broken and I must have done something wrong, but I don't know enough Vimscript to follow it through.
I have Vim v7.3, dbext 20.00 and have just installed by unzipping the plugin zip into my .vim directory.
I've used
:DBPromptForBufferParameters
to set up my connection parameters.
The full error looks like:
dbext: Executing SQL at 13:54
Error detected while processing function dbext#DB_execSql..dbext#DB_execFuncTypeWCheck..<SNR>42_DB_MYSQL_execSql..<SNR>42_DB_runCmd:
line 24:
E484: Can't open file /var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/v0BN3Qw/7
Press ENTER or type command to continue
Can anyone point me in the right direction to resolve this?
Edit: I've since tried an install into an empty .vim directory, with all of my other config and plugins removed, so I don't think that it's a case of conflicting configuration.
I'm running MacOSX, in case it's relevant.
Dumb mistake on my part.
I was supplying a bare password which needed to be quoted in this context due to a special character.
I'm now quoting the password when prompted for it by :DBPromptForBufferParameters and everything is working.

How to fix exit code issue while using WinSCP for SFTP from within SSIS package?

I am using SSIS 2005 to do some SFTPtasks using WinSCP. I googled about the error but couldn't make it work. I got this error:
[Execute Process Task] Error: In Executing "C:\Program Files\WinSCP\WinSCP.exe" "-script=C:\Documents and Settings\nian_z\Desktop\temp\SSISMovingSOA\removeSOA8.txt" at "C:\Program Files\WinSCP", The process exit code was "1" while the expected was "0".
Here is my WinSCP script that I use:
option batch abort
option confirm off
#open sftp://user:password#server:22
#cd /m/vo/Cont/fileftp
get OrderOutbound*
close
exit
For above script, I even tried leaving only one statement at a time, but still got error.
Here is the setup of the execute process task.
This is not an answer but an attempt to help you find a solution to your problem.
Try this:
Try the following steps to find out if your script is actually working outside of SSIS or not.
Click Windows Start and click Run...
Type cmd to open Command Prompt.
On the command prompt window, type the following command at the prompt to switch to the WinSCP installation directory. I have the WinSCP installed in the following directory. Change the path according to your environment settings.
cd "C:\Program Files (x86)\WinSCP"
If your WinSCP script file removeSOA8.txt is located in the path C:\Documents and Settings\userid\Desktop\temp\SSISMovingSOA\ with spaces, then type the following command by enclosing the script path in double quotes to run the script and also use the /log option to capture all the status messages.
WinSCP.exe "/script=C:\Documents and Settings\userid\Desktop\temp\SSISMovingSOA\removeSOA8.txt" /log=C:\temp\WinSCP_log.txt
After the script executes, your will find that a log file named WinSCP_log.txt will be created in the path C:\temp. Read through the file to identify if there are any error messages.
Attempt to run FTP in SSIS:
I tried downloading a file from FTP using WinSCP with the following script:
option batch abort
option confirm off
open ftp://myuserid:mypassword#ftp.myftpsite.com:21 -passive=on
cd /root/somefolder/
option transfer binary
get SomeFileOnFTP.txt c:\temp\
close
exit
Here are the settings how I have configured the Execute Process Task within the SSIS package.
The process ran successfully in BIDS.
Hope that gives you an idea.
If you are running the script from SQL Server job agent then mostly you will get this exit error.
Scenario: In my case I faced when i m trying to download a file from sFTP server.
Solution :
Step 1 - Create a batch file
#echo off
CD "C:\Program Files (x86)\WinSCP"
winscp.com /ini=nul /script=C:\path\download_script_pm.txt
Exit
Note: When calling using SQL Server Job agent make sure to NULL out the “ini” configuration else it will throw up this error
Step2 – create a txt file (winscp script)
option echo on
option batch on
option confirm off
open sftp://user:password#sftp.xxxx.com/ -hostkey="ssh-edXXXX-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx"
option confirm off
get -filemask=">=1D" /sftp_Path/File_Name_.csv
C:\local_path_for_downloaded_file\"
exit
Note: make sure to use hostkey. To obtain host key you need to do the following :
1. Open winscp app tool and login to the server
Click Session -> Generate Session / URL code option
Check SSH Host key and copy the finger print value and use in the winscp hostkey value
Earlier I was getting the same error but now is working fine for me.
SSIS Execute Process Task :
Executable - C:\SSIS\SSIS_2008_Projects\HRIS_RepomanFusion_Load\WinSCP\WinSCP.com
Arguments - "/script=wscpBatchTest.txt" /log=C:\SSIS\SSIS_2008_Projects\FTP_Load\WinSCP\WinSCP_log.txt
Working Directory - C:\SSIS\SSIS_2008_Projects\HRIS_RepomanFusion_Load\WinSCP
Here is the WinSCP script that I use: wscpBatchTest.txt
option batch
option confirm off
open sftp://username:password#ftp.test.com
option transfer binary
cd /home/SAFAA
get employeedetails.csv C:\SSIS\SSIS_2008_Projects\SAFAA\InputDirectory\
close
exit