Recent Questions - Unix & Linux Stack Exchange |
- How to write NGINX configuration for wordpress and legacy files
- What type of buffering does stderr use by default (in linux)?
- Using SCP in a Bastion VM setup with an established SSH tunnel
- Awk regex pattern matching with space
- Programmatically Trigger Drag&Drop Events on Linux
- Re-run multiple commands without pressing up a lot
- Why does lspci in an Azure VM show only a NIC card?
- Make scp skip downloading a file when "Permission denied" occure and instead try the next one
- Error using glib2 from yum: "libgio-2.0.so.0: undefined symbol: g_free"
- Deleting lines of a series of ASCII (.csv) files having a certain row number
- Transform csv multiple columns to single column
- Why is it possible to "loop" a filesystem by mounting it to one of its folders?
- Removing single quotes from double-quoted variable element in array and run a command
- Start program in virtual console
- How to grep below match criteria
- awk case insensitive with gsub
- Can't write tildes on konsole and certain console emulators
- If using while read loops for text processing in bash is bad...what should I do, then?
- Opera is unable to play videos in MX Linux KDE version
- No wi-fi on Linux Mint 19.3 Tricia
- What means the definition of path and leaf array in jq --stream man page
- How to write udev rule that matches a device's interface attribute(s)
- DEAUTH_LEAVING error
- Accessing MTP mounted device in terminal
- How to cleanup SSH reverse tunnel socket after connection closed?
- How do you keep only the last n lines of a log file?
- Rows to column conversion of file
- How can I replace root / filesystem with another filesystem?
- How to make nemo support compressing files by context menu?
- How do I delete the first n lines of an ascii file using shell commands?
How to write NGINX configuration for wordpress and legacy files Posted: 12 Aug 2021 10:48 AM PDT I want to serve files from wordpress and legacy static files from a directory. For example I want to serve wordpress home page / and wordpress files such as wp-login.php and newly created wordpress articles with permalink /articles/ and I want to serve legacy .html files from /legacy directory. So if nginx finds wordpress files serve them, if not found then check legacy directory .. The config file shown below will do all of the above except will not serve the images and javascript etc from legacy files .. It will serve the html files from the /legacy directory and the home page from / but does not serve files like myserver.com/image/image.png or myserver.com/image.jpg (or any other images for example) -- I have tried numerous config alternations with no luck. Thanks for any help. |
What type of buffering does stderr use by default (in linux)? Posted: 12 Aug 2021 10:32 AM PDT What type of buffering does stderr use by default (in linux)? What type of buffering does stderr use by default (in linux)? What type of buffering does stderr use by default (in linux)? What type of buffering does stderr use by default (in linux)? What type of buffering does stderr use by default (in linux)? |
Using SCP in a Bastion VM setup with an established SSH tunnel Posted: 12 Aug 2021 10:31 AM PDT I am looking at ways to mitigate the potential for using scp commands within GCE VMs that are running CentOS 8. Current setup is a bastion VM being able to SSH into a secondary VM (instance-1). I have not been able to SSH back from the secondary VM into the bastion VM after establishing the first SSH connection and I am assuming this is due to not having a SSH keypair in the opposite direction (someone correct me if I am wrong there). Error when running I am attempting to SCP from instance-1 to the bastion and that does not work either with an error of Is there a way to work around this? I want to see what potential approaches can be used for running SCP commands from instance-1 to the bastion. Would any form of TCP forwarding or establishing a different SSH tunnel allow for files to be transferred out? |
Awk regex pattern matching with space Posted: 12 Aug 2021 10:31 AM PDT I have a file I'd like to make an awk script to check how many fruits are there in the file. I have tried and it should return 4, since 4 of their pairs are exact match, but they're returning 5 I think due to |
Programmatically Trigger Drag&Drop Events on Linux Posted: 12 Aug 2021 10:19 AM PDT I currently working on an interactive video stream application (implemented in PyQt5) which allows viewers of the stream to interact with the streamer's system, for example by moving the mouse cursor or opening programs. I would also want to allow Drag&Drop through the stream from one device to the other. I was able to implement the drag part as well as transferring the data by using QWidget's dropEvent()-Function and a web server. However, I am struggling with triggering a drop event at certain coordinates on the streamer's system. I had a look at xdnd as well as some applications such as xcopy already, but all of those seem to require the mouse for drag and drop. Is there any way to tell X11 to invoke a drop event with a certain payload at given coordinates without having to use the mouse? Thank you in advance! |
Re-run multiple commands without pressing up a lot Posted: 12 Aug 2021 10:32 AM PDT I embarrassingly often find myself repeating a lot of previous commands. I go Up Up Up to find the first command. Enter. Then Up Up Up again for the second command. And so on. Is there a way to step to the next command in history after re-running one? Like it would be great to do Up Up Up Shift+Enter Shift+Enter Shift+Enter to re-run the last three commands. I know about |
Why does lspci in an Azure VM show only a NIC card? Posted: 12 Aug 2021 09:54 AM PDT Normally in a Linux system a bunch of things show up, but in an Azure VM it shows only a single NIC card. Why is that? |
Make scp skip downloading a file when "Permission denied" occure and instead try the next one Posted: 12 Aug 2021 09:51 AM PDT After transferring 2TB of 3TB using scp my internet died. I try to resolve this matter by setting all the files I have downloaded as read only with the hope of scp trying to copy over the file, realizing that a file with that name exist and it does not have premission to overwrite it and thus skip it. However, does not work as I had hoped. Instead scp terminate, saying "Permission Denied", which is accurate but I would like it to then just give up and look at the next file. Is this possible to do? I have not found any such flags in the manual so do not really know. Is there maybe a better way of doing it? |
Error using glib2 from yum: "libgio-2.0.so.0: undefined symbol: g_free" Posted: 12 Aug 2021 09:48 AM PDT I am trying to build all of the dependencies for Weasyprint 52.5 for AWS Lambda. Despite being a python library, Weasyprint has a large number of OS dependencies. I'm creating a lambda layer by downloading all of the necessary rpms from yum and extracting the shared libraries. It nearly works but I can't seem to get around this error with libgio. The OS is Amazon Linux 2, which uses yum for package management and seems to match up with CentOS 7. This is the yum call command: Which pulls these package versions: Running rpmdev-extract to extract the rpms results in these shared libraries: When Weasyprint calls
I have tried downgrading some of the key packages to the other versions available on yum, but with no success. Specifically, I have tried downgrading the following: but this results in the same error. What is causing the undefined symbol error? Is there any workaround that will resolve this error? |
Deleting lines of a series of ASCII (.csv) files having a certain row number Posted: 12 Aug 2021 09:12 AM PDT I have a series of 297 directories named as "dir000', 'dir001' and so on, each of which contains a text file called "config", which is a csv file with 3 columns and 256 rows. I have generated 25 random numbers in the range 1 to 256, and from all these files in each directory, I am required to remove those exact 25 rows. For instance, if my generator gave me a series of random numbers |
Transform csv multiple columns to single column Posted: 12 Aug 2021 09:39 AM PDT I have 1 csv data with multiple column, without header: Then I would like to transpose it into single column, starting from first column. The expected output is below: Anyone have a clue how to solve this problem? What I have done is using excel formula: I am looking for faster way to do this, using script for example. |
Why is it possible to "loop" a filesystem by mounting it to one of its folders? Posted: 12 Aug 2021 09:58 AM PDT /dev/sda5 is mounted at / and it's my filesystem so now I can do: and when I'm in second mpoint directory, it's empty. My questions are:
|
Removing single quotes from double-quoted variable element in array and run a command Posted: 12 Aug 2021 10:17 AM PDT I have a script where I dinamically change the arguments which must be passed to a command (mkvpropedit in this case). Consider the example script below: When I run this, I get in the console: But I would like not having the single quotes on the final invocation of mkvpropedit, like so: I tried also echoing the array into a variable, and echo removes the single quote, but then I'm not able to use the variable as an argument of mkvpropedit because the single quotes appear again... Of course the script has to work also if the variable is a single word, such as Updated questionProbably the example below better explains what I'm trying to do. I've changed some names to be replicable. If I run this script, I get (due to the wrong quote): While if I run, manually: So it's definitely a quoting issue; I would like to invoke mkvpropedit using the array in the script. Using evalWhat seems to work, at the moment, is inserting Returns: |
Start program in virtual console Posted: 12 Aug 2021 09:47 AM PDT I am trying to create a desktop shortcut to start kodi on my Raspberry Pi running Raspberry Pi OS. My problem is:
To actually start I am wondering if I could somehow change my shortcut command to start and switch to kodi on TTY1 virtual console? Or any other way to make it work? I have tried (from normal terminal on TTY7):
|
How to grep below match criteria Posted: 12 Aug 2021 09:17 AM PDT I have a challenging task that requires some logic in on order to grep to grep for lines between a section: I have in a file the below contents: What I need to extract from the file is if I grep for chunkbig10_1039, I would like to print all the lines eppix* and I do not even know where to begin on how to achieve this. The problem is I cannot grep for eppix for example, because that can be anything but is an example if it were straight forward |
awk case insensitive with gsub Posted: 12 Aug 2021 10:01 AM PDT I have text data, and want to transform a column values I want to search for (father|son|daughter) case insensitively and substitute any father combination to Father, any case of son to Son, any case of daughter to Daughter So outfile should look like this I'm trying different combination of IGNORECASE with sub or gsub, but it prints all entries as is in infile |
Can't write tildes on konsole and certain console emulators Posted: 12 Aug 2021 09:52 AM PDT So im completely bewildered on this problem, initially two years ago i remember being able to use tildes(~) easily on terminal emulators, but for some reason it suddenly stopped working for this and other small characters on certain terminal emulators(like konsole and kitty but strangely not alacritty where at least for tildes it seems to work). I would like to provide more data but the only thing that journalctl provides is this which seems to be related to my keyboard somehow: I forgot to add but i run two keyboards typically however every time i unplug my external keyboard(im working on a laptop and the embedded one has some few physical keys missing) i run to set my portuguese layout
I work on arch linux, and althought its a bit outdated, ive updated it for months, and the problem persisted so not being updated doesnt seem to be the problem. I kinda suck at writting and will divulge to much so feel free to offer criticism on text i can cut from this question Update: i now know why it stopped working in general, although i don't know precisely how to fix it, apparently konsole when i use kde as the desktop manager instead of openbox makes it work, i've attemted to manually fill out the enviroment variables on .zshrc that are unset namely these: ive tried changing this to autostart file on /etc/xdg/openbox/autostart but for some reason both set and export get ignored |
If using while read loops for text processing in bash is bad...what should I do, then? Posted: 12 Aug 2021 09:35 AM PDT I guess this may be a naive question but I can't get my head around so I felt like asking... I was searching for some solution to a problem, when I found this very interesting post about why is using I searched extensively: I googled (or duckduckgo-ed) and this: that are indicated as very bad examples of shell scripting. At this point I am wondering, and this is the actual question: if the posted while loops should be avoided because they are bad practice and whatever...what am I supposed to do, instead? EDIT: I see that I am already having comments/questions addressing the exact issue with the |
Opera is unable to play videos in MX Linux KDE version Posted: 12 Aug 2021 09:02 AM PDT I recently installed and started to use the Opera browser as it offers a wide range of functionality and the workspace feature: it seems very viable for me. But when it comes to playing videos, this browser is giving me lots of trouble. So let me add a screenshot to show what actually is happening here. The same goes for Netflix; here is the screenshot. Are there any workarounds to this problem? I really love this browser; I want to use it for this purpose. |
No wi-fi on Linux Mint 19.3 Tricia Posted: 12 Aug 2021 09:47 AM PDT I know there is a lot of posts about this problem, but i tried to find a solution every where my problem persist.. So when i want to use my wi-fi, it say: Not available, so i can use ethernet connexion only.. Here is some details of my configuration : nmcli general status : nmcli device wifi : (It show nothing) inxi -Fxz : iwconfig : lsusb : Also, secure boot is disabled ! It's realy boring to stay in ethernet, i can't find out from where this problem come from, i tried to install drivers ect.. never worked.. Thank for your help guys ! |
What means the definition of path and leaf array in jq --stream man page Posted: 12 Aug 2021 10:36 AM PDT In the
I want to know the meaning of "arrays of path and leaf values" and why the input representation is transformed like: and I have been reviewing trees like list representation but it's not similar. |
How to write udev rule that matches a device's interface attribute(s) Posted: 12 Aug 2021 11:01 AM PDT I have a USBTMC device that has a usbtmc interface. The interface has bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol attributes with values 'fe', '3', and '1' respectively. The question is how to write a udev rule that matches attributes on an interface of the device. It appears that matching starts the device level, and can only look "upward" at the device's parents, but cannot look "downward" (down the sysfs tree) into the device's interface(s). I'm able to write a working rule that matches based on the VID/PID: but a rule like this does NOT work: The following shows a listing of the device, and shows the attributes of the interface found under 1-1:1.0: The command: udevadm info -a -n lists device ATTR that can be used, as well as parent ATTRS. None of these include the (child) interface attributes. Any help would be appreciated. |
Posted: 12 Aug 2021 10:00 AM PDT I'm not able to manage this error I obtain the error only when I'm trying to connect to a WPA2-Enterprise network (EAP-MSCHAP2). Other connections work well without any error. This error has been obtained after a Linux upgrade, at now I'm using Lurking I've seen a possible cause to this problem: the TLSv1.2 support has been disabled. I've seen several solutions with wpa_supplicant, but I'm using network manager. I've also tried to configure wpa_supplicant without any result. What can I do? |
Accessing MTP mounted device in terminal Posted: 12 Aug 2021 09:35 AM PDT
gives the error : Even though the device is mounted in the file manager and shows the same mtp path I'd like to access it via terminal to able to copy data out of it as the File Manager just hangs when done via the GUI. Distribution : Fedora 28 |
How to cleanup SSH reverse tunnel socket after connection closed? Posted: 12 Aug 2021 10:57 AM PDT If I run something like this: And then lets say the connection is closed or dies for whatever reason.. say the computer reboots due to maintenance or error or there's internet connectivity issues or whatever -> we have a big problem. The created socket file On the server side you get something like: What would be the supported way / best hack to cleanup the socket after disconnect? Is this a bug in sshd, shouldn't it do that automatically if/when disconnects are noticed? Backstory:The idea behind using the sockets is simply that the server is going to handle n "dudes" creating reverse tunnels for m "lol" services in whatever ports and using sockets makes it much easier to ensure that a "dude" can only access and bind to his own sockets, but not other dudes sockets. It also frees me from having to keep record of which dude is using which port to expose which service. And when dude wants to connect to the service on some other server all he needs to know is the name of the service and bind it to some random local port (or socket if he wants to) i.e.
There's no need to know some magic port number that the reverse tunnel on the server is suppose to be running on. So, if you have better ideas how to solve this issue I'm all ears. Tested with client/server both running |
How do you keep only the last n lines of a log file? Posted: 12 Aug 2021 08:56 AM PDT A script I wrote does something and, at the end, appends some lines to its own logfile. I'd like to keep only the last n lines (say, 1000 lines) of the logfile. This can be done at the end of the script in this way: but is there a more clean and elegant solution? Perhaps accomplished via a single command? |
Rows to column conversion of file Posted: 12 Aug 2021 09:33 AM PDT Suppose I have a file: File1: File2 I want: Rows to column conversion of File1. |
How can I replace root / filesystem with another filesystem? Posted: 12 Aug 2021 09:01 AM PDT When the Linux kernel starts up, it uses initrd as the root / filesystem, then replaces that with a filesystem partition in fstab. Based on a test in an early init script, I want to replace that root / filesystem with another filesystem partition. How to do that? |
How to make nemo support compressing files by context menu? Posted: 12 Aug 2021 09:01 AM PDT I use Cinnamon on ArchLinux and Nemo is it's default file manager. I've tried 3 GUI file archivers ( How can I add a "compress option" to Nemo's right click context menu? |
How do I delete the first n lines of an ascii file using shell commands? Posted: 12 Aug 2021 08:54 AM PDT I have multiple files that contain ascii text information in the first 5-10 lines, followed by well-tabulated matrix information. In a shell script, I want to remove these first few lines of text so that I can use the pure matrix information in another program. How can I use bash shell commands to do this? If it's any help, I'm using RedHat and an Ubuntu linux systems. |
You are subscribed to email updates from Recent Questions - Unix & Linux Stack Exchange. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment