Remove Warning When Enabling shell-escape in Lyx - latex

I have enabled minted+pygmentize to highlight my program listings, and since pygmentize is an external program, the shell-escape flag must be enabled on pdflatex in Lyx. Now, every time I compile a document without removing this option in the global settings, I get this warning.
The following LaTeX backend has been configured to allow execution of external programs for any document:
pdflatex $$i -shell-escape
This is a dangerous configuration. Please, consider using the support offered by LyX for allowing this privilege only to documents that actually need it, instead.
The dialog indicates that there is some document-specific setting that can enable the shell-escape flag, however I see no such option in the document settings, or anything on Google about this error, save one mail archive that only explains why the dialog appears.
Is there some way to set the shell-escape flag from the latex preamble? Or is there some document setting that allows the shell-escape flag that I have been unable to find?

I seemed to have found the answer in that mail archive, which was an alternate proposed dialog text.
Go to Document->Settings->Formats and check "Allow running of external programs."
This enables the shell-escape flag for the current document only.

Related

JetBrains IDE make link clickable in .txt files

I am opening a .txt file with my PyCharm IDE that contains multiple links among several other lines of text (actually these are logs from a continuously running script).
Like so:
----------------------- session start, Tuesday 12.10.2021, 12:48:53
>> some logs... -- 12:49:34
link: https://www.example.com/p/CU5Hn-RsSB9
>> more logs... -- 12:49:34
Now for convenience I would like to be able to click on that link rather than copy/pasting it to my browser - it seems like this should be a possible setting somewhere in PyCharm: But I cannot seem to find it and also not find any information on it on the web.
Anybody knows how to make links clickable in .txt files opened in PyCharm?
The ideal solution you are asking for would be configuring clickable URL links in the editor window but that is not currently supported by PyCharm.
That kind of configuration is hardcoded in the PyCharm IDE. For example, URLs are clickable if they're inside a Python comment or a Markdown file, but they can't be turned on/off; only the colors highlights can be configured (and thus the corresponding dialogues in the settings are an integral part of PyCharm that can't be changed.) Neither is there any way to create new file types with those configurations. You can see one such example by going to File > Settings > Editor > Color Scheme > Markdown and checking the Auto Link item in the list.
In these cases the alternative to your specification would be installing a plugin that implements the functionality. I searched the JetBrains Marketplace but I think no plugin is currently available that implements what you want. (A few are close, like TxtReader or Awesome Console but these still rely on sending the file/output to the console, they don't make the links clickable in the editor window.)
Having said that, the closest native alternative using vanilla PyCharm (without installing plugins) would be running the Terminal as an External tool to read the .txt file. This has the desirable advantage of opening the file inside the IDE and since PyCharm supports several terminals you get the flexibility of using the terminal specific settings you prefer.
Here's an example of configuring PyCharm's External Tool to open the .txt using Window's CMD. (Using the command line arguments /c more is terminal specific. Also notice the use of the $FilePath$ and $ProjectFileDir$ PyCharm specific macros.)
After your External Tool is configured you can use it by right clicking on the open file in the editor window or in the Project files view. In the terminal you can see the .txt file having the clickable URL.
Another alternative could be configuring the IDE's External Tool to launch a 3rd party text editor to open the .txt file; but the main drawback of that approach is it would open the file outside PyCharm.
For me, it looks like you can display a clickable link to a file, provided :
the file exists,
the file is a python file (ends with '.py'),
the file is in the project (the file owns to a directory inside the project)
for example, your file is "main.py" and your project root is "/Users/puiseux/GitHub/myproject" then the two lines
>>> filename = "/Users/puiseux/GitHub/myproject/main.py"
>>> print('File "%s", line %d' % (filename, 12))
will display a clickable link to the line 12 of file "main.py"
File "/Users/puiseux/GitHub/crypto/main.py", line 12
If you do not fulfill one of three conditions, it does not work

How to disable automatic function docstring generation in Spyder?

Spyder (the Python IDE) generates a function docstring automatically when you click Enter after the first line of the function def. How can one disable this feature?
I've looked around in Tools (for instance in Tools -> Preferences -> Editor) and did not find a way to do it. But there are tons of features in Spyder so maybe I'm missing it.
Are you using an anaconda install with kited running in the background? Opening task manager and stopping this from running fixed the problem for me.
Edit: This may be incorrect
When you type in the triple quotes, an icon will pop up that says Generate docstring. When this happens, do not hit Enter. Just hit esc.
Until we can just deactivate it in settings, that's what I've been doing.

Windows Defender SmartScreen and electron app

I have developed a very simple electron app, which I then packaged using "electron-packager".
I zipped up the application and sent it to my client. When this client runs the application, he gets the "Windows protected your PC" window/warning with "Windows Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.
App: AppName.exe
Publisher: Unknown publisher
Along with the "Run anyway" and "Don't run" buttons.
The app runs fine when the user clicks on "Run anyway", but understandably he would like to get rid of this warning (and at the very least show the actual Publisher).
I know about the code-signing certs, so there is no need to go there...
(IMPORTANT NOTE: I haven't asked him to look at the properties of the file to see if Security indicates "This file came from another computer and might be blocked to help protect this computer.". I am going to check that tomorrow and hopefully it just needs to be "Unblocked".)
What I am wondering is, why don't I get this same warning when I run the application on my PC? (We are both running Windows 10.) I have cranked my UAC all the way up to "Always Notify" and I have tried setting "Check apps and files" and "SmartScreen for Microsoft Edge" to "Warn" and even "Block". Still, the application always starts with NO errors or warnings. If I could at least reproduce what he is seeing, I would at least know if/when the code-signing works.
(To be clear, I'm not using an "installer". The client doesn't want one. And, as I said, this is a very SIMPLE application/utility. They want to be able to copy the zip file, unzip the contents and run the app..)
Any help is much appreciated!
Yes. The issue is, that when files are received from the internet, there is a download flag set. This is depending on certain conditions.
I've experienced, that files from local network addresses don't get this flag.
You can find the flag in the File Properties dialog.
When this flag is set, the SmartScreen scans the file and checks, if it can be trusted or not. This is depending on the reputation of the signature used to sign the executable.
Reputation for a certificate is established automatically. If you cannot wait, then you need to use an EV cert.
hope this works for you.
I use "electron-builder" to build my application and it exports a .exe file then I archive this file by WinRAR app and set it for download.
when the user downloads this file and extracts this file it automatically removes the downloaded flag from the .exe file and the user will not see the warning anymore this solution worked for me.
The solution to this is for the client to "unblock" the zip file before extracting. (Or, I suppose extract it, then unblock the exe....) To reproduce the problem, I just emailed it to myself. :)

Is any way register shell extension by Regasm.exe without codebase?

this is problem.
I developed a shell extension of Shell Context Menus.
(use SharpShell, enter link description here)
I can register it by using regasm.exe with "/codebase" attribute.
And without this attribute the shell extension doesn't work.
But this attribute let me can't update the .dll file without reboot explorer.
Even worse, can't delete .dll file after that unregistered and reboot PC (in windows 8).
So, did that have any way to solve this problem?
By the way, if anyone can tell me what is "/codebase" actually doing?
(I saw MSDN already, but totally can't understand.)
The only solution is to enumerate the handles created by explorer.exe and filter them by the target file, which is your own locked dll file. Then you can remove the handle.
It would require P/invoke if you will use C#, or handle.exe by Sysinternals if you will use any scripting language during installation. However, removing handles in the background of the application that has the handle is an unsupported way and may result with undefined consequences.

Force Open Lua Console or Run Lua Console Automatically on Startup

I'm new to Wireshark & Lua and I have a question that I can't seem to find the answer to by reading around online
Is there a way to open the Wireshark Lua console window on start up? Or even automatically open dialogs created by listeners on start up? I was hoping there were some commands or capability that would allow me to open (not just create) dialogs from within a script.
I've read about the exploit for the console in versions 1.6 and earlier, but I'm running 1.6.8 and I'd rather not use something that could potentially cause Wireshark to be unstable.
Modify the bottom of C:\Program Files\Wireshark\console.lua. Before the final "end", add:
run_console()
You can find an advanced option in the preferences dialog:
Open Preferences from the Edit menu
Navigate to Advanced
Filter for console
Change the value for gui.console_open to ALWAYS

Resources