I have compiled python sources with the –prefix option. After running make install the binaries are copied to a folder of my account’s home directory. I needed to rename this folder but when I use pip after the renaming it says that it can’t find the python interpreter. It shows an absolute …
TCP client cannot connect to TCP server
I have configured a Raspberry Pi to be client, and my personal computer to be TCP server, and trying to connect to server via an ethernet cable. On my personal computer I use Comm Operator and select port “1234”. Raspberry Pi (TCP client) has following setup: Raspberry Pi (TCP client) has the foll…
root.query_pointer()._data causes high CPU usage
I’m a total noob in Python, programming and Linux. I wrote a simple python script to track usage time of various apps. I’ve noticed that after some time python is going nuts utilizing 100% of the CPU. Turns out it’s the code obtaining mouse position is causing issues. I’ve tried runnin…
Using crontab in linux to display a message everytime you open terminal?
I want to display message in terminal: “Welcome!” when someone opens the terminal Answer To print a message when opening a terminal (or logging in via ssh) you should use the message of the day (/etc/motd). You could use cron to overwrite this file at specific times, and so users will see the curr…
Match Anything In Between Strings For Linux Grep Command
I have read the post grep all characters including newline but I not working with XML so it’s a bit different with my Linux command. I have the following data: Using this command cat file.txt | grep -o ‘<tag.*tag>|^–.*’ I get: However, I want the output to be: How can I match any…
Check if any file in a directory contains words in a constant file
i have a directory with n textfiles. Now, i want to check, if any of these files contains one (or more) words of a constant file. These files are all dictionarys with a different amount of words. The constant file is a password list, where i want to check these words. The amount of correct hits should be save…
Error handling of user information in Unix
I need to do some error handling in the beginning of a script. If a user is not a member of a specific group then the script needs to exit. Answer or shorter:
Running a program in linux (debian) on startup
I would like to point out that I tried A LOT of different tutorials from the internet but they don’t seem to work… Adding stuff to init.d, rc.local etc. for some reason it doesn’t work. I’m really desperate to get this done, but I’m a total noob when it comes to linux. when I typ…
How to use cut and paste commands as a single line command?
In Unix, I am trying to write a sequence of cut and paste commands (saving result of each command in a file) that inverts every name in the file(below) shortlist and places a coma after the last name(for example, bill johnson becomes johnson, bill). here is my file shortlist: I am able to cut from shortlist b…
How to exit from shell script if any of the command in SSH returns non-zero value
I have a shell script with below ssh command to perform few actions, Directory $remoteLocation/yyy is not available and it will display the error as, ./test.sh: line 6: cd: /opt/test/yyy: No such file or directory and it is proceeding to the next line. My scenario is to exit from the shell script itself if an…