I have some script for my Google Sheet that returns a message prompt to the user when an action is completed...
Browser.msgBox('Inspection has been ADDED',
'Grower: ' + strIEGrower + '\\n' +
'Farm: ' + strIEFarm + '\\n' +
'Block: ' + strIEBlockNumber + '\\n' +
'Crop: ' + strIECropType,Browser.Buttons.OK);
It works fine when using the sheet on a desktop. But when I use it on a Mobile device the prompt does not show the prompt and my script errors with a timeout. I have tried using the...
SpreadsheetApp.getUi().alert('Complete');
It does not display either. Any help to display a message pop-up on a Mobile device would be appreciated.
Related
I am trying to set up an automated alert emailing system for a project and I can format the email properly when it's plain text but when I try to add variables it won't format properly. I am pulling data from a JSON file and I can pull the data I just can't combine it with the email inside the triple quotes (""").
Here is the plain text
message = """\
Subject: AMLD Alert
Something is wrong."""
But when I add in my variables it will not fill in the body, but the subject will.
message = 'Subject: AMLD Alert for ' + d[0]['Project Name'] + ' Project'
'Car: ' + d[0]['CarID'] +' Driven by: ' + d[0]['DriverID'] + ' is sending alert '+ d[0]['Message']
Here is the entire script if it will help.
import json
import smtplib
import ssl
import socket
socket.getaddrinfo('localhost', 8080)
#Webiste use to help me build script
#https://realpython.com/python-send-email/
port = 587 # For starttls
smtp_server = "smtp.outlook.com"
sender_email = "MyWorkOutlookEmail" # Enter your address
password = 'Password'
receiver_email = "MyPersonalGmail" # Enter receiver address
context = ssl.create_default_context()
#Start of ITTT Code
with open('C:/Python/Messaging/Mes_V1.json') as f:
d = json.load(f)
if d[0]['Alert'] == "High":
print('Sending high alert email...\n')
message = 'Subject: AMLD Alert for ' + d[0]['Project Name'] + ' Project'
'Car: ' + d[0]['CarID'] +' Driven by: ' + d[0]['DriverID'] + ' is sending alert '+ d[0]['Message']
elif d[0]['Alert'] == "Medium":
print('Sending medium alert email...\n')
else:
print('Sending low alert email...\n')
context = ssl.create_default_context()
with smtplib.SMTP(smtp_server, port) as server:
print('Connecting to Server...\n')
server.starttls(context=context)
print('Logging in...\n')
server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, message)
print('Email sent.\n')
I'm not sure if Outlook is affecting it in any way or if I need to format the message differently, any help would be very appreciated!
The full Debezium MySQL URI string shows up in metrics. It shows the MySQL user and password in plaintext, which is unsafe. How can one disable this? I followed this setup here.
More information:
Using quarkus 1.11.1.Final which uses camel 3.7.0 with debezium-connector-mysql 1.3.1.Final
This is the Camel route:
from("debezium-mysql:" + config.getConnectorName()
+ "?databaseHostname=" + config.getHost()
+ "&databasePort=" + config.getPort()
+ "&databaseUser=" + config.getUser()
+ "&databasePassword=" + config.getPassword()
+ "&databaseServerName=" + config.getDatabaseServerName()
+ "&databaseServerId=" + config.getDatabaseServerId()
+ "&databaseIncludeList=" + config.getDatabases()
+ "&tableIncludeList=" + config.getTables()
+ "&columnIncludeList=" + config.getColumns()
+ "&databaseHistoryFileFilename=" + config.getHistoryFile()
+ "&offsetStorageFileName=" + config.getStorageFile()
+ "&exchangePattern=InOnly")
.routeId("debezium")
.process(outgoingProcessor)
.marshal().json(JsonLibrary.Jackson)
.to(ExchangePattern.InOnly, outgoingUri)
.to("micrometer:counter:outgoing.counter")
.end();
And when accessing the metrics at /q/metrics, I find this entry:
# HELP CamelExchangeEventNotifier_seconds_max
# TYPE CamelExchangeEventNotifier_seconds_max gauge
CamelExchangeEventNotifier_seconds_max{camelContext="camel-1", endpointName="debezium-mysql://entire connection string here with user and password", eventType="ExchangeCompletedEvent", failed="false", serviceName="MicrometerEventNotifierService",} 0.0
Thank you for bring this up. I have created a Jira ticket to fix this in the upcoming Camel release to mask those sensitive data in those events in the metrics.
I have a table inside that table 3 Columns {USERNAME,PASSWORD,IP}
I want to use that data to remote anyPC inside my network instead open the remote desktop and enter the user,pass and ip .
I used that code but that makes me open the remote desktop for an IP , but the user and password doesn't insert well.
That is my VB code
Private Sub Toggle133_Click()
Shell ("cmdkey /generic:TERMSRV" + ip.Value() + "/user:fourtex\" + Text126.Value() + "/pass:" + Text109.Value() & "mstsc.exe /v " + ip.Value())
Shell ("mstsc.exe /v " + ip.Value())
End Sub
http://developer.chrome.com/extensions/getstarted.html
In the docs,
it instructs we have to open the chrome:extesion page every time and load our own extension
is there any way to use command line such that i can do faster?
(mac OS or linux)
Thanks
Check out chrome.runtime.reload(). I haven't used it myself, but I suppose you could put a button somewhere convenient and trigger that method with it.
A team I am working with on a Chrome extension has figured out the following CHROME_RUN.py Python script:
cwd = sys.path[0]
CHROME_EXTENSION_DIR = cwd + "/Chrome-Extension"
TEMP_DIR = tempfile.mkdtemp()
TEMP_CHROME_PROFILE = TEMP_DIR + "/Chrome-Temp-Profile"
ccUrl = "PAGE_TO_OPEN.HTML"
if not os.path.exists(TEMP_DIR):
os.makedirs(TEMP_DIR)
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
if _platform == "win32":
os.system("BUILD_CHROME_PROJECT.py")
os.system("start chrome " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "darwin":
os.system("python BUILD_CHROME_PROJECT.py")
os.system("open /Applications/Google\ Chrome.app --args " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "linux" or _platform == "linux2":
os.system("./BUILD_CHROME_PROJECT.py")
os.system("chromium " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
shutil.rmtree(TEMP_DIR)
which is compatible with OSX, Windows and Linux.
If you are looking for the actual arguments to provide Chrome, it is as follows:
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
It will creates a temporary profile and launches Chrome with the provided URL. This version of Chrome is similar to how FireFox sandboxes an instance of the browser for plugin testing (fresh, clean instance of the browser with history, cache, etc. from your browsing history)
Go to the extension page, press ctrl+R, the original extension will be reloaded automatically and that doesn't need to do any import action any more.
I paste a >2KB SQL file to mysql CLI and it randomly loses characters and then reports syntax error in my SQL.
For example:
(.....)
UPDATE ct_transform_target_summary
SET
ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
jan_margin_target + feb_margin_target + mar_margin_target + apr_margin_target + may_margin_target + jun_margin_target,
ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
jan_margin_adj + feb_margin_adj + mar_margin_adj + apt_margin_adj + may_margin_adj + jun_margin_adj,
ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
jan_margin + feb_margin + mar_margin + apr_margin + may_margin + jun_margin;
(....)
Becomes:
(....)
->
->
-> SET
-> ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
->
-> ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
-> jan_margin_adj + feb_ma
-> ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
-> jan_margin + feb_margin + mar_margin + apr_margin + may_
This apparently never happens to short SQL code, but only happens to long code.
Could this be caused by my terminal (Fedora 17 Gnome terminal) or could it be an issue of mysql CLI?
Never had I experienced such problem in terminal before. It only happens in mysql cli.
Write the SQL to a file, ie: query.sql, then use the source command in the mySQL CLI.
$ vi query.sql
$ mysql -h db.host.tld -u user -p
mysql> use mydatabase
mysql> source query.sql
Pasting into the MySQL CLI client is tricky, because it uses Readline for interactive line editing. Readline interprets certain input as control sequences and does not pass them verbatim to the MySQL client. The character most likely to be causing problems in your case is tabulation, used often for indentation purposes in SQL, but used in Readline for tab completion. Inadvertent tab completion in the middle of your query might have very unexpected results and it is often hard to pinpoint the exact location where it has introduced interference.
I think Sammitch is on the right track here, but I believe that solution only works if you are logged into the machine where mysql is living. The following should work from anywhere.
$ vi query.sql
$ mysql -h db.host.tld -u user -p mydatabase < query.sql
Pasting into the CLI always makes me nervous!
Does this happen when you paste to a file in your terminal on your mysql server? Most likely you are having a buffer issue when pasting across the network. But I would check pasting to a file on the same server and if that works, then it is the mysql cli that is causing some issue, but I bet it's just the network latency causing problems.