Add a New Disk in Linux- Partition and Format

Partition the new disk using fdisk command
Following command will list all detected hard disks:

# fdisk -l | grep '^Disk'

Output:

Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes

A device name refers to the entire hard disk. For more information see Linux partition naming convention and IDE drive mappings. To partition the disk – /dev/sdb, enter: Continue reading “Add a New Disk in Linux- Partition and Format” »

Share

Perfect FTP Server for Debian or Ubuntu

This installation was performed on a Ubuntu 14.04 distribution system.

While there are a variety of FTP server tools available for Linux, one of the most popular and mature options is vsftpd. Begin by SSHing into your server as root and use the apt-get command to install vsftpd:

apt-get update
apt-get install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
[...]
The following NEW packages will be installed:
 vsftpd
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 111 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main vsftpd amd64 3.0.2-1ubuntu2.14.04.1 [111 kB]
Fetched 111 kB in 0s (231 kB/s)
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 175600 files and directories currently installed.)
Preparing to unpack .../vsftpd_3.0.2-1ubuntu2.14.04.1_amd64.deb ...
Unpacking vsftpd (3.0.2-1ubuntu2.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up vsftpd (3.0.2-1ubuntu2.14.04.1) ...
vsftpd start/running, process 18690
Processing triggers for ureadahead (0.100.0-16) ...

Configuration
The next step is to change any configuration settings for vsftpd. Open the /etc/vsftpd.conf file in your preferred text editor: Continue reading “Perfect FTP Server for Debian or Ubuntu” »

Share

Linux Router- No NAT

I assume you have one public IP address for your WAN side, and a block for the LAN side, something like this:

ISP-----ROUTER ETH0/ROUTER ETH1------SWITCH------PCs

You NEED to have a public IP address for the WAN interface, ISP will route the subnet they have given you through this IP address. Simply you need to set the forwarding bit to 1

echo 1 > /proc/sys/net/ipv4/ip_forward

To make it persistent you need to edit /etc/sysctl.conf, find this line: Continue reading “Linux Router- No NAT” »

Share

PHP Session test Script

I’ve just found a quality script to test php session- unless you’re in dark after some php.ini session tweaking done.

To check if sessions really work you can use this code:

<?php
// Start Session
session_start();
// Show banner
echo '<b>Session Support Checker</b><hr />';
// Check if the page has been reloaded
if(!isset($_GET['reload']) OR $_GET['reload'] != 'true') {
   // Set the message
   $_SESSION['MESSAGE'] = 'Session support enabled!<br />';
   // Give user link to check
   echo '<a href="?reload=true">Click HERE</a> to check for PHP Session Support.<br />';
} else {
   // Check if the message has been carried on in the reload
   if(isset($_SESSION['MESSAGE'])) {
      echo $_SESSION['MESSAGE'];
   } else {
      echo 'Sorry, it appears session support is not enabled, or you PHP version is to old. <a href="?reload=false">Click HERE</a> to go back.<br />';
   }
}
?>
Share

Install Proxmox VE on Debian 9 – Stretch

The installation of a supported Proxmox VE server should be done via Bare-metal_ISO_Installer. In some case it makes sense to install Proxmox VE on top of a running Debian Stretch 64-bit, especially if you want a custom partition layout. For this HowTO the following Debian Stretch ISO was used:

Install a standard Debian Stretch (amd64)

Install a standard Debian Stretch, for details see Debian, and select a fixed IP. It is recommended to only install the “standard” package selection and nothing else, as Proxmox VE brings its own packages for qemu, lxc.

Add an /etc/hosts entry for your IP address
Please make sure that your hostname is resolvable via /etc/hosts, i.e you need an entry in /etc/hosts which assigns an IPv4 address to that hostname.

Note: Make sure that no IPv6 address for your hostname is specified in `/etc/hosts`

For instance if your IP address is 192.168.15.77, and your hostname prox4m1, then your /etc/hosts file should look like: Continue reading “Install Proxmox VE on Debian 9 – Stretch” »

Share

Upload Directory Tree To Remote FTP Server Recursively using NCFTP

Install ncftp client

Type the following apt-get command under Debian / Ubuntu Linux to install ncftp client, run:

$ sudo apt-get install ncftp

If you are RHEL / CentOS / Fedora Linux user, type the following yum command to install ncftp client (first turn on EPEL repo):

# yum install ncftp

Syntax and examples:

The syntax is as follows: Continue reading “Upload Directory Tree To Remote FTP Server Recursively using NCFTP” »

Share

Proxmox User Management- Proxmox VE authentication server

Command Line Tool

Most users will simply use the GUI to manage users. But there is also a full featured command line tool called pveum (short for “Proxmox VE User Manager”). Please note that all Proxmox VE command line tools are wrappers around the API, so you can also access those function through the REST API.
Here are some simple usage examples. To show help type:

pveum

or (to show detailed help about a specific command)

pveum help useradd

Create a new user:

pveum useradd testuser@pve -comment "Just a test"

Set or Change the password (not all realms support that):

pveum passwd testuser@pve

Disable a user:

pveum usermod testuser@pve -enable 0

Create a new group: Continue reading “Proxmox User Management- Proxmox VE authentication server” »

Share

Fixing phpmyadmin login on MySQL 5.7 and Debian 9

Once setting up the LAMP stack, you must be wondering to see that you no longer been able to login phpmyadmin using root credentials.

MySQL 5.7 changed the secure model: now MySQL root login requires a sudo (while the password still can be blank). I.e., phpMyAdmin will be not able to use root credentials.

The simplest (and safest) solution will be create a new user and grant required privileges.

1. Connect to mysql

sudo mysql --user=root mysql

2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass by the desired password):

CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

If your phpMyAdmin is connecting to localhost, this should be enough. Continue reading “Fixing phpmyadmin login on MySQL 5.7 and Debian 9” »

Share

How to disable Network Manager on Linux

Disable Network Manager Completely

Here is how to disable Network Manager completely, so that Network Manager stops running on your Linux system.

To disable Network Manager on Debian 8 or later:

$ sudo systemctl stop NetworkManager.service
$ sudo systemctl disable NetworkManager.service

To disable Network Manager on Debian 7 or earlier:

$ sudo /etc/init.d/network-manager stop
$ sudo update-rc.d network-manager remove

To disable Network Manager on Ubuntu or Linux Mint: Continue reading “How to disable Network Manager on Linux” »

Share