Add Swap Space on Ubuntu 16.04

Before begin, please check if the system already has swap space available. Even though it’s possible to have multiple swap files or swap partitions, one should be enough.

free -h

Output
total used free shared buff/cache available
Mem: 488M 36M 104M 652K 348M 426M
Swap: 0B 0B 0B

As we can see no swap is active on the system. We will create a 1 Gigabyte file in this guide. Adjust this to meet the needs of your own server:

fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

We can check the output of the “free” command again to verify the swap:

free -h

Output
total used free shared buff/cache available
Mem: 488M 37M 96M 652K 354M 425M
Swap: 1.0G 0B 1.0G

The swap space has been set up successfully and our operating system will begin to use it.

Now let’s make the swap space used permanently:

cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Done!

Setup 3proxy Anonymous Proxy on Ubuntu or Debian

The instruction suitable for all Unix distributions, because we are gonna compile it from source code. Compiling from source code is preferred, that way we will get the latest version. In this case I’m using Ubuntu/Debian.

To compile 3proxy from source code you need to install git, make, and gcc. Just type into your terminal:

apt-get install gcc make git -y

Next, browse to home directory

cd ~
git clone https://github.com/z3APA3A/3proxy.git

This will download latest version of 3proxy to your machine. Next step to compile and setup:

cd 3proxy
make -f Makefile.Linux

Now we put files into correct path and setup auto start of the service

mkdir -p /usr/local/etc/3proxy/bin
cp src/3proxy /usr/local/etc/3proxy/bin
cp ./scripts/rc.d/proxy.sh /etc/init.d/3proxy

Before we add 3proxy service to autostart, we need to do some adjustment to the default init script because it’s missing some LSB tags or else you’ll get some insserv warning.

vi /etc/init.d/3proxy

Change all the lines started with “#” with these lines:

#!/bin/sh
### BEGIN INIT INFO
# Provides: 3proxy
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Stop/start 3proxy
### END INIT INFO

Make the service auto start on boot

update-rc.d 3proxy defaults

Now let’s create the config file.

vi /usr/local/etc/3proxy/3proxy.cfg

You can RTFM for all the parameters or options, but to make it short, these are my config for anonymous proxy:
Continue reading Setup 3proxy Anonymous Proxy on Ubuntu or Debian

Thoughts, Stories, and Ideas