Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
24 views
AddType not respected by browser
**UPDATE** learning that `application/javascript` has been deprecated, this has now been updated to read: `text/javascript`. Issue persists. I have verified that this is not an actual 404. a file of that name exists at that path, with ownership and permissions which should make it accessible to the...
**UPDATE** learning that application/javascript has been deprecated, this has now been updated to read: text/javascript. Issue persists. I have verified that this is not an actual 404. a file of that name exists at that path, with ownership and permissions which should make it accessible to the webserver user. Following Marcus Müller's suggestion below, that the AddType directives I added years ago to an apache2 virtual host template are now redundant, I commented those out, and ran a stop / start on apache and the php-fpm. I'm still seeing the same results in the network tab. enter image description here ----- for a couple of years now, my apache2 virtual host containers include, in the top scope, unaffected by conditionals, these two lines: AddType text/css .css AddType application/javascript .js and there is this: $ apache2ctl -M | grep mime mime_module (shared) still the firefox network tab reports that multiple files are giving me 404s, and errors reading: NS_ERROR_CORRUPTED_CONTENT. Each is clearly identified with their .css or .js extensions and are all being seen in the browser as malformed html code. Any thoughts on how to further diagnose or resolve this issue would be greatly appreciated. -- Hugh Esco
Hugh Esco (11 rep)
May 26, 2025, 10:01 PM • Last activity: May 29, 2025, 02:15 AM
-2 votes
1 answers
211 views
Replace a value in a file, in a certain context, with an operation result
I have an array of JS objects with inside local urls and speed parameters like `[{server:"192.168.0.100", speed:34}, {server:"192.168.0.130", speed:52},...]` I need to update the speed value for each server.. Reading links like *[Replace only if the string is found in a certain context][1]* I've tri...
I have an array of JS objects with inside local urls and speed parameters like [{server:"192.168.0.100", speed:34}, {server:"192.168.0.130", speed:52},...]
I need to update the speed value for each server.. Reading links like *Replace only if the string is found in a certain context * I've tried this: #first by first I delete the old value sed -i 's/speed:\(.\), //g' $FILENAME sed -i 's/speed:\(..\), //g' $FILENAME sed -i 's/speed:\(...\), //g' $FILENAME sed -i 's/speed:\(....\), //g' $FILENAME #then I've tried to calculate the new one sed -i "s/server:\"\(192.168.0...\)\"/server:\"\1\", speed:$( ping -c3 \\1 | grep rtt | cut -f 5 -d '/' ), /g" $FILENAME But it doesn't work: > unknown host \1
lunix15 (1 rep)
Nov 3, 2016, 11:36 AM • Last activity: Apr 25, 2025, 12:30 PM
1 votes
1 answers
7421 views
NVM cannot find installed Node binary, PATH problem on Linux Mint 17?
I've successfully installed NVM and Node using official instructions. My `.bashrc` file contains [ -s "/home/user/.nvm/nvm.sh" ] && . "/home/user/.nvm/nvm.sh" After some time, maybe a day, I noticed that Node is not present anymore . So I tried: $ nvm use 0.10 N/A version is not installed yet That's...
I've successfully installed NVM and Node using official instructions. My .bashrc file contains [ -s "/home/user/.nvm/nvm.sh" ] && . "/home/user/.nvm/nvm.sh" After some time, maybe a day, I noticed that Node is not present anymore . So I tried: $ nvm use 0.10 N/A version is not installed yet That's weird, I know that I installed it with nvm install 0.10 , used it to run a script, and found it here: $ ls .nvm/v0.10.29/ bin ChangeLog include lib LICENSE README.md share So, everything looks right, but NVM simply doesn't work: $ nvm install 0.10 mkdir: cannot create directory ‘/etc/mdm/bin’: Permission denied Binary download failed, trying source. Additional options while compiling: mkdir: cannot create directory ‘/etc/mdm/src’: Permission denied nvm: install v0.10.29 failed! $ nvm deactivate Could not find /etc/mdm/*/bin in $PATH Could not find /etc/mdm/*/share/man in $MANPATH Could not find /etc/mdm/*/lib/node_modules in $NODE_PATH Output shows that nvm is trying to use /etc/mdm/* dir, and this doesn't make any sense. MDM is display manager in Linux Mint. Any ideas ? UPDATE: just checked now, seems that $NVM_DIR is set to /etc/mdm. That's probably why everything fails, but don't know when this get set, or why. UPDATE 2(FIX): export NVM_DIR=/home/user/.nvm will fix this problem.
Zed (111 rep)
Jun 17, 2014, 01:50 PM • Last activity: Apr 16, 2025, 06:01 PM
2 votes
1 answers
1845 views
Data from python script to website
This involves a raspberry pi and apache2 so I thought the question would be good to go here.. have never used web sockets and things like that before so I'm pretty lost and hoping for some guidance... I have a python script that gives me two pieces of data...the angle of a servo motor and the distan...
This involves a raspberry pi and apache2 so I thought the question would be good to go here.. have never used web sockets and things like that before so I'm pretty lost and hoping for some guidance... I have a python script that gives me two pieces of data...the angle of a servo motor and the distance of an object from the ultrasonic sensor. I need this data to be sent to my website which has a radar imsge. As the angle changes the sweep on the radar image should change, and where there is an obstacle it should show on my radar. My question is how can I get this data to the website in a continuous way? I have apache2 running on my website. Right now I'm already using Ajax requests to make motors run on my raspberry pi (it's like an RC car). import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) TRIG = 22 ECHO =18 GPIO.setup(TRIG, GPIO.OUT) GPIO.output(TRIG,0) GPIO.setup(ECHO, GPIO.IN) GPIO.setup(33, GPIO.OUT) pwm=GPIO.PWM(33,100) pwm.start(5) time.sleep(0.1) class rotateRead(): def To180andBackRead(): angle=0 for angle in range(0, 180, 1): GPIO.setmode(GPIO.BOARD) duty=float(angle)/10+2.5 pwm.ChangeDutyCycle(duty) print angle time.sleep(0.1) GPIO.output(TRIG,1) time.sleep(0.00001) GPIO.output(TRIG,0) while GPIO.input(ECHO) ==0: pass start =time.time() while GPIO.input(ECHO) ==1: pass stop=time.time() print (stop-start) *17000 angle=180 for angle in range(180, 0, -1): GPIO.setmode(GPIO.BOARD) duty=float(angle)/10+2.5 pwm.ChangeDutyCycle(duty) print angle time.sleep(0.1) GPIO.output(TRIG,1) time.sleep(0.00001) GPIO.output(TRIG,0) while GPIO.input(ECHO) ==0: pass start =time.time() while GPIO.input(ECHO) ==1: pass stop=time.time() print (stop-start) *17000 for x in range(0,1,1): To180andBackRead() GPIO.cleanup()
Ahsin (21 rep)
Apr 14, 2016, 06:59 PM • Last activity: Jan 22, 2025, 01:07 AM
0 votes
0 answers
118 views
In Raspbian Bookworm, how to run a headless browser with audio
I have a Spotify player in JavaScript that I need to run headless in Raspian Bookworm on a RPi5. I am controlling the player using the spotipy module in python. I have both nginx and gunicorn running as system services, and everything is working when started in the GUI using VNC. However, I need thi...
I have a Spotify player in JavaScript that I need to run headless in Raspian Bookworm on a RPi5. I am controlling the player using the spotipy module in python. I have both nginx and gunicorn running as system services, and everything is working when started in the GUI using VNC. However, I need this system to be headless and have it all start up on boot. I can start a Chromium browser in headless, but no sound is produced when starting a song in the Spotify player. Here is my service for the browser:
[Unit]
Description=Headfull Browser Service
After=gunicorn.service nginx.service network.target
Requires=gunicorn.service nginx.service

[Service]
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/chromium-browser --headless --disable-gpu  --autoplay-policy=no-user-gesture-required --mute-audio=false --alsa-output-device=default --use-fake-ui-for-media-stream --remote-debugging-port=9222 http://localhost
Restart=always
User=myuser

[Install]
WantedBy=multi-user.target
I tried doing stuff with PulseAudio, but would rather not go that way. Is it possible to make this work in Chromium? Is there another easier way to run my JavaScript in headless?
Gormd (1 rep)
Dec 18, 2024, 08:35 AM
2 votes
1 answers
911 views
How to get javascript key path in long json files in Linux
I'm using several keys from a long javascript object, represented as json. Example: ... "stock": { "type": 'str', "properties": { "warehouse": { "type": 123 }, "retail": { "type": false } } } ... I would like to know the full path of, for instance, the key `type`. Something like `get-paht type` obta...
I'm using several keys from a long javascript object, represented as json. Example: ... "stock": { "type": 'str', "properties": { "warehouse": { "type": 123 }, "retail": { "type": false } } } ... I would like to know the full path of, for instance, the key type. Something like get-paht type obtaining root.somethingElse.stock.properties.retail.type without having to do it manually. This is a long file, and searching up and down doesn't seem productive... Cli or Gui tools tools are fine. However I can't find any application, extension or command-line tool that returns that. I tried "JsonView" for Chrome but I couldn't make it load a local file. jq Also doesn't seem to solve this, since there are some missing double quotes. **EDIT:** I realized this was a js object, although represented as json.
Fernando César (273 rep)
Feb 3, 2017, 10:02 AM • Last activity: Oct 23, 2024, 12:12 PM
0 votes
0 answers
42 views
polkit policy, restrict the parameters of an application when running with pkexec
I should be able to restrict the parameters when running an application without asking for password (debian 12, systemd 256, polkit 122-3). For example: ``` app foo app foo ... ``` should work, but ``` app bar app bar ... ``` should be blocked. This would be my approach, but it did not work: ``` pol...
I should be able to restrict the parameters when running an application without asking for password (debian 12, systemd 256, polkit 122-3). For example:
app foo
app foo ...
should work, but
app bar
app bar ...
should be blocked. This would be my approach, but it did not work:
polkit.addRule(function(action, subject) {
    var program = action.lookup("program");
    var args = action.lookup("command_line");

    if (action.id == "org.freedesktop.policykit.exec" &&
        subject.isInGroup("some ldap group") &&
        program == "/usr/bin/app" &&
        args == "foo") {
                return polkit.Result.YES;
        }
});
Does anyone have an idea?
daku69 (1 rep)
Sep 17, 2024, 05:59 AM
22 votes
2 answers
42374 views
How to minify Javascript and CSS with command-line using minify tool?
I'm not that versed in unix and I cannot have Java, so YUI Compressor does not apply, but I have this known [Minify tool][1], which will get a minified version of a JS/CSS file from a specific URI `/min/?f=/path/to/file.js.css` Which unix commands may I use, using such method, to minify all the js/c...
I'm not that versed in unix and I cannot have Java, so YUI Compressor does not apply, but I have this known Minify tool , which will get a minified version of a JS/CSS file from a specific URI /min/?f=/path/to/file.js.css Which unix commands may I use, using such method, to minify all the js/css files on the public_html folder, replacing all js/css files by their minified versions?
João Pimentel Ferreira (870 rep)
Dec 16, 2015, 11:30 AM • Last activity: Apr 3, 2024, 02:57 PM
0 votes
0 answers
93 views
Issue with `libz.so.1` when running PhantomJS
After extracting the file contents from the `phantomjs` archive, I ran the command `phantomjs` and was met with the error: ``` phantomjs: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory ``` I have searched online for solutions, but the probl...
After extracting the file contents from the phantomjs archive, I ran the command phantomjs and was met with the error:
phantomjs: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
I have searched online for solutions, but the problem still persists. I have updated the dynamic linker cache with ldconfig. I have updated the library path with:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libz.so.1:$LD_LIBRARY_PATH
I have even deleted the symbolic link /usr/lib/x86_64-linux-gnu/libz.so.1 and recreated it pointing to /usr/lib/x86_64-linux-gnu/libz.so.1.3. Also, the latest version of zlib1g-dev is already installed (1:1.3.dfsg-3+b1). If the solutions above did not resolve the issue, then what other solution could there be?
user362339
Feb 7, 2024, 06:20 PM
2 votes
1 answers
1102 views
Is it possible to make Firefox open a URL in a popup window?
I would like Firefox (the new super fast Quantum with low memory usage) to open some URLs in a special/popup window, i.e. almost without anything (toolbar, menu bar, tab bar, address bar, etc.) other than the web content. At the moment I can only do something like this by clicking a link in an HTML...
I would like Firefox (the new super fast Quantum with low memory usage) to open some URLs in a special/popup window, i.e. almost without anything (toolbar, menu bar, tab bar, address bar, etc.) other than the web content. At the moment I can only do something like this by clicking a link in an HTML file with the following code: WhatsApp I wish I could do this by simply entering a command from terminal - or a standalone shell script would also do (ideally without the address bar, and positioned to the right and not left ;-) Any suggestions or ideas please?
Sadi (515 rep)
Nov 16, 2017, 02:14 PM • Last activity: Feb 4, 2024, 05:07 PM
1 votes
1 answers
771 views
How to compare minimised JS files with very long lines? diff prints whole lines which is unreadable (400k characters per line)
I need to compare two "minimised", very similar JavaScript files. Minimisation means that (among other things) newline and space characters that are not needed for interpretation by a computer are removed. The files therefore have lines up to >400000 characters per line. I do not maintain these file...
I need to compare two "minimised", very similar JavaScript files. Minimisation means that (among other things) newline and space characters that are not needed for interpretation by a computer are removed. The files therefore have lines up to >400000 characters per line. I do not maintain these files and cannot change that they are minimised. How can I diff / show the differences between these very similar files, only showing the changed/added words, perhaps with 10 characters of context? Environment: This is on a server so I cannot install special tools or software for this comparison and we need to work with standard "onboard" tools please. It is a CentOS server so we have gawk, POSIX/GNU tools etc. as well as perl, php and python. It's just that I cannot install a package or clone a big git repo for this simple task. We use the tcsh for most of our work so if the Answer could work without the special syntax of particular, other shells that would preferable as it would make the solution more easily accessible.
Ned64 (9256 rep)
Jan 9, 2024, 11:04 PM • Last activity: Jan 10, 2024, 06:37 PM
1 votes
2 answers
91 views
Seems that any JavaScript makes my debian laptop crash
I have a Dell, debian stable, laptop working with gnome environment. For several weeks Firefox crashed more and more often, resulting in mouse slows down during fews seconds, and then everything freezes, the laptop heats a lot, forcing me to hard reboot. I noticed that websites such as WhatsApp web...
I have a Dell, debian stable, laptop working with gnome environment. For several weeks Firefox crashed more and more often, resulting in mouse slows down during fews seconds, and then everything freezes, the laptop heats a lot, forcing me to hard reboot. I noticed that websites such as WhatsApp web or YouTube were specifically involved in the "crash situations". For a week now, things have gotten much worse, any request on Google, with one window and one tab, crashes. I noticed that setting javascript.enabled=false in the settings of ff preserves from crashes. Also, signal-desktop segfaults when launched. I have issues finding enlightening logs, but can try. I also tried to uninstall and reinstall all the java packages but didn't have any effect. I ran journalctl -f, then waited for firefox to crash and I have uploaded the resulting log here: https://pastebin.com/4hFgtyAj . And, probably more readable, the logs corresponding to the segfault of signal-desktop: https://pastebin.com/9b4zd2Cm . I am also running memtest and I already have more than 800 errors.
Boudy (11 rep)
Jan 6, 2024, 01:28 PM • Last activity: Jan 10, 2024, 02:00 PM
-9 votes
6 answers
4567 views
Is the linux kernel ported to JavaScript yet?
Is the linux kernel or at least part of it been ported to JavaScript yet ? I want to program on linux kernel but don't want to use c.
Is the linux kernel or at least part of it been ported to JavaScript yet ? I want to program on linux kernel but don't want to use c.
user572212 (47 rep)
May 14, 2023, 12:33 AM • Last activity: Dec 13, 2023, 02:06 PM
4 votes
1 answers
3543 views
Javascript BTOA vs base64 in bash?
I need to convert a username and password combination into base64 before sending to an API. The javascript BTOA function is working for me, but when I try to use base64 command in bash I get slightly different results. **Javascript:** btoa("hello"); # aGVsbG8= btoa("username:password"); # dXNlcm5hbW...
I need to convert a username and password combination into base64 before sending to an API. The javascript BTOA function is working for me, but when I try to use base64 command in bash I get slightly different results. **Javascript:** btoa("hello"); # aGVsbG8= btoa("username:password"); # dXNlcm5hbWU6cGFzc3dvcmQ= btoa("testing"); # dGVzdGluZw== **Bash:** echo hello | base64 # aGVsbG8K echo username:password | base64 # dXNlcm5hbWU6cGFzc3dvcmQK echo testing | base64 # dGVzdGluZwo= Results are always similar but different. Server expects the JS style encoding, but I need to use bash. Why are the results different but similar? How can I produce the results from javascript with bash?
Philip Kirkbride (10746 rep)
Aug 3, 2017, 02:40 PM • Last activity: Dec 6, 2023, 06:52 PM
1 votes
0 answers
152 views
Is it possible to use webassembly in QNX
I’m trying to figure out if I’m able to port a webassembly based webapplication to QNX. But it is hard to find any information about what versions of browsers and web engine libraries that are shipped with what version of QNX and what features they support. SDP 7.x (which I believe is used with QNX...
I’m trying to figure out if I’m able to port a webassembly based webapplication to QNX. But it is hard to find any information about what versions of browsers and web engine libraries that are shipped with what version of QNX and what features they support. SDP 7.x (which I believe is used with QNX 7 and CAR 3?) seems to be shipped together with a modernized browser based on the Blink engine (instead of the webkit lib used in QNX 6). [It uses uses the V8 JavaScript engine](https://blackberry.qnx.com/content/dam/qnx/products/qnxcar/QNX_WebBrowser_ProductBrief_FINAL.pdf) [which supports webassembly](https://v8.dev/) So the browser in it self should support webassembly, right? I guess the webassembly code created with Emscriptens should be able to be compiled on any platform and transferred to the QNX system. Cause I believe Emscriptens wont run correctly on QNX? Or can I compile Emscripten with q++ on QNX and create the webassemby directly on the QNX system? I'm not sure I understood it correctly. But it seems like Emscripten should be able to compile and run on any system that can use LLVM, which QNX does. Can anyone with a bit more QNX knowledge confirm if this might be possible or not?
mattsson (113 rep)
Oct 12, 2023, 01:59 PM
3 votes
3 answers
1061 views
What JavaScript interpreter does Polkit use to interpret rules.d files?
What JavaScript interpreter does Polkit use to interpret rules.d files? The source code at time of writing links to a defuct Wikipedia heading ["ECMAScript.2C_5th_Edition"](https://gitlab.freedesktop.org/polkit/polkit/blob/8f0ef12901d36d1237a28a9abea509daef873feb/docs/man/polkit.xml#L506), however t...
What JavaScript interpreter does Polkit use to interpret rules.d files? The source code at time of writing links to a defuct Wikipedia heading ["ECMAScript.2C_5th_Edition"](https://gitlab.freedesktop.org/polkit/polkit/blob/8f0ef12901d36d1237a28a9abea509daef873feb/docs/man/polkit.xml#L506) , however that would only be the specification the interpreter is written to, not the specific implementation that is being used to interpret polkit rule files. Knowing what and how a javascript interpreter embeded in an authorization system is used would be nice to declare clearly. to disambiguate details such as where the interpreter is being embedding, what is sharing the runtime, when rules files functions are interpreted, if they are being interpreted asynchronously etc; clearly would be nice too.
ThorSummoner (4632 rep)
Jun 21, 2019, 02:15 AM • Last activity: Jul 25, 2023, 08:42 AM
0 votes
1 answers
321 views
How to pipe STDIO from a thread process to /dev/null?
I am trying to run [Plarium Play with wine][1], but have encountered an odd issue. When trying to launch it from a regular desktop entry, I get this JavaScript error: [![error 0][2]][2] This does not happen if I launch from the terminal. If I try and launch it from a desktop entry, even one piping t...
I am trying to run Plarium Play with wine , but have encountered an odd issue. When trying to launch it from a regular desktop entry, I get this JavaScript error: error 0 This does not happen if I launch from the terminal. If I try and launch it from a desktop entry, even one piping to /dev/null, after first login, without starting Plarium Play from a terminal first, I get two JavaScript errors, one after the other: error 1 error 2 In both cases, after dismissing them, the splash hangs forever. This does not happen if I launch Plarium Play from the command line first, then use the modified desktop entry (with an stdio pipe to /dev/null) for later launches. Notably, the program launched from terminal keeps running even if I press Ctrl+C or close the terminal, and later startups with the piped desktop entry are faster than the initial terminal launch, so I assume it is starting a background process. Also notably, if I try to launch Plarium Play after getting the aforementioned launch errors without logging out, it thinks that an instance of Plarium Play is running, and exits immediately. I cannot launch Plarium Play from the desktop entry, even if I did start the service from the terminal, unless I modify it to at least pipe regular stdio somewhere. If I try with an unmodified desktop entry, I get a similar JavaScript error to the ones above: error 3 Notably, I can still relaunch Plarium Play after this last error without logging out, so long as I do it from terminal or pipe the output. My conclusion is that the initial stages of the program to call up an existing instance of the background service NEED to debug somewhere, as do initial stages of the service startup, because of a limitation in JavaScript and Electron (I know little about either). The thing is, the service startup is of course sent to a separate thread, and as such won't use a regular > pipe from the launch command, although it will successfully find a regular terminal's stdio. However, configuring the desktop file to execute in terminal does not fix the problem for some reason. Note that any successful launch whatsoever brings up the Electron GUI of Plarium Play, as it is meant to. Assuming this conclusion is correct (please tell me if you think it isn't), what can I do to also pipe the attempted stdio access of the server startup thread to /dev/null (or anywhere), so that I do not have to launch Plarium Play from the command line first every time I log in?
TheLabCat (133 rep)
Jun 9, 2023, 09:36 PM • Last activity: Jul 7, 2023, 06:35 PM
1 votes
0 answers
498 views
Is /org/freedesktop/DBus accessible from a web browser?
We have some homebrewn applications running in top of a Xubuntu 18.04 OS, communicating with each other using D-Bus. The UI part is run in a web browser and web socket is being used for the communication with the applications. Our aim is to migrate every communication made to D-Bus, but I have tried...
We have some homebrewn applications running in top of a Xubuntu 18.04 OS, communicating with each other using D-Bus. The UI part is run in a web browser and web socket is being used for the communication with the applications. Our aim is to migrate every communication made to D-Bus, but I have tried accessing the /org/freedesktop/DBus from the chromium browser for testing purposes and had no luck. I used this library : var dbus = require('dbus-native') var conn = dbus.createConnection() conn.message({ path: '/org/freedesktop/DBus', destination: 'org.freedesktop.DBus', 'interface': 'org.freedesktop.DBus', member: 'Hello', type: dbus.messageType.methodCall }) conn.on('message', function (msg) { console.log(msg) }) And this is what I see in the browser console: Uncaught Error: unknown bus address at createStream (index.js?26d9:22) at Object.createConnection (index.js?26d9:76) This is what I see when running dbus-monitor, but I don't know if it can even be related to my connection attempt: signal time=1626258028.185483 sender=org.freedesktop.DBus -> destination=:1.196 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired string ":1.196" signal time=1626258028.185641 sender=org.freedesktop.DBus -> destination=:1.196 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost string ":1.196" method call time=1626258031.724118 sender=:1.195 -> destination=org.freedesktop.PowerManagement serial=7 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagement.Inhibit; member=UnInhibit uint32 39 method return time=1626258031.724440 sender=:1.27 -> destination=:1.195 serial=151 reply_serial=7 method call time=1626258031.724721 sender=:1.195 -> destination=org.freedesktop.DBus serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'" method return time=1626258031.724743 sender=org.freedesktop.DBus -> destination=:1.195 serial=7 reply_serial=8 signal time=1626258031.725311 sender=org.freedesktop.DBus -> destination=:1.195 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost string ":1.195" signal time=1626258031.725517 sender=org.freedesktop.DBus -> destination=(null destination) serial=339 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged string ":1.195" string ":1.195" string "" Is the freedesktop DBus accessible from the web browser or maybe do I need to make some tweak in the DBus daemon configuration to allow it? I'm kind of new to D-Bus.
Aritz (123 rep)
Jul 14, 2021, 10:24 AM • Last activity: Mar 24, 2023, 05:56 PM
0 votes
0 answers
217 views
Simple text browser website access BUT PROTECTED by CloudFlare - JavaScript problem
**EDIT on 13-11-2022 (DD-MM-YYYY) to clarify things a bit:** I, a human, want to simply read the text contents of a website, which happens to be protected by CloudFlare protection. **Yes**, I know that such a protection is useful in order to prevent spam bots to do any harm. **BUT I AM A HUMAN** who...
**EDIT on 13-11-2022 (DD-MM-YYYY) to clarify things a bit:** I, a human, want to simply read the text contents of a website, which happens to be protected by CloudFlare protection. **Yes**, I know that such a protection is useful in order to prevent spam bots to do any harm. **BUT I AM A HUMAN** who seems to not even being given the chance to prove my humanity. Reading a website with my text browser is all I want, saving some information - like humans could do - would be even better. I do not see anything bad or even illegal in an approach of simply reading text contents of a website, like a civilized human. **Isn't that the reason why websites even offer information in the first place?** Hello stackexchange community! After some hours of research and trying different things while coding ... I now think my best bet would be to ask some Linux and programming pro's like I am going to find on here. So, **my task is actually very simple**. I want to execute a (e.g. batch) **script**, that visits a certain website and **saves the HTML output** to a text file. **Problematic** about the website: It is **protected by CloudFlare**; ***JavaScript*** needed, ***which isn't supported by lynx***). So, I want to develop a simple solution that either uses Java or Linux (e.g. batch) in some ways. It has to be **as lightweight as possible** - and that's where my **headache** seems to start. I encountered a list online on github, which aims to summarize all headless (text) browsers in various programming languages. Most of them, sadly, require the use of around ~20 dependencies, which is - in my humble opinion - not appropriate, nor feasible. Also, throughout my research on StackOverflow I encountered rather similiar problems. Like this solution: https://unix.stackexchange.com/questions/703599/couldnt-download-an-url-using-curl-or-wget-but-it-works-in-browser So, there seems to be a solution using curl and transmitting some startup-parameters, which will then be used to overcome the JavaScript/CloudFlare obstacles. But, I am afraid, I don't seem to be able to get this code to run properly. This also seems to summarize my problem really well, but sadly, there are no useful answers to me: https://unix.stackexchange.com/questions/703730/command-line-tool-to-use-js-enabled-browser-to-save-web-page Could someone please give me a little tip on where to have a look at next? Important about my little project: Lightweight as possible, no human user interaction required! Thank you very much, dear community, for helping me in any way possible! My best regards to you - I am looking forward to hearing from any of you pro's :-)
Orca37 (1 rep)
Nov 9, 2022, 12:18 PM • Last activity: Nov 13, 2022, 01:30 PM
3 votes
3 answers
6104 views
JQ (GET ID based on NAME)
I get a long list of such arrays { "id": "byu6g6c4cjys5mdkg5znh8ju8c", "create_at": 1511875272294, "update_at": 1511875272294, "delete_at": 0, "display_name": "BMA", "name": "BMA", "description": "", "email": "aleksandar.ivanov@random.com", "type": "O", "company_name": "", "allowed_domains": "", "in...
I get a long list of such arrays { "id": "byu6g6c4cjys5mdkg5znh8ju8c", "create_at": 1511875272294, "update_at": 1511875272294, "delete_at": 0, "display_name": "BMA", "name": "BMA", "description": "", "email": "aleksandar.ivanov@random.com", "type": "O", "company_name": "", "allowed_domains": "", "invite_id": "gdgz1tbxuinntx1fbr1ax7kehy", "allow_open_invite": false, "scheme_id": null } I want to get by JQ only the ID where the name is BMA. At the moment I parse " jq -r '.[]["name"]" and I can filter the output from curl by name and I will get "BMA" and also 100 other names, but I need to filter only the ID where name is =BMA. Any ideas?
WhoAmI (177 rep)
Nov 29, 2018, 05:32 PM • Last activity: Oct 16, 2022, 11:42 AM
Showing page 1 of 20 total questions