Newest python Questions

Q&A for system and network administrators

Showing index of / without www, works normal with www

I'm working with Python, Flask and Apache, and i'm stuck. when i try to visit mywebsite using www, it works fine. however, when i remove the www, the website is showing "index of /" with an empty list ...

uWSGI scripts - not writing to file

I've recently installed uWSGI on a Ubuntu/nginx server (which I found quite challenging, but that's by the way). I've taken a simple hello world script and verified that it works as expected. I've ...

postfix connection to python-libmilter test-milter

From the python-libmilter I am trying to run the test milter. The milter is listening (I can connect via telnet to localhost 5000) I enabled the milter in the postfix config: milter_protocol = 6 ...

Fedora 23 and 24 surprisingly slow with Numpy dot and other functions

This question was initially asked on stackoverflow byt was found to be off-topic, the text below has been updated from the initial post with new details. I recently acquired a new PC with an i7 ...

How upgrade version pip by proxy?

for my task need install pywin32 pack. Python can install new pack only by proxy. pip --proxy http://<username>:<password>@<hostname>:<port> install pywin32 But installing ...

syslog-ng does not recognize “python” keyword

I'm trying to use Syslog-ng so that it forwards the messages to a python destination. However, I keep getting a "Error parsing destination, destination plugin python not found ..." message. I am ...

Broken Link Finder [closed]

I have a txt file which includes thousands of links like following: http://dl.example.com/some/directory/file.zip http://dl.example.com/something/file.mp4 ... All of those links are stored in a text ...

Can this work as a Containerized Architecture for a Django/NGINX/MongoDB Web App?

I am attempting to build a reliable web App using Django and Nginx. This web app is simple in design, will be built with an MVC styled design, and needs to be secure, yet speedy. The question is ...

ModSecurity: Warning. Operator EQ matched 0 at REQUEST_HEADERS

im running a python/django website on apache and modwsgi i've been looking trough my error log and i have tons of this( i had to delete bunch of them in the middle becuz of posting limitation ) [...

Sentry client doesn’t log on AWS ElasticBeanstalk (Flask)

Update: turns out my code was written in a wrong way (two flask apps, 2nd one was hijacking the logger without having Sentry attached to it). This question will be deleted once bounty is closed. I've ...

Cloud SQL periodic issues connecting OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected')

Periodically connection attempts to the 2nd Gen MySQL server receives this error: OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected') This will ...

Set status to warning when update was not received for set time in Shinken

I am currently in a process of setting up monitoring with Shinken. For some of the checks, I am using webservice module to receive incoming status updates. However, what happens when the last update ...

convert curl post to rest api to python [migrated]

I have this curl command: curl -X POST -s -k -u "admin:Password" -d ' { "add_content": { "errata_ids": ["RHSA-2016:2124","RHBA-2016:2889"] }, "content_view_version_environments": [{ "...

UWSGI worker burried - uwsgi + python + flask

I am new to server configuration and trying to deploy a web-app using NGINX + uWSGI and python. In the starting i was able to run it properly. But from yesterday i started getting this error of worker ...

Duplicity 0.7.10 fails after upgrading librsync in Ubuntu 14.04

I've spent a few hours trying to configure Duplicity to perform automated remote backups to a Google Drive. At this point, it's safe to say that I'm in my own private dependency hell. Using the ...

ImportError: No module named site. On CentOS 7 + python3.5

I'm trying to setup server few days in a row with no luck, I checked all the related topics and didn't find solution for the problem. I'm using CentOS 7, mod_wsgi, apache, python3.5 under ...

Make Pythonanywhere web server act like Django's built in server

Django's built in server updates apps in real time. In PythonAnywhere one has to reload manually. Is there a way to make PythonAnywhere web server act like the built in feature of Django?

YUM not working in CENTOS 7 after installing httpd

I just installed CENTOS 7 on my vmware. After YUM update everything worked fine for sometime then system suddenly crashed and asked me to Logout. In console in tried to yum update but it showed ...

Django 1.10.3 Apache wsgi - ImportError: cannot import name signals

Overnight django stopped working, possibly because of an automatic package upgrade on the server. Its wsgi script now fails to load in production, but running the development server works fine. What ...

SaltStack: How to implement custom Jinja Filter?

I want to extend the jinja filters which are avaiable in SaltStack I want to create a simple filter called rpm_to_debian_name { package-name | rpm_to_debian_name } I only found docs about the salt ...

Is there any way to start mongo-connector in linux as a background process?

I am using mongo-connector to synchronize data between MongoDB and SOLR. I am working in RedHat 7 OS Server, I wanted to run the mongo-connector command as fork process in Server OS, since i need a ...

In setting up a Django host, migrate.py often fails to create a .sock file

I am learning to use Django on Nginx. To set up a new host at sitename.com I do: ~$ mkvirtualenv sitename ~$ pip install Django ~$ django-admin.py startproject sitename ~$ cd sitename ~$ ./manage.py ...

How do I get EasyApache4 to use Python 2.7 when building mod_wsgi? [closed]

I have a dedicated server running Centos 6.8. I have installed Python2.7 via the SCL interface, but I cannot configure EasyApache4 to use Python2.7 to build and run the mod_wsgi Apache module. It uses ...

Packet fragmentation confusion

I was playing around with dpkt in Python, trying to decode PPPoE - and the program was working just fine, till I noticed that the Offset in the encapsulation IP packets was always 0, even with clearly ...

Error connecting to mysql fabric via python script [duplicate]

I have three VMs running on Windows Azure. Two VMs running mysql database, the third VM running mysql fabric node. When I tried to use python connector to connect to fabric node, this problem happens: ...

Arch Nginx Uwsgi no app loaded

I am trying to get django working but uwsgi is having problems loading anything. Most likely do to my ignorance. I would love some help troulble shooting. I have been looking at similar posts on the ...

QGIS-Server Plugin Process per client (WMS, Apache2, FCGI)

I have a working infrastructure containing Apache2 with FCGI and QGIS-Server bundled in a Docker Container to deliver a WMS. My written Plugin (Python) for QGIS-Server is working like expected. It ...

rsync-path: No such file or directory when used with subprocess.Popen

I use rsync to deploy code from one server to another. On a staging directory I build the application by placing all files (e.g. php scripts) like they should appear on the remote application server (...

Reducing gunicorn CPU usage on tiny requests

I'm writing an event aggregation server in Python, using Nginx + Gunicorn. The system scales to about 300 rps before the CPU maxes out on a 1 cpu/2 core box (AWS c4.large). Adding an additional ...

I can't install pip for python 3.5 [migrated]

My friend owns a Raspberry Pi, and no matter what we try to do we cannot get pip3 installed for python 3.5. We've tried get-pip.py, but that only works for 2.7. We've tried sudo pip install -U pip, ...

Upload to S3 bucket slows over time

I'm part way through uploading about 200,000 files (each is ~1MB max) to an S3 bucket from an EC2 instance (both in Europe West). From monitoring the EC2 with CloudWatch (looking at the NetworkOut ...

How to configure Apache2 to use Python on a Ubuntu Linode machine

I have installed Apache2 and Python on a new Linode machine running Ubuntu. I installed the Python mod with: sudo apt-get install libapache2-mod-python I added this to my /etc/apache2/apache2.conf ...

Restarting nginx&gunicorn without sudo

Can I run systemctl restart gunicorn && systemctl restart nginx without sudo? Currently I get: out: Authentication is required to reload 'gunicorn.service'. out: Authenticating as: ...

Python hangs while importing module under Lustre filesystem

I am noticing that my python script is getting stuck while importing simple modules within lustre filesystem of the cluster that I run on. This is reproduced by the following simple example: main.py ...

Syslog-ng Sending to Python Program

I have the need to send specific syslog messages to a Python script to do LDAP lookups. The script works fine with I do "cat /tmp/input.log | python /usr/local/bin/ldap_lookup.py" but it's not working ...

Systemd : Run a Python Script At Startup (virtualenv)

I have a python script that I normally run it with this command: (environment) python run.py I want to run this script at start. (I'm using ubuntu) Here is my service: [Unit] Description=My Script ...

Where to store the Python virtualenv of a system-wide installed application

You're deploying a Python application that uses its own virtualenv with libraries different from the system installed libraries, and you need to install those libraries the best way possible. I ask ...

Adding CentOS 6.8 Client to Spacewalk

I'm trying to add a CentOS 6.8 client to Spacewalk 2.6 to I can push out updates. In order to add the client I need to first install some packages: rhn-client-tools rhn-check rhn-setup rhnsd m2crypto ...

deploy Django 1.10 project with Python 3.5 to Azure

just wanna know if I can deploy Django 1.10 project with Python 3.5 to Azure Cloud? I mean, I do not develop it using Visual Studio but only text editor (Atom or Sublime),,thank you

Hadoop Streaming with Python 3.5: java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127

I'm trying to run my own mapper and reducer Python scripts using Hadoop Streaming on my cluster built on VMware Workstation VMs. Hadoop version - 2.7, Python - 3.5, OS - CentOS 7.2 on all the VMs. I ...

python - How to deploy Flask+Gunicorn+Nginx+supervisor on a cloud server?

I've read a lot of instructions since yesterday about this issue but all of them have similar steps. However I followed step by step but still can't get everything Ok. Actually I can make Flask+...

Why is posix.lstat taking such a long time? (duplicity backing up of 9p virtio filesystem)

I have a filesystem mounted with 9p virtio through KVM, and am backing it up using duplicity to a remote SSH server. I' m trying to speed up the backup process, which seems unreasonably slow to me. ...

why yum could not find the python-pip packages on some PCs

I got a very strange problem and cannot figure out why. When I run yum info python-pip command on some CentOS 7 machines, it returns Error: No matching Packages to list. But, I used to install python-...

Installing mod_wsgi & python2.7 - issue can't make mod_wsgi

I followed this tutorial to install python2.7 and mod_wsgi on my VPS when getting to Install mod_wsgi (this module will work only with python 2.7) I got this error while make && make ...

Nginx uWSGI responses truncated

I tried to write a web service as a joke today at http://dont-tread-on-memes.controversial.io. It's a flask app that serves fairly large images. The Flask app works well on its own, as does an ...

Crontab not executing python script [duplicate]

I have this root cronjob: # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be ...

python selenium webdriver set proxy for IE

I have the following python code for accessing a webpage (http://google.com). I am not able to understand on how to add a proxy to the following code and make it work. My Python Code without proxy ...

Dependencies on ubuntu 16.04 for pylibemu

I'm currently trying to install https://github.com/buffer/pylibemu on a fresh install of UBUNTU 16.04 and keep getting this error below. I've tried many things and it's still have not been able to get ...

Not seeing logs for program managed by systemd

I'm using systemd to manage a program on Ubuntu 16. I can't seem to get the logs from the program to output to journalctl or /var/log/syslog. The journald configuration is the default, which should ...

Apache wsgi python errro log full of [wsgi:error] withtout explanation

I've a server running django with mod-wsgi checking my apache error log i see an entry for every page hit on the server. Everything works fine the error log is full of messages like this: [Sat Dec ...
Translating... 0%