Virtualenv can be installed using pip
:
pip3 install virtualenv
If this approach fails, try:
# Ignore system files and folders - Ubuntu | |
*.*~ | |
# Ignore Python related files | |
*.py[cod] | |
__pycache__/ | |
.cache/ | |
# Ignore virtualenv files and folders | |
pip-selfcheck.json |
This is stripped away version of article I wrote for my blog, you can view full version here.
You can try out Python at codecademy.com.
This gist is a compilation of two tutorials. You can find the original tutorials here and here. What should you know before using this? Everything can be executed from the home folder. For easier cleanup at the end you can make directory where you'll download everything, and then just use rm -rf .
. Although, you should be careful. If some strange bugs arise unexpectedly somewhere sometimes, just keep in mind that some user names have underscores in them (this is probably nothing to worry about).
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Alertm
#!/bin/bash | |
# Ubuntu 16.04 | |
# Prometheus installation. It's a lousy script though. | |
# Example: | |
# chmod +x prometheus.sh | |
# sudo pwd | |
# ./prometheus.sh |
# Fail2Ban configuration file | |
# | |
# NOTE | |
# You should set up in the jail.conf file, the maxretry and findtime carefully in order to avoid false positives. | |
# | |
# Author: http://www.go2linux.org | |
# Modified by: samnicholls.net | |
# * Mon 6 Jun 2016 - Updated failregex to capture HOST group correctly | |
[Definition] |
import time | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
HOST_NAME = 'localhost' | |
PORT_NUMBER = 9000 | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_HEAD(self): | |
self.send_response(200) |
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
import BaseHTTPServer | |
import cgi | |
from pprint import pformat | |
PORT = 6969 | |
FILE_TO_SERVE = 'path/to/your/response/content.json' | |
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): | |
""" |
import sqlite3 | |
from pathlib import Path | |
from functools import wraps | |
""" | |
This is a dummy implementation of the privilege-based checks based on the following article: | |
https://lostechies.com/derickbailey/2011/05/24/dont-do-role-based-authorization-checks-do-activity-based-checks/ | |
""" |