Why is endpoint already connected when running mutiple processes Posted: 25 Mar 2021 09:59 AM PDT I am running the following client: import socket import Utility import threading import os.path import time class Requester: def __init__(self): self.address = "/tmp/device-web-serverinterface.socket" try: self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.mutex = threading.Lock() except: print("Failed") #raise Exception("The connection could not be established.") def ask(self): self.mutex.acquire() self.sock.connect(self.address) self.sock.sendall(Utility.tolength("DO UNIX-Terminal -1", " ", 2048).encode()) m = self.sock.recv(2048) self.sock.close() self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.mutex.release() return m in more than one instance. (With one instance everything works fine) and the following Server (once): class ListenerThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.adress = "/tmp/device-web-serverinterface.socket" if os.path.exists(self.adress): os.remove(self.adress) def run(self): self.bindsocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.bindsocket.bind(self.adress) self.bindsocket.listen(100) while True: newsocket, addr = self.bindsocket.accept() print("Accepted") string = newsocket.recv(2048).decode() (deviceid, cmd, cmdargs, _) = string.split(" ", 3) if cmd == "DO": message = "OK: " backmessage = self.give(self, deviceid, cmd, cmdargs) message = (message + backmessage) newsocket.sendall((message + " "*(MESSAGELENGTH-len(br))).encode()) else: br = "BAD REQUEST" newsocket.sendall((br + " "*(MESSAGELENGTH-len(br))).encode()) print("TEST") newsocket.close() when running the client I almost certainly get the error below after the second execute. I cannot decide which process to run (uwsgi) : Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1936, in dispatch_request Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: return self.view_functions[rule.endpoint](**req.view_args) Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: File "/usr/local/lib/python3.6/dist-packages/flask_login/utils.py", line 272, in decorated_view Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: return func(*args, **kwargs) Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: File "./main.py", line 36, in device_post Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: return render_template('devices.html', message = devicecommunicator.ask()) Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: File "./DeviceServerRequester.py", line 22, in ask Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: self.sock.connect(self.address) Mär 25 17:44:50 ******.stratoserver.net uwsgi[2724]: OSError: [Errno 106] Transport endpoint is already connected This makes no sense to the depth of my knowledge. |
command to grep lines of 10days old entries from a specific text file Posted: 25 Mar 2021 09:58 AM PDT Linux command to search with word 'Error' and grep only 10days old entries/logs from a specific file.txt, below are the sample entries of file.txt "[2021-01-08T16:06:25.0017+11:00] [INCIDENT_ERROR:32] [9999] [core.c] [host_id: orgnistion.com] [host_addr: 105.34.12.45]", "[2021-02-08T16:02:33.0009+11:00] [INCIDENT_ERROR:32] [9999] [core.c] [host_id: orgnistion.com] [host_addr: 105.34.12.45]" "[2020-12-08T16:09:15.0015+11:00] [INCIDENT_ERROR:32] [9999] [core.c] [host_id: orgnistion.com] [host_addr: 105.34.12.45]" "[2021-01-08T16:02:29.0013+11:00] [INCIDENT_PASS:2] [9999] [core.c] [host_id: orgnistion.com] [host_addr: 105.34.12.45]" "[2021-01-08T16:07:27.0012+11:00] [INCIDENT_PASS:3] [9999] [core.c] [host_id: orgnistion.com] [host_addr: 105.34.12.45]" |
not getting whole data by sqlmap Posted: 25 Mar 2021 09:22 AM PDT $ sqlmap -u http://192.168.0.106/get_method/get_data/?id=1 -D get_method -T user --dump But, my data CSV also completely same as terminal picture name,serial,password,timestamp asdf,1,asdf,2021-03-23 13:35:00 Why I am not getting whole data by sqlmap? |
using of sqlmap by different ip addresses Posted: 25 Mar 2021 09:21 AM PDT sqlmap -u http://192.168.0.106/get_method/get_data/?id=1 --dbs I know that if we sent any request to any server that server takes ip address of user(mine). So, while I am running the above source code server is getting my ip address. So, they can easily find me. ~ I am not sure of the information also. In Kali-Linux, there's something called proxychains.conf . I was trying to use that proxychains4 sqlmap -u http://192.168.0.106/get_method/get_data/?id=1 --dbs But, proxychains not working I am saying that by [proxychains] Dynamic chain ... 127.0.0.1:9050 ... 192.168.0.106:80 <--denied . I am getting data by above code also but, not using different ip addresses ~I think I am not sure of it also. So, I want to change my ip address every moment when I works with sqlmap or any other vulnerability. I am totally Newbie. |
wlan0 isn't working most of times Posted: 25 Mar 2021 08:48 AM PDT |
How can I install Nitrux (cause znx isn't available) Posted: 25 Mar 2021 08:43 AM PDT I want to install Nitrux, because it looks amazing. I've flash on my USB and I restarted computer. Than I choose Boot from usb, but I had blank screen and than my OS booted. I tried to install another OS and that worked. So I think this is wrong way to install. Can you help me? |
installing ubuntu on dell inspiron 14 7490 Posted: 25 Mar 2021 08:34 AM PDT I'm using dell inspiron 14 7490 with windows10. I hope to download the ubuntu 20.04 LTS, but according to the other people sayings, dell inspiron 14 7490 can't insatll ubuntu. Because its BIOS doesn't support ACHI mode for ubuntu. My problem is: - Is there any way to install ubuntu in inspirion 14 7490?
- If I do factorial reset my laptop, is it possible to download ubuntu?
Please give me any advice to solve this problem. |
Would it be best for PowerShell scripts to also have a shebang? Posted: 25 Mar 2021 08:58 AM PDT Shell scripts are better when having a shebang like so: #!/bin/bash echo "The shebang above this line works like a typical a comment but with a purpose" PowerShell scripts are also shell scripts. So it should be okay to do like so: #!/usr/local/bin/pwsh echo "The shebang above this line works like a typical a comment but with a purpose" It seems to does not make sense if the script was intended for Windows machines but for Linux and Mac machines they seem to make sense. Do you think it would be best for PowerShell scripts to also have a shebang? |
replicator program [closed] Posted: 25 Mar 2021 08:10 AM PDT You are asked to develop a replicator (client) that distributes a large job over a number of computers (a server group) on a single switched LAN (our Linux lab). In this assignment, a large (simulation) job can be divided into a number of small jobs, each of which can be assigned to one machine from the server group for execution. The execution results of the small jobs can be merged once all of them successfully terminate. System Architecture: client server1 server2 server3 ... | | | | | | | | | LAN | | | |------------------|--------------|--------------|----- The client and servers are running Network File System (NFS) so that user files are visible at $HOME directory. You may want to set up the following environment: $HOME/replicate.hosts: a list of (server) hostnames which participate in the simulation. There is no reason why your implementation cannot support up to 10 servers. $HOME/replicate_out: the directory that stores the small job execution result. The simulation program " hyper_link " (binary) is provided. In this assignment, you don't need to know or care what "hyper_link" does, and actually it is a computing intensive (CPU demanding) simulator. The command line arguments of "hyper_link" are job# 1000000 999 1 2 2 100, where the job number determines the number of small jobs in your simulation. To allow the client to run a large job, the job# should be given in a tuple: start, end, and step. For example, the command (from the client) "hyper_link 1 100 1 1000000 999 1 2 2 100" yields 100 small jobs with the job# starting from 1 to 100. Each small job produces a screen output (see example below) at the end (if finished successfully). Your code needs to redirect the output to a file and save it in $HOME/replicate_out. For example (on the server side), ./hyper_link 1 1000000 999 1 2 2 100 will produce a screen output looks like (it takes approximately 2 minutes on spirit): 1:1000000:999:2:0.5:1.125193e+00:2.454346e-04:6.251640e-01:2.205078e-04:0.000000e+00:0.000000e+00 Requirements: The communications between the replicator and servers are achieved through remote procedure calls in the client-server fashion. You can only use C programming lanuage to complete this project. Your implementation should not rely on any extra library (to compile your code). Your code must compile by using gcc installed on the Linux workstations in FH 133. A user interface is required for the replicator to control the server. A command line interface will be acceptable. A (working) graphic user interface (GUI) will impress the instructor and earn up to 20 bonus credits. Your client interface should at least support the following operations. start a large job. For example: hyper_link 1 100 1 1000000 999 1 2 2 100 (start 100 small jobs with job number starting from 1 to 100) show the current CPU load of a certain server (if the server is active). show the current server status (active or inactive). stop a certain server. restart a certain server. For those who are going to implement GUI, you need to create an icon for each server, and show the server status in the real time, e.g., the CPU load (with the mark of hi-threshold), active/inactive, etc. The hi-threshold and lo-threshold can be set to the pre-determined values (as long as they are reasonable). Alternatively, you will impress the instructor by implementing the configurable threshold values during the run. If that is the case, you have to provide two extra commands that set the values. The replicator has to make sure all small jobs are successfully finished. If a server crashes (or not responsive), the running job (not finished yet) will be killed and rescheduled (at a certain time per your design) for execution. If a server CPU load exceed the preset threshold (the higher threshold), the replicator stops the server (and therefore kills the job). The replicate should keep polling the CPU load of the stopped server. Once the load becomes lower than the lower threshold (a preset value), the server should be reactivated to run the jobs. The replicator can also stop any server (through user interface) if needed. Once happened, the unfinished job will be killed. If a job terminates abnormally (e.g., being killed), the replicator has to reschedule the job execution later. Makefile: you need to provide a Makefile that allows the instructor to compile your code by simply typing "make". Write-up: you are required to write a README document (in txt format) that describes your project design detail and the execution sequence (with the commands). In particular, please explicitly state which part, if there is any, does not work and the possible reasons why that module does not work. For those working modules, please give a brief (in short) sample output. |
On Linux (Mint) MATE How Can I Make ALT+TAB Switch Between Only The Current Workspace's Windows Posted: 25 Mar 2021 08:16 AM PDT For some reason my version of Linux Mint MATE is configured to switch between applications on any workspace when I use ALT+TAB . Simple question: is there any way to limit it to only switch between applications on my current workspace? |
How to echo an exclamation point without the backslash in the output to prevent expansion Posted: 25 Mar 2021 08:38 AM PDT I usually like to echo certain string which have an exclamation point in them. And while i know how to escape them to prevent expansion by the Shell, i noticed it also print the backslash... echo "\!" # will print \! instead of just ! Contrary to other tool like sed which does not print the backslash if used to prevent expansion of possible valid parameter used by sed : echo "test" | sed 's/^\(.*\)$/\1 \!/' # print -> test ! echo "test" | sed 's/^\(.*\)$/\1 !/' # also print -> test ! echo "test" | sed "s/^\(.*\)$/\1 ! /" # also print -> test !, though needed to put a space or use a backslash for it to show correctly How can i do the same with echo or I'm i obliged to use other tools like sed ? EDIT: Just noticed using '' instead of "" with the echo example above works for printing ! without shell expansion (both with and without the backslash), though: - It wouldn't work in instance when one want to use command substitution with
echo , since it only work with "" ... |
Delete all the entries of more words given as parameter from a file that is given as first parameter.The file will be modified and nothing to be shown Posted: 25 Mar 2021 08:08 AM PDT I have to delete, using sed all the entries of more words given as parameters from a file that is given as the first parameter. The file will be modified and nothing has to be shown. I tried this, but it only works for one word given as a parameter, and the word isn't actually deleted from the file. I want it to work for more words given as a parameter and also the words to be deleted from the specified file, without listing the content at the standard output. sed -n "/$2/d" $1 |
How to manage CIFS permissions on a mounted drive in linux? Posted: 25 Mar 2021 07:59 AM PDT I have copied over from a cifs mounted volume to another cifs mounted volume a large number of files. The 2 volumes were mounted locally with the following command: # mount -t cifs -o username=<username>,password=<password>,domain=<domain> //nas1.domain.com/volume1 /mnt/folder1 # mount -t cifs -o username=<username>,password=<password>,domain=<domain> //nas2.domain.com/volume2 /mnt/folder2 Very specific permissions were granted to specific Active Directory domain groups on the files. However, when I list the files on the destination, they all belong to root:root . How do I: - know the name of the group the permissions were originally granted to (i.e. list all the permissions on the parent / volume folder - here volume2)?
- list the permissions that were set while copying?
Preferably, I'd like to avoid having to install a Windows machine just for this... |
'sudo env' and 'sudo -i env' show different results Posted: 25 Mar 2021 07:48 AM PDT When I run sudo env | grep PATH , sudo -s env | grep PATH , and sudo -i env | grep PATH commands in my server, the first two commands show the same result. However, the last one, sudo -i env | grep PATH shows a different PATH value. Why is this so, and how can I make sudo , sudo -s , and sudo -i commands have the same PATH variable? I'm on CentOS 7.8. Any comments, links appreciated! |
What repo do I need to install SVN - Subversion? Posted: 25 Mar 2021 07:42 AM PDT I am trying to install SVN (subversion) but when I run $yum install svn I just get No match for argument: svn What repository do I need to configure and or add to be able to install this? EDIT Here is my repolist AppStream CentOS-8 - AppStream disabled AppStream-source CentOS-8 - AppStream Sources disabled BaseOS CentOS-8 - Base enabled: 1,697 BaseOS-source CentOS-8 - BaseOS Sources disabled PowerTools CentOS-8 - PowerTools disabled base-debuginfo CentOS-8 - Debuginfo disabled c8-media-AppStream CentOS-AppStream-8 - Media disabled c8-media-BaseOS CentOS-BaseOS-8 - Media disabled centos-8.0-updates-media-AppStream CentOS-Updates-AppStream-8.0 - Media disabled centos-8.0-updates-media-BaseOS CentOS-Updates-BaseOS-8.0 - Media disabled centosplus CentOS-8 - Plus disabled centosplus-source CentOS-8 - Plus Sources disabled cr CentOS-8 - cr disabled *epel Extra Packages for Enterprise Linux 8 - x86_64 enabled: 7,145 epel-debuginfo Extra Packages for Enterprise Linux 8 - x86_64 - Debug disabled *epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 enabled: 0 epel-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - x86_64 - Debug disabled epel-modular-source Extra Packages for Enterprise Linux Modular 8 - x86_64 - Source disabled epel-playground Extra Packages for Enterprise Linux 8 - Playground - x86_64 disabled epel-playground-debuginfo Extra Packages for Enterprise Linux 8 - Playground - x86_64 - Debug disabled epel-playground-source Extra Packages for Enterprise Linux 8 - Playground - x86_64 - Source disabled epel-source Extra Packages for Enterprise Linux 8 - x86_64 - Source disabled epel-testing Extra Packages for Enterprise Linux 8 - Testing - x86_64 disabled epel-testing-debuginfo Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Debug disabled epel-testing-modular Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 disabled epel-testing-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Debug disabled epel-testing-modular-source Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Source disabled epel-testing-source Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Source disabled extras CentOS-8 - Extras disabled extras-source CentOS-8 - Extras Sources disabled fasttrack CentOS-8 - fasttrack disabled teams teams disabled teamviewer TeamViewer - x86_64 disabled SOLUTION Looks like I needed to enable my AppStream repo as I went one by one to different repos enabling and running the $yum install svn command. |
Sharing environment variables between zsh and bourne shell (for crontab) Posted: 25 Mar 2021 08:42 AM PDT I set JAVA_HOME in .zshrc: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ which is fine for interactive programs. But I have JVM programs running via cron, which uses Bourne shell. The bourne shell programs keep giving me this: groovy: JAVA_HOME is not defined correctly, can not execute: /usr/lib/jvm/default-java/bin/java What's the neatest way to solve this? I don't remember having to worry about this before. Currently I'm setting JAVA_HOME on every crontab entry which is burdensome and redundant. |
Debian 10 installation. Display resolution stuck at single default monitor 720x400 Posted: 25 Mar 2021 08:37 AM PDT Fresh install of Deb 10. ATI RADEON 3000 on board GPU I installed this with a really cheap/small AOC monitor via a VGA connect. I do not know if this had anything to do with my problem. I connected the PC to a TCL ROKU UHD TV via HDMI cable. I logged in and started GNOME. The resolution was like it was on the tiny console I did the install from. When I do xrandr : 720x400 0.00+ only is displayed. I have read, it feels like, every blog in this solar system. Tried all of the suggestions. I did go to GRUB command mode and listed all display capabilities and they were all in the output. I checked the driver level. Manually added another resolution and attempted to switch to it. It failed with "Max level is 720x400 0.00" I also get the famous "xrandr: Failed to get size of gamma for output default" message. Any assistance would be greatly appreciated. Best regards, Michael:D |
How do I fix this syntax error from awk in my shell script? Posted: 25 Mar 2021 08:57 AM PDT I have a script with two codes to pull the sum of data of a given file and print to another file and a second pulls the total number of missing data points to another file. Finally the two output files are placed together in to a third file. All three codes work when run alone. Due to the large number of files needing to have this done I was attempting to automate in a single script file. Running bash shell. The Colavg.sh file has been execute permissions. When I attempt to run this as a single script I get the following error: awk: cmd. line:1: ./Colavg.sh awk: cmd. line:1: ^ syntax error awk: cmd. line:1: ./Colavg.sh awk: cmd. line:1: ^ unterminated regexp #!/bin/awk awk -F ',' 'NF==4{count++} END {print "missing: "count}' County029-CO-0023-T0000JD.out > avg.out; awk -F ',' '$4==-999{c999++}; END{print "missing: "c999}' County029-CO-0023-T0000JD.out > avg1.out; cat avg1.out avg.out >> County029-CO-0023-T0000JD-avg.out |
Why I am asked for anohter account password when trying to mount a disk? Posted: 25 Mar 2021 09:32 AM PDT I am on Debian 10 Buster. When using Nautilus (aka Files), I am always asked for my password when trying to mount another HDD. All normal. A few days ago, I am not asked for my account password anymore, but for another account password. So, my main account is in the sudo group. I also have a second account named 'guest'. I am not sure what happened so now every time I try to mount a secondary HDD I am asked for the 'Guest' password instead of my main account password (where I am logged in). Any help? Thanks |
Keep a history of all the modifications to a text file Posted: 25 Mar 2021 09:44 AM PDT I have a plain text file (not containing source code). I often modify it (adding lines, editing existing lines, or any other possible modification). For any modification, I would like to automatically record: - what has been modified (the diff information);
- the date and time of the modification.
(Ideally, I would also like to be able to obtain the version of my file at a specific time, but this is a plus, not essential). This is surely possible with Git, but it's too powerful and complex. I don't want to deal with add , commit messages, push , etc. each time. I would simply like to edit the file with vi (or equivalent), save it, and automatically record the modification as above (its diff and its time). Is there a tool to accomplish this in Linux? Update: Thanks for all the suggestions and the several solutions that have been introduced. I have nothing against git , but I explicitly wished to avoid it (for several reason, last but not least the fact that I don't know it enough). The tool which is closest to the above requirements (no git , no commit messages, little or nothing overhead) is RCS. It is file-based and it is exactly what I was looking for. This even avoids the use of a script, provides the previous versions of the file and avoids the customization for vi . The requirements of the question were precise; many opinions have been given, but the question is not - per se - that much opinion-based. Then, obviously, the same goal can be achieved through a tool or through a script, but this apply in many other cases as well. |
Running netstat on 2 servers checking connections to the other one shows mismatch in number of connections Posted: 25 Mar 2021 09:20 AM PDT If I check how many connections serverA (192.168.1.1) has open to serverB (192.168.2.1), I get the following response: [username@serverA ~] $ netstat -n | grep 192.168.2.1 tcp 0 0 192.168.1.1:51846 192.168.2.1:10001 ESTABLISHED tcp 0 0 192.168.1.1:50872 192.168.2.1:10001 ESTABLISHED tcp 0 0 192.168.1.1:51824 192.168.2.1:10001 ESTABLISHED tcp 0 0 192.168.1.1:51848 192.168.2.1:10001 ESTABLISHED [username@serverA ~] $ netstat -n | grep 10.79.165.145 | wc -l 4 However, if I do the opposite and check on serverB how many connections it has open to serverA, I get this: [username@serverB ~] $ netstat -n | grep 192.168.1.1 tcp 0 0 192.168.2.1:10001 192.168.1.1:51846 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:55122 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:59930 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:50352 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:44142 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:57698 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:38268 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:41822 ESTABLISHED ... many more connections ... tcp 0 0 192.168.2.1:10001 192.168.1.1:43840 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:50870 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:34100 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:34620 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:41126 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:49298 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:50004 ESTABLISHED tcp 0 0 192.168.2.1:10001 192.168.1.1:51408 ESTABLISHED [username@serverB ~] $ netstat -n | grep 192.168.1.1 | wc -l 104 I was not expecting there to be a mismatch in the number of the connections between the 2 servers, essentially serverB thinks there are a lot more connections open to serverA and than that serverA does to serverB. These servers are on different VLANs and the connections do go through a firewall. Both serverA and serverB are RHEL v7 VMs running on ESXI. They don't run any containers or anything that would do NAT. What could be responsible for the mismatch in open connection numbers |
Notepad++, installed through snap install, has a menu bar with very small letters Posted: 25 Mar 2021 08:36 AM PDT I have installed notepad++ using a snap command under my GNOME session on Debian 10 . sudo snap install notepad-plus-plus It works fine, except that its menu bar has a font that is too small. Other applications ran on my session have a menu bar font that is two points higher. It is also normal if I install Notepad++ on a Windows system. Do I have a way to correct this displaying ? Does either snap , notepad++ or the underlying wine (? I don't know, if it's the case, here ?), lacking something in their installations ? |
EACCES: permission denied when using sudo Posted: 25 Mar 2021 08:33 AM PDT I'm trying to install a node package using NPM, but it just gives a permission error. I could install packages without any issues yesterday, but for some reason it has stopped working. asgeir@1e19udt0shu6:~/nodejs/first_test_app$ sudo npm install sharp > sharp@0.22.1 install /home/asgeir/nodejs/first_test_app/node_modules/sharp > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz ERR! sharp EACCES: permission denied, open '/home/asgeir/nodejs/first_test_app/node_modules/sharp/9016-libvips-8.7.4-linux-x64.tar.gz' info sharp Attempting to build from source via node-gyp but this may fail due to the above error info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/asgeir/nodejs/first_test_app/node_modules/sharp/build' gyp ERR! System Linux 2.6.32-042stab133.2 gyp ERR! command "/usr/local/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/asgeir/nodejs/first_test_app/node_modules/sharp gyp ERR! node -v v10.16.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN first_test_app@1.0.0 No repository field. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sharp@0.22.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/asgeir/.npm/_logs/2019-07-17T06_16_33_097Z-debug.log After a bit of googling, I found some fellow pour souls who ran in to the same error. They apparently got it working by re-installing NPM and NodeJS, but I didn't have any success with that. Any ideas on how to get past this error? |
ALT + TAB Doesn't Work (Linux Mint MATE) Posted: 25 Mar 2021 08:04 AM PDT Somehow (I have no idea how) I broke my ALT + TAB functionality. I'm using Linux Mint (MATE edition), and when I press ALT + TAB instead of switching to another application it very briefly shows the desktop, then returns me back to the application I was on. I've tried enabling and disabling both the "Application Switcher" and "Static Application Switcher" in the CompizConfig, but neither has any effect. Even if both are disabled, I still get the same "briefly show the desktop then return to the original app" behavior. This made me think that I somehow had rebound my ALT + TAB keybinding, but when I go to Keyboard Shortcuts it does show "Move between windows, using a popup window" set to ALT + TAB . If I change it (eg. to CTRL + ALT + A ) the "show desktop briefly" behavior goes away ... unless I then do CTRL + ALT + A , in which case that behavior returns. So in summary: - I have a keybinding for
ALT + TAB to "Move between windows, using a popup window", and this binding appears to trigger the "show desktop briefly" behavior even if I change it to a different binding - I previously had "Static Application Switcher" enabled in CompizConfig, but whether I enable it, "Application Switcher", or none of the above, I see the same behavior
Thus, it seems I've somehow actually broken the "Move between windows, using a popup window" functionality, completely independent of Compiz ... and I have no idea how I can restore it. Does anyone have any suggestions? |
Evolution with GnuPG: `no imported public key` even if it is imported Posted: 25 Mar 2021 09:26 AM PDT I was running Evolution on Debian buster (testing) amd64 with GnuPG to encrypt mails. I have my GPG private key on a YubiKey actings as GPG smartcard. As Evolution somehow failed to load my calendars using CalDAV, I resetted Evolution. CalDAV is working fine now. But after the reset another issue appeared: GPG encrypting/signing isn't working anymore. Mails are decrypted without problems. Furthermore, I can not choose my own GPG key in the account's settings, even if it is imported properly and gets listed in gpg -K : I'm now able to choose my key. When I try to send an encryoted mail this fails with Evolution showing the following error: Could not create message. You may need to select different mail options. Detailed error: Failed to encrypt: Invalid recipient <my@mail.address> specified. A common issue is that the gpg2 doesn't have imported public key for this recipient. But my public key is imported. The same thing happens when I disable the option Always encrypt to myself when sending encrypted messages with this account . The error then is: Detailed error: Failed to encrypt: Invalid recipient <recipients@mail.address> specified. A common issue is that the gpg2 doesn't have imported public key for this recipient. Encrypting/signing from command line with the gpg command works fine. Using a private key which is not on a smartcard also did not work. Resetting both GPG and Evolution did not work. I don't have any idea now what I should do now. Thank you all in advance :) EDIT: output of strace -p $(pidof evolution) -f -e trace=execve when decrypting (works fine): [pid 4613] execve("/usr/local/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--status-fd=66", "--command-fd=67", "--verify-options", "show-photos", "--photo-viewer", "/usr/lib/evolution/camel-gpg-pho"..., "--decrypt", "--output", "-"], [/* 34 vars */]) = -1 ENOENT (No such file or directory) [pid 4613] execve("/usr/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--status-fd=66", "--command-fd=67", "--verify-options", "show-photos", "--photo-viewer", "/usr/lib/evolution/camel-gpg-pho"..., "--decrypt", "--output", "-"], [/* 34 vars */]) = 0 When encrypting (which fails): [pid 4537] execve("/usr/local/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--batch", "--yes", "--status-fd=67", "--encrypt", "--armor", "-u", "my@mail.address", "-r", "<recipients@mail.address>", "--output", "-"], [/* 34 vars */]) = -1 ENOENT (No such file or directory) [pid 4537] execve("/usr/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--batch", "--yes", "--status-fd=67", "--encrypt", "--armor", "-u", "my@mail.address", "-r", "<recipients@mail.address>", "--output", "-"], [/* 34 vars */]) = 0 The file /usr/local/bin/gpg2 doesn't exist and seems not to be part of any Debian package. EDIT2: The command @Hauke Laging posted in the comments works, but I interactively needed to confirm to execute the action (as it also was when I manually encrypted using the command line): echo foo | /usr/bin/gpg2 --status-fd=1 --encrypt --armor -u my@mail.address -r recipients@mail.address --output - While the command which Evolution wants to execute fails (I removed the <> as that causes issues with zsh): ➜ ~ gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=67 --encrypt --armor -u my@mail.address -r recipients@mail.address --output gpg: Fatal: status-fd is invalid: Bad file descriptor Setting --status-fd=1 still fails, but with different errors: ➜ ~ echo "foo" | gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=1 --encrypt --armor -u my@mail.address -r recipients@mail.address --output - [GNUPG:] KEY_CONSIDERED <recipient's key fingerprint> 0 gpg: using pgp trust model gpg: using subkey <recipient's encryption subkey id> instead of primary key <recipient's primary key id> [GNUPG:] KEY_CONSIDERED <recipient's key fingerprint> 0 gpg: automatically retrieved 'recipients@mail.address' via Local gpg: <recipient's encryption subkey id>: There is no assurance this key belongs to the named user [GNUPG:] INV_RECP 10 recipients@mail.address [GNUPG:] FAILURE encrypt 53 gpg: [stdin]: encryption failed: Unusable public key EDIT3: Just tested: signing messages from Evolution works as well as decrypting. When I manually encrypt a message using the command line, I get the following message which I think causes this issue: ➜ ~ echo "foo" | gpg --encrypt -r recipients@mail.address --armor gpg: automatically retrieved 'recipients@mail.address' via Local gpg: <recipient's encryption subkey id>: There is no assurance this key belongs to the named user sub rsa4096/<recipient's encryption subkey id> 2015-10-14 Recipient's Name <recipients@mail.address> Primary key fingerprint: <recipient's key fingerprint> Subkey fingerprint: <recipient's encryption subkey fingerprint> It is NOT certain that the key belongs to the person named in the user ID. If you *really* know what you are doing, you may answer the next question with yes. Use this key anyway? (y/N) y -----BEGIN PGP MESSAGE----- [...] -----END PGP MESSAGE----- EDIT4: As the message above is caused by missing ownertrust (at least I think so), I'd like to set the recipient's ownertrust using gpg --edit-key (which was not set before): gpg> trust pub rsa4096/<some key id> created: <some date in the past> expires: <some date in the future> usage: SCA trust: unknown validity: unknown sub rsa4096/<some other key id> created: <some date in the past> expires: <some date in the future> usage: E [ unknown] (1). Pecipient's Name <recipients@mail.address> Please decide how far you trust this user to correctly verify other users' keys (by looking at passports, checking fingerprints from different sources, etc.) 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 3 pub rsa4096/<some key id> created: <some date in the past> expires: <some date in the future> usage: SCA trust: marginal validity: unknown sub rsa4096/<some other key id> created: <some date in the past> expires: <some date in the future> usage: E [ unknown] (1). Pecipient's Name <recipients@mail.address> So I set the recipient's ownertrust, but why is there still this [ unknown] at the end? |
Installing a .rpm package on a Unix VM - root unable to see the file Posted: 25 Mar 2021 09:07 AM PDT I am working on an AngularJS app, and want to get Protractor up and running with it, to use for testing the front end user interaction automatically. The way my development environment is set up, is that I am doing the front-end development on my local Windows desktop, and running grunt on a CentOS 7 VM to serve the front-end of the application. I have used Unix systems a bit in the past, but predominantly just for a couple of modules I took at university a few years ago, so don't have that much experience with them. When I joined this company, I started working with the practises that they already had in place. Day-to-day, my use of the Unix VM is simply: - Start it up
- Open a couple of terminals
- Become root (
su - ) - Run python (
python3.4 -m myApp start ) - Run
grunt serve from the appropriate location, to serve the front end I am following the tutorial at: http://www.protractortest.org/#/tutorial to try and get Protractor up and running to use it as a testing framework within my development environment, and have done the first couple of steps of the setup without any problems: npm install -g protractor webdriver-manager update When I then try to run the next command: webdriver-manager start , I get an error that says: 'java' is not recognized as an internal or external command, operable program or batch file. [11:24:04] I/start - Selenium Standalone has exited with code 1 I assume that this means that Java is not installed on the VM, and will need to be in order to run the command webdriver-manager start ? I downloaded the JRE for linux x64 (.rpm file) from Oracle, and copied it to the desktop of my VM. I am now following the instructions at Linux Java installation to install Java on the VM, but am having a bit of trouble doing so... I have followed the steps: - Become root
- Change to the directory in which you want to install
- Install the package: `rpm -ivh jre-8u144-linux-x64.rpm
but when I run this last command, to install the package, the console shows an error that says: open of jre-8u144-linux-x64.rpm failed: No such file or directory If I run ls from the terminal where I am logged in as root , I can't see any of the files on the Desktop (which is my current location), but if I run ls from another terminal where I'm not logged in as root , I can see all of the files on the desktop, including the jre-8u144-linux-x64.rpm file that I'm trying to install... So why is it that the root user can't see the .rpm file that I want to install, even though the 'normal' user can...? I tried installing the JRE from the 'normal' user by running the command in that terminal, but obviously got an error stating that I didn't have the permissions to do this: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied) How can I install the JRE that I need in order to use this testing framework on my VM? |
How to use a special character as a normal one in Unix shells? Posted: 25 Mar 2021 09:26 AM PDT Many questions like 'How to type the double-quote char (")?' are being asked, and we don't want to clutter our community with the same answer (Type it as \" if not enclosed in ' s, " if enclosed in ' s.) So, the question is here. You can't type special chars into a terminal like normal ones, e.g. this command will fail: echo Updates (11) So, how to type in these chars in the terminal as if they were normal ones? !#$^&*?[](){}<>~;'"\|<space><tab><newline> |
How does awk '!a[$0]++' work? Posted: 25 Mar 2021 07:38 AM PDT This one-liner removes duplicate lines from text input without pre-sorting. For example: $ cat >f q w e w r $ awk '!a[$0]++' <f q w e r $ The original code I have found on the internets read: awk '!_[$0]++' This was even more perplexing to me as I took _ to have a special meaning in awk, like in Perl, but it turned out to be just a name of an array. Now, I understand the logic behind the one-liner: each input line is used as a key in a hash array, thus, upon completion, the hash contains unique lines in the order of arrival. What I would like to learn is how exactly this notation is interpreted by awk. E.g. what the bang sign (! ) means and the other elements of this code snippet. How does it work? |
Vim - how to increase each number in visual block? Posted: 25 Mar 2021 08:54 AM PDT I have the following SQL: update am.PERMISSIONS set PRM_ORDER = 35 PRM_VISIBLE = b'1' where PRM_ID = 3; update am.PERMISSIONS set PRM_ORDER = [35] PRM_VISIBLE = b'1' where PRM_ID = 7; update am.PERMISSIONS set PRM_ORDER = [40] PRM_VISIBLE = b'1' where PRM_ID = 10; update am.PERMISSIONS set PRM_ORDER = [45] PRM_VISIBLE = b'1' where PRM_ID = 11; ... with square brackets I select the visual block, where i want to increase each number by 5. How do I do this? |
Some Ossec agents not able to communicate with OSSEC server Posted: 25 Mar 2021 09:37 AM PDT I have installed Ossec on one server and agents on some other servers running on Redhat. The issue is that some servers are able to communicate and send the logs to servers and others are in INACTIVE state even though I have imported the security keys. 2013/02/23 15:34:34 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1'. 2013/02/23 15:38:30 ossec-agentd: INFO: Trying to connect to server (192.168.109.1:1514). 2013/02/23 15:38:30 ossec-agentd: INFO: Using IPv4 for: 192.168.109.1 . 2013/02/23 15:38:51 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1'. 2013/02/23 15:43:05 ossec-agentd: INFO: Trying to connect to server (192.168.109.1:1514). 2013/02/23 15:43:05 ossec-agentd: INFO: Using IPv4 for: 192.168.109.1 . 2013/02/23 15:43:26 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1'. 2013/02/23 15:47:58 ossec-agentd: INFO: Trying to connect to server (192.168.109.1:1514). 2013/02/23 15:47:58 ossec-agentd: INFO: Using IPv4 for: 192.168.109.1 . 2013/02/23 15:48:19 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1'. 2013/02/23 15:53:09 ossec-agentd: INFO: Trying to connect to server (192.168.109.1:1514). 2013/02/23 15:53:09 ossec-agentd: INFO: Using IPv4 for: 192.168.109.1 . 2013/02/23 15:53:30 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1'. 2013/02/23 15:58:38 ossec-agentd: INFO: Trying to connect to server (192.168.109.1:1514). 2013/02/23 15:58:38 ossec-agentd: INFO: Using IPv4 for: 192.168.109.1 . 2013/02/23 15:58:59 ossec-agentd(4101): WARN: Waiting for server reply (not started). Tried: '192.168.109.1' And I checked with Security team and they said that there is a firewall between Host and agents. And they have enabled port 514 UDP on server. But still agents not able to communicate with server Netstat output [emerg@Monit ~]$ netstat -panu (No info could be read for "-p": geteuid()=1344 but you should be root.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name udp 0 0 0.0.0.0:32769 0.0.0.0:* - udp 0 0 0.0.0.0:514 0.0.0.0:* - udp 0 0 0.0.0.0:10000 0.0.0.0:* - udp 0 0 0.0.0.0:657 0.0.0.0:* - udp 0 0 0.0.0.0:660 0.0.0.0:* - udp 0 0 0.0.0.0:5353 0.0.0.0:* - udp 0 0 0.0.0.0:1514 0.0.0.0:* - udp 0 0 0.0.0.0:111 0.0.0.0:* - udp 0 0 0.0.0.0:631 0.0.0.0:* - udp 0 0 10.1.1.109:123 0.0.0.0:* - udp 0 0 192.168.109.1:123 0.0.0.0:* - udp 0 0 127.0.0.1:123 0.0.0.0:* - udp 0 0 0.0.0.0:123 0.0.0.0:* - udp 0 0 :::32771 :::* - udp 0 0 :::5353 :::* - udp 0 0 fe80::21e:c9ff:fee0:123 :::* - udp 0 0 fe80::21e:c9ff:fee0:123 :::* - udp 0 0 ::1:123 :::* - udp 0 0 :::123 :::* Contents of Ossec.conf from Ossec HIDS Server <ossec_config> <global> <email_notification>yes</email_notification> <email_to>systems@advancedoperations.com</email_to> <smtp_server>10.171.1.10</smtp_server> <email_from>ossec.osl@advancedoperations.com</email_from> </global> <rules> <include>rules_config.xml</include> <include>pam_rules.xml</include> <include>sshd_rules.xml</include> <include>telnetd_rules.xml</include> <include>syslog_rules.xml</include> <include>arpwatch_rules.xml</include> <include>symantec-av_rules.xml</include> <include>symantec-ws_rules.xml</include> <include>pix_rules.xml</include> <include>named_rules.xml</include> <include>smbd_rules.xml</include> <include>vsftpd_rules.xml</include> <include>pure-ftpd_rules.xml</include> <include>proftpd_rules.xml</include> <include>ms_ftpd_rules.xml</include> <include>ftpd_rules.xml</include> <include>hordeimp_rules.xml</include> <include>roundcube_rules.xml</include> <include>wordpress_rules.xml</include> <include>vpopmail_rules.xml</include> <include>vmpop3d_rules.xml</include> <include>courier_rules.xml</include> <include>web_rules.xml</include> <include>apache_rules.xml</include> "ossec.conf" 162L, 5585C Firewall rule 13M 3734M ACCEPT udp -- * * 0.0.0.0/0 192.168.9.1 multiport dports 123,514 |
No comments:
Post a Comment