I am trying to build a (single page) local portal in Chrome that opens several things.
The problem is we want to run a local executable via a button on a (local) webpage. Is this possible?
The second thing is that i want to do is to run a .pps file directly in the powerpoint viewer.
I can control to the startup of chrome, so i can access local files.
All things i tried so far only made the file(s) to download, not to run.
Can somebody help me how i get this done?
You can set a protocol like myapp://launch/activity or the like to automatically launch your app by setting up a registry key in HKEY_CLASSES_ROOT with the name of your protocol and the action it should take.
There is a MSDN article showing the following example of a registry for an alert protocol:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"
Which would then be called by requesting a url with alert:YOURPARAMS, which would then call alert.exe YOURPARAMS.
Related
A site I use has suddenly moved to a new domain. The old site 301 redirects to the new site. All my settings for the site have been lost, because they are stored in localstorage on the old domain.
Normally, if I need to view everything in localstorage, I go to the site and open developer tools, and there it is.
However, if I try that now, I can only see the new empty localstorage on the new origin, which does not help me at all.
How do I view the localstorage of a site that I cannot load?
I tried interrupting the redirect by:
Disabling redirects in Chrome settings for this domain (no effect)
Hitting ESC while it loads (failed after repeated attempts)
Writing a Tampermonkey script (never runs)
window.addEventListener("beforeunload", function() { debugger; }, false) (stops, but devtools localstorage never shows old domain, even if I step through)
At no point am I stopped on the previous domain, allowing me to view the associated localstorage.
But I can see that it still exists if I go to Chrome's settings | All cookies and site data, and filter for the domain. But, unlike cookies (whose contents are viewable from this settings page), the only things localstorage tells me here are the origin, the size on disk, and the last modified date. Not the contents. But this IS something stored on my computer somehow, and I should be able to access it, right?
How do I browse the contents of localstorage locally, on my local machine?
Is there a way to redirect dev tools to a specific domain?
Is there a way of "tricking" the browser into thinking I'm on a specific domain, so that I can then open dev tools and view the localstorage like normal?
Or is there an obvious way to browse localstorage that I'm just overlooking?
Expanding on wOxxOm's solution:
For context, I'm on Ubuntu 22.04 with Python3 and mkcert already installed.
Edit the hosts file
sudo gedit /etc/hosts
I add a new line at the bottom: 127.0.0.1 (the domain I'm trying to recover)
Now, I don't have anything running on port 80, so for a regular website I could have run:
sudo python3 -m http.server 80
(sudo because Ubuntu will complain that I don't have permissions to use that port otherwise)
But here's the twist: Nothing showed up in localstorage when I did that. Why? Because the original site wasn't on http, it was on https.
Move to a folder you can leave files in.
I moved to my development folder
Generate local certificate
mkcert (target domain)
mkcert -install
This makes a couple files in this folder, whateverdomain.pem and whateverdomain-key.pem.
Write a small python wrapper (from this StackOverflow)
import http.server, ssl
server_address = ('localhost', 443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
server_side=True,
certfile='whatever.pem',
keyfile='whatever-key.pem',
ssl_version=ssl.PROTOCOL_TLS)
httpd.serve_forever()
Server address is 443 for https, keyfile is included with certfile.
Run the new script
sudo python3 simpleserver.py
Sudo again, because of using a main port.
Open the target domain in the browser.
Open dev tools. Right-click on the page and choose "Inspect" or use the keyboard shortcut ctrl-shift-i
Go to the Application tab.
Success! My localstorage is finally viewable. From here I was able to copy out the values I needed.
We're done, so clean up:
Stop python script.
Finally, re-edit /etc/hosts and remove or comment out the redirect line.
Was there a simpler way I could have run https? Maybe. But this wasn't difficult to set up, and I did recover my inaccessible localstorage, and that's the important thing.
I've faced the problem. I use PhpStorm to edit files from FTP server using WinSCP client. In WinSCP client I've set command for using external editor. So, when I try to open php-file from remote FTP server WinSCP downloads this file in temporary file and open it using command provided by me - "C:\Program Files\JetBrains\PhpStorm 2020.1.1\bin\phpstorm64.exe" "!.!"
Earlier, when I used PhpStorm 2019 or 2018, it opened file in already opened window/project. But when I've upgraded to PhpStorm 2020, it started to open file from FTP in separate windows. It's so annoying and some functionality doesn't work in such case (auto suggestions and others).
I know that I can use built-in remote files browser within PhpStorm to view and edit remote files, but I accustomed to use separate FTP client for such purposes.
Does somebody know how to fix this problem? What console command should I use so as to open separate file in already opened window/project?
It's a LightEdit mode: https://blog.jetbrains.com/idea/2020/04/lightedit-mode/
Since 2020.2 you can use the -p (--project) option instead to force opening files in already opened project windows. For example idea -p myfile.txt. IDEA-237118
You can also permanently disable that mode by following these steps:
Invoke Help | Find Action... (or via Search Anywhere: use Double Shift and switch to Actions tab)
Search for Registry... action and select it
Once in the Registry dialog locate light.edit.file.open.enabled entry (just start typing, speed search will narrow it down) and set it to false (uncheck the box).
Not sure if IDE restart is needed (probably not).
I tried deploying Libgdx to html using gradle. I copied the content
html/build/dist
and all I see in the browser is the badlogic image with a red background (what you would see if you just created a project) Why is that?
Using the superdev I can open it in the browser, i see where it says drag this button but can't play it. there's nothing
The code server is ready at http://127.0.0.1:9876/
GET /clean/html
Cleaning disk caches.
Cleaned in 29ms.
GET /superdev.html
[WARN] ignored get request: /superdev.html
[WARN] not handled: /superdev.html
> Building 91% > :html:superDev^C%
turning the dev mod on I see Can't find any GWT Modules on this page.
If I build it normally, I see some warnings about depreciated methods, it builds successfully.
Assets aren't being loaded by html
I've few links that may be help you :
How to start
Super Dev mode in GWT
Also check this thread
https://stackoverflow.com/a/24265470/3445320
EDIT
I've tested on Android Studio with MacOS
Steps :
Run ./gradlew html:clean to clean your html module
On Android Studio Terminal I run ./gradlew html:superDev command
I got The code server is ready at http://127.0.0.1:9876/ on terminal
Then I open Google Chrome, View -> Always Show Bookmarks Bar
I typed http://127.0.0.1:9876/ in adress field -> enter
I got a page having Dev Mode On and Dev Mode Off, two buttons
Drag Dev Mode On to bookmarks bar, that is below my Address bar
Done! now I search http://localhost:8080/html/ , I got my game in browser
Press Dev Mode On button that is in bookmarks bar, I got option for compile
Now I need to deploy my html project
I run ./gradlew html:dist in Android Studio Terminal
I got BUILD SUCCESSFUL in Terminal then I find dist folder inside my html module.
dist folder is inside html module -> build -> dist
I copied dist folder and deployed to my server.
EDIT 2
Make sure badlogic.jpg is in your assets folder of android module
Check entry in assets.txt file and find badlogic.jpg inside html module->war->assets folder. If file or entry not exist.
Somehow program not able to write in assets folder
Check what programs have the file/s open
Check permissions and administrative rights
Delete the cache files, run "gradlew html:clean html:superDev" for every new run of superDev.
Check any anti-virus software, they can flag some of GWT's behaviour as suspicious
In the webgui for defaultapp, you can click a button to start the selected app in the drop down.
What command is hidden under that button to start the universal app? I would like to do this from a remote console programatically.
Also, is the source code available for the defaultapp/webgui?
You can use PowerShell to set an app as startup, run in headless mode etc.
Find the details of connecting it with PowerShell here: https://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
Also running in headless mode saves more memory, power, faster boot.
Also command line utils for enabling startup process:
https://ms-iot.github.io/content/en-US/win10/tools/CommandLineUtils.htm
-> Default App Sample: https://github.com/ms-iot/samples/tree/develop/IoTCoreDefaultApp
Let me know if you need anything else.
I am trying to make a webpage which will have the entire inventory of servers that our team manages in the form of a table. I am using a simple LAMP stack and the inventory input as a CSV file.
The table has three columns: Hostname, IP address and device serial number.
While this works perfectly fine, I want to take this a step further and make every IP address in the table a hyperlink, clicking which will open an SSH client, which will connect to that IP address. Any cues to how this can be done? I was hoping there would be something like the the mailto: tag which opens an email client (Outlook window).
I've done it following the info of this blog post.
For future reference in case the original page becomes missing, here is the process:
you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn launch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content:
#echo off
set var=%1
set extract=%var:~6,-1%
start "C:\Program Files (x86)\PuTTY\putty.exe" %extract%
the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed):
REGEDIT4
[HKEY_CLASSES_ROOT\ssh]
#="URL:ssh Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\path\\to\\putty_ssh.bat\" %1"
When I click on ssh:// links in web pages, it now opens PuTTY.
PuTTY unfortunately does not associate itself with the ssh:// or any other URLs.
You can associate an application with a protocol manually. But it's not trivial. For instructions, see below.
Easier way is to install WinSCP SFTP client. WinSCP 5.9 and newer registers itself to handle the ssh:// URL and opens the session specified by the URL in PuTTY.
So basically, if you just install WinSCP, it will make PuTTY handle the ssh:// URLs, without the below manual tweaks.
(I'm the author of WinSCP)
To register an application manually, see the MSDN article Registering an Application to a URI Scheme.
Basically you add a registry key like:
[HKEY_CLASSES_ROOT\ssh]
#="URL: SSH Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\",0"
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\""
Though the above passes a whole URL to the PuTTY command-line. And PuTTY does not understand the ssh:// prefix. So you would have to add a wrapper script that strips the ssh:// and passes only a user and a host to PuTTY.
For that see:
https://johnsofteng.wordpress.com/2009/05/12/launch-putty-from-browser/