A simple tutorial to help install mitmproxy for debugging web applications on Linux Mint 18 / Ubuntu 16.04).
Install python 2.7 dev first (needed to avoid the error below):
$ sudo apt-get install python-dev
Now install mitmproxy
$ sudo pip install mitmproxy
Example usage with Ruby on Rails
Assuming we ran “rails server” on the default port of 3000, we can run mitmproxy on port 3001.
$ mitmproxy -p 3001 -R http://localhost:3000/
Error that would appear without installing python-dev:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o
ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-t2Ejye/PyYAML/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-b7aU7h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-t2Ejye/PyYAML/
A simple tutorial to help you find the options to change the battery critical value percentage and action options in Linux Mint 18 Cinnamon (based on Ubuntu 16.04).
$ sudo apt-get install dconf-editor
Go to org -> cinnamon -> settings-daemon -> plugins -> power
Default settings are (in %):
Critical battery action: hibernate
Exercise caution and tweak to your heart’s content 🙂
Just a quick update on EzOpenVPN:
What is OpenVPN?
OpenVPN is a reliable and well tested VPN solution that is able to run over a single port, supports compression, tunnels over NAT, and is very secure.
What does this script do?
This script will automatically install, configure, and add users to OpenVPN all in under 5 minutes, even with minimal Linux skills. The port forwarding, server configuration, and authentication setup is all taken care of for you.
- Automatic .ovpn file generation with inline certificates in a single file
- Google DNS servers
- Port 53 captive portal bypass server option
A mini news flash here, I’ve created a Github account that will be hosting all my scripts.
The first to be moved over is my automated PPTP setup script, now called ezpptp.
The LNMP (Nginx, PHP, MySQL) script has been depreciated in favor of Xeoncross’s lowendscript that I’ve contributed some patches to.
My OpenVPN setup script will soon be joining the other bunch in the near future.
Hopefully with the scripts now being hosted on Github, I’ll see some patches and commits to make them even better 😀
What is PPTP?
PPTP is short for Point-to-Point Tunneling Protocol, a technology for creating Virtual Private Networks (VPNs) quickly. Support is built-in to many operating systems natively, without needing an additional client, unlike OpenVPN.
What does this script do?
This script will automatically PPTP/PoPToP on your OpenVZ VPS in a few of minutes. Port forwarding, server configuration, and authentication setup is all taken care of for you.
What if I want to do it myself?
A manual installation guide is available here for those of you who want to get down and dirty: http://www.putdispenserhere.com/pptp-vpn-setup-guide-for-a-debian-openvz-vps/
How do I install it?
1. Enable PPP and make sure that your VPS has its PPP module working.
To check, run the following command:
If your VPS returns this message, then your PPP module is set correctly:
cat: /dev/ppp: No such device or address
If not, then you need to enable it in SolusVM (or disable and re-enable it).
2. Copy and paste these lines into your SSH client of choice:
chmod +x ezpptp.sh && ./ezpptp.sh
I have edited a script (credits below as well as a CentOS/RHEL version) for automated OpenVPN setup. OpenVPN server on your OpenVZ VPS can be set up in under a couple of minutes. Port forwarding, client config, key archiving, and config setup is all done for you. Note that setting the port to 53 can be used to bypass captive portals as an alternative to using iodine. Feedback is appreciated.
Make sure that your VPS has it’s TUN/TAP modules enabled by your provider first. To verify it is working, enter the command below:
If you receive this message, your TUN/TAP device is ready for use:
cat: /dev/net/tun: File descriptor in bad state
If you receive this message, contact your provider for assistance:
cat: /dev/net/tun: No such file or directory
To install the script, copy and paste this into your SSH client of choice:
chmod +x openvpninstall.sh