Tag Info

Hot answers tagged

3

I see two options. One, he can use tail -f to see the log file as it's being written, or two, he can have the program start inside a screen (or similar) session to which he can (re-)attach later. If he doesn't know the location of the log file, he can use top, ps or a similar tool to find the process ID, then run lsof -p1234 where 1234 is the process id to ...


3

Using awk and an associative array keyed on the first two columns: awk -F : '{ sum[$1 FS $2] += $3; }; END { OFS=FS; for (key in sum) print key, sum[key]; }' file


3

You can try to use the wall program, but the logged in users may be able to override that and avoid seeing any wall messages. Alternately, you can attempt configure and use syslog to send a message from a given facility to the * location, which (in my experience) will show up on all logged in shells.


3

You will have to download and install OpenBLAS. Download latest stable version from https://github.com/xianyi/OpenBLAS/zipball/master. Extract and run make and make install. You will need gfortran to compile. Make sure you have numpy installed as well, you should be able to install that from an archive.


2

You can download the source for python-2.7.10 from the python.org site. Once you extract .tar.xz archive you will find the Include directory that contains the missing missing header files. You can tell python setup.py ... to look in this directory as well by setting export CPLUS_INCLUDE_PATH=/path/to/your/extracted/Python-2.7.10/Include


2

You will need to install pip before you can use it to install youtube-dl. First install pip: sudo apt-get install python-pip Then install youtube-dl: sudo pip install youtube-dl


2

This example assumes, all the csv contents are lying in a file named a.csv...you can change it to use stdout stream instead of file stream and out of laziness, i put longitude, latitude as sub-elements.. you can put them as attributes as well from xml.etree.ElementTree import Element, SubElement, Comment, tostring top = Element('markers') f = ...


1

In a very simplistic way: you can look at all the pseudo-ttys in use and write to all of them. Use who to list all the current logins and their tty, eg: $ who me tty1 Jun 1 07:09 brian pts/0 Jun 1 07:15 (:pc1) john pts/1 Jun 1 07:15 (:pc88) sue pts/2 Jun 1 07:15 (:pc7) The 2nd column shows e.g. /dev/pts/0 ...


1

I personally prefer using less to do this same thing. less your_file After starting less, the F command (not a command line flag) will begin to actively monitor the end of the file. While watching the end of the file in this mode CTRL-c will stop appending output to less and allow you to page around. Very handy.


1

You can wrap your python daemon in a shell script. When you first initiate, check if the process is already running: pid=$(cat pid.file) ps -ef | grep $pid | grep <command to start daemon> if [[ $? -eq 0 ]]; then echo "daemon already running" & exit 1 else <command to start daemon> & \ echo $! > pid.file fi


1

The short answer is uninstall from the package sudo apt-get remove bpython and install via pip: sudo pip install bpython. I think what's going on is that the bpython package assumes python 2.7 in /usr/bin/python, but from the traceback, your /usr/bin/python seems to be python3. To verify try running /usr/bin/python -V to see the version and compare with ...


1

You can just start the example.py with the full path to example-env/bin/python2. Alternatively change the shebang line of the example.py to use that executable, make that file executable (chmod +x example.py) and leave out python and use the full path to example.py to start it: #!/full/path/to/example-env/bin/python2


1

Try use sshtunnel lib. Example: from sshtunnel import SSHTunnelForwarder from time import sleep with SSHTunnelForwarder( ('localhost', 2222), ssh_username="vagrant", ssh_password="vagrant", remote_bind_address=('127.0.0.1', 3306)) as server: print(server.local_bind_port) while True: # press Ctrl-C for stopping ...


1

Another alternative is jq: $ cat members.json | jq -r '.hits|.hits|.[]|._source|.memberId' 0x7b93910446f91928e23e1043dfdf5bcf 0x7b93910446f91928e23e1043dfdf5bcG


1

I strongly suggest, you read a basic Makefile tutorial. What you basically want, is putting your paths in macros, which in those instances work similar to variables. for instance DIR=/your/path. Be aware, that directives look like this: directive: command if your directive is named default or all it'll get executed without explicitly calling ...


1

In python you get the commandline parameters from sys.argv so instead of #!/usr/bin/env python base_dir = /hard/coded/path you do: #!/usr/bin/env python import sys base_dir = sys.argv[1] (putting in checks might be appropriate). If you explicitly start the program with python, you can leave out the first line, but it won't hurt to be there in case you ...


1

That's because: python performs output buffering if redirected to a pipe or a file. http.server writes the first line to stdout then access logs to stderr. You need to do like: exec 3< <(python3 -u -m http.server 2>&1) Speaking about your goal, I suppose the script needs to continue reading from the pipe even after it's gotten that ...


1

for everyone else with the same problem: the line "scripts" in my setup.py-file was the bad-guy. removing this line and configuring the install-file in debian-folder is the right way to install your app where ever you want. setup(name="myapp", version="0.80.04", description='My Appicantion.', author='ajava', ...


1

To expand on user1794469's converted comment, since Kali is based on Debian, you can add a PPA containing a newer version of python. Follow these steps: sudo apt-get install -y python-software-properties sudo add-apt-repository -y ppa:fkrull/deadsnakes sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install -y python3.3 ...



Only top voted, non community-wiki answers of a minimum length are eligible