How to restart network on Ubuntu 16.04 Xenial Xerus Linux

The following linux commands will assist you with network restart procedure on Ubuntu 16.04 Xenial Xerus Linux. We will start with the most recommended commands and move down to more obscure or obsolete commands in case the above commands will fail from some reason.
Let’s begin with system and service manager by using systemctl command to restart network service:

$ sudo  systemctl restart NetworkManager.service

Next command service will restart a relevant networking System V init script:

$ sudo service network-manager restart

Read more

Ubuntu Xenial Xerus 16.04 Linux ISO image download with zsync

zsync is a very handy download tool if you would like to keep your Ubuntu Xenial Xerus ISO image up to date without the need to re-download and entire ISO image every time there was an update. This is especially true with a daily build Ubuntu Xenial Xerus ISO images or if you have a limited download speed or bandwidth. In this case thezsync will allow you to download only that part of the ISO image which has been changed since your last download.

Prerequisites

To get begin let’s start by installation of zsync package:

# apt-get install zsync

Read more

C development on Linux – Packaging for Debian and Fedora – XI.

Introduction

You’re already in the know regarding the C programming language. You got the taste of it and felt like you want to go further and write your own. Or maybe help the community and package that favorite software of yours for the distribution you like and use. Regardless of the situation, this part of the C development series will show you how to create packages for two of the most popular distributions, Debian and Fedora. If you read our articles so far and you have some solid knowledge of the command line, and you can say that you know your distro of choice, you’re ready.

Before we go further…

Let’s get some concepts and general ideas out of the way, just so we make sure we are on the same page. What we are about to outline here is available regardless of the project you decide to package (or contribute) for, be it Arch, NetBSD or OpenSolaris. The idea is: be careful. Check the code, whether it’s yours or not, and make sure you remember that perhaps lots of people will use your code. You have a responsibility on your hands, and a pretty big one at that. If you doubt this, reverse places for a second: a package maintainer isn’t careful when inspecting code and some sneaky, but grave bug makes his way installed on your computer. It’s sneaky, as it only manifests itself on certain hardware and in certain situations, but it’s grave enough to delete all the files resident inside your home folder. You happen to have that exact combination of hardware and mayhem ensues, as you forgot to write to DVD those pictures from your holiday. You get angry, your first reaction is to manifest negative feeling towards the operating system (or distribution) and so, following your decision to change distributions immediatley, that distro loses one user, all because one person’s lack of attention and thoroughness.

Debian

Given Debian’s excellent documentation, we won’t be able to cover all the things one needs to become a developer. After all, this is not what we wanted. What we wanted is to show you basically how to get from a tarball to a .deb. Becoming a Debian developer takes lots of time and involves you helping out the community via IRC or mailing lists, reporting and helping fixing bugs, and so on, so that is not the object of our article. Have a look at the documentation the project provides for more insight. The Debian policy, New maintainer’s guide and the Developer’s reference are more than important for starting up, they must be like some kind of a book you sleep under the pillow with.

Your first stop should be, as outlined above, the policy, where you MUST acquaint yourself with the filesystem hierarchy, the archives, the fields in a control file and specific items to be remembered regarding diferent categories of software: binaries, libraries, source, games, documentation, … Remember that a .deb file is nothing more than an archive, and it’s made of two parts: the control part, with the control file and the install/ uninstall scripts, and the payload, where the files to be installed reside. It’s not as hard as one would think it is. It’s a very good idea that you download a .deb file, even better if it’s packing some software you are familiar with, and start looking inside to see what’s what. [HINT] – You can use the control file to create your own, as long as you’re careful. As an example, let’s take vim. deb files are nothing but ar(1) archives, so they can simply be unpacked by using the following linux command:

 $ ar vx vim-nox_7.3.547-5_amd64.deb

Read more

Deployment of Kippo SSH Honeypot on Ubuntu Linux

Introduction

Do you feel that someone is attempting to access you server? To find out, you can deploy a honeypot within your system to help you ease your paranoia by either confirming or dismissing your initial believe. As an example you can start the Kippo SSH honeypot, which allows you to monitor brute-force attempts, collect up today exploits and malware. Kippo also automatically records hacker’s shell session, which you can replay to explore various hacking techniques and later use this gathered knowledge to harden your production server. Another reason why to install a honeypot is to take away an attention from your production server. In this tutorial we will show how to deploy a Kippo SSH honeypot on the Ubuntu server.

Prerequisites

Kippo SSH honeypot is a python based application. Therefore, we need to first install python libraries:

$ sudo apt-get install python-twisted

Normally you would run you sshd service listening on default port 22. It makes sense to use this port for your SSH honeypot and thus if you already run the SSH service we need to change the default port to some other number. I would suggest not to use alternative port 2222 as its use is already generally known and it could sabotage your disguise. Let’s pick some random 4-digit number like 4632. Open your SSH /etc/ssh/sshd_config configuration file and change the Port directive from:

Read more

Custom kernels in Ubuntu/Debian – how, when and why

So, you’ve decided to try out this thing you heard others talk about, called ‘compiling a custom kernel’. If you are trying this as a hobby, or because you want to learn a new skill, very well – read on.

However, before we start, we will try to explain situations when this need arises and how to deal with it. Note that this is an extensive subject which needs much more in terms of space than we will provide here. You will learn the basics, what you need, what to do and what you’ll achieve.

For more info, as usual, Google is your friend; also , the documentation resident in the kernel source tree will answer lots of questions. So, let’s start with the beginning, with a last note : if need arises, we will publish more articles related to kernel compiling pertaining to other distros.

Read more

Windows 7 partitioning

Dual boot Ubuntu Linux and Windows 7

Introduction

You need Windows for a program you use for work, your favorite game runs only on Windows or you are a developer that works on some cross-platform project. And of course, you can’t even think about giving up your favorite OS. Whatever the reason, you need Windows and a virtual machine won’t cut it so all you’re left with, if you don’t have a spare machine, is dual-boot. I usually recommend against multiple-boot machines, but I can’t argue with the fact that here are situations when the idea is very useful. So this is what this article is about: making sure you need a dual-boot system, acknowledging the requirements, making backups if need be and proceed. You are expected to have some experience in installing Windows as well as Linux, at least Ubuntu in this case, and some courage. But first let’s make some concepts clear.

Concepts

We don’t want to lie to you: any task that involves advanced partitioning schemes isn’t for the faint of heart. But it isn’t rocket science either, and we’re here to help you. Various operating systems have various partitioning schemes but since the partitioning concepts of the PC are so “smart”, there are some things you should know. Every OS that I know of that is installable on the PC requests a primary partition to boot from. Linux is the most flexible in this respect, as you can have its’ /boot or / on a logical partition, but I’m not so sure if your BIOS will be able to boot from it. Windows, Solaris and the BSDs absolutely demand primary partitions, with Windows being the most “oppressive” in that respect. So whenever you install a dual-boot system with Windows involved, install it first, as it won’t ask you and overwrite the MBR. If you want to dual-boot Linux and BSD or Solaris, install Linux first. Now that we settled this, we will insist you make backups if you have other partitions on the target disk, and you still need them. Our setup will start with a blank drive, and we’ll show you how it’s done.

Installing Windows 7

As said, you need to install Windows first, and this is more than an advice, and it doesn’t apply only to Windows 7 either. We suggest you don’t try over-complicated setups, because your chances of having a system actually up and running in decent time are decreasing rapidly that way. Take note that this article is not a step-by-step how-to on installing Windows 7 and/or Ubuntu. We will only refer to the parts that involve partitioning for a successful dual-boot experience. So, when you will get to Windows’ partitioning screen, here’s a screenshot for you to get an idea:

Windows 7 partitioning

So, since Windows asks for a minimal primary partition size of more than 12 GB (!) , I gave it that, it auto-created it’s system one and left me the rest of the disk empty and blank. After installing finished successfully, I was prepared for the tricky part: installing Linux. No, I’m just kidding, it’s as simple as it can be.

Read more

Hubot basic commands

How to install and use Hubot on Ubuntu Linux

Introduction

If you ever wanted to have a personal robot then you are reading a correct article. This tutorial is a brief demonstration on how easily you can configure your personal or company robot, then soon after, connect it with one of available adapters like: shell, campfire, hipchat, irc, gtalk or skype. In this tutorial I’m going to teach you how to set up Hubot with its default adapter Shell. Although it’s the simplest option, it’s the solid foundation for your future modifications.
Correctly configured and connected Hubot can dramatically improve and reduce employee efficiency as well as give your company lots of fun. Additionally, It can provide your team with the newest rss feeds or send crucial notifications. Keep in mind, that Hubot is developed by Github team, so it’s next pros for spending a while on investigations.

So what is Hubot ?

Hubot is open source, written in CoffeeScript on Node.js. It can be easily deployed on PaaS platforms like Heroku. Hubot comes preinstalled with several core scripts like math, ping, help, translate or youtube.
Additionally you can visit community repository which provides tons of other interesting scripts (i.a: ascii, coin, deploy, dice or jenkins). If this list still doesn’t meet your expectations, feel free to write your own script using CoffeScript.
As a starter I wanted to present few examples which I hope will bring some light to this topic.

Hubot> hubot convert me 56MB KB
Hubot> 57 344 kilobytes
Hubot> hubot mustache me linuxconfig.org
Hubot> http://mustachify.me/2?src=http://img1.tuicool.com/aqi6r52.jpg#.png
Hubot> hubot translate me praktyczne
Hubot> "praktyczne" is Polish for " Practical "
Hubot> hubot image me niagara falls
Hubot> http://www.niagarafallslive.com/images/HorseshoefromSkylon.jpg#.png
Hubot> hubot convert me 5 years days
Hubot> 1 826.21099 days
Hubot> hubot math me 2(3+7)/4
Hubot> 5
Hubot> hubot die
Hubot> Goodbye, cruel world.

Read more

Create RPM package gpg key

Creating a package repository on Linux : Fedora and Debian

Introduction

This article at is the logical continuation of our PXE article, because after reading this you will be able to network boot AND actually install the distribution of your choice. But there are other uses of creating your own repository. For example, bandwidth. If you manage a network and all the systems (or some) are running the same distribution, it’s easier for you to just rsync in conjunction with a nearby mirror and serve updates yourself. Next, maybe you have some packages created by you that your distro won’t accept in the main tree, but the users find them useful. Get a domain name, set up a webserver and there you go. We will not detail the setup of a webserver here, just basic installation tasks and the basic setup of a repository for Fedora or Debian systems. Hence you are expected to have the necessary hardware (the server and the necessary network equipment, depending on the situation) and some knowledge about Linux and webservers. So, let’s start.

NOTE:This article was moved from our previous domain linuxcareer.com.

Creating a repository on Fedora systems

Installing the tools

Fedora has a tool called createrepo which simplifies the task at hand. So, all we need to install is that and httpd as the webserver:

 # yum install createrepo httpd 

Setting up the repositories

Now, after setting up your webserver, we will assume that the root directory is ar /var/www. We have to create the necessary directories in an organized matter (feel free to adjust to taste if necessary or just follow the official layout):

 
 # cd /var/www/html
 # mkdir -p fedora/15/x86_64/base
 # mkdir fedora/15/x86_64/updates

Read more

How to Install Java on Ubuntu Linux

Introduction

How to install Java on Ubuntu Linux? Although, this topic is a quite self explanatory to an experienced Linux system administrator it still creates lots of confusion for beginners in terms what version of Java I need, how do I install it or how to change my system settings between multiple different types of Java versions. The aim of this short article is to shed some light on this topic as we will show how to install Java JDK for both Oracle and as well as OpenJDK.

What is Java

In short, Java is an object-oriented programming language. The current owner of the official implementation of the Java SE ( Standard Edition ) platform is Oracle Corporation. The free and open source implementation of the Java Platform SE is called OpenJDK and OpenJRE. There is also another Java version maintained by IBM. IBM provides also both JDK and JRE. Currently only OpenJDK and OpenJRE Java versions are available via standard Ubuntu repository.

Read more

Oracle Java JDK 7 on Ubuntu Linux – Source or RPM Installation

Introduction

In the previous article we have discussed how to install OpenJDK java on ubuntu from the standard Ubuntu repository or Oracle’s Java JDK 7 using Personal Package Archives ( PPA ). This article will cover installation of Oracle Java JDK 7 from a source package or by converting RPM Java package to the Debian software package format.

Download Oracle Java JDK 7

First, we need to download Oracle Java JDK source package from the official Oracle website. Navigate to JDK Downloads, accept license terms and download jdk-7<version>-linux-<architecture>.tar.gz. Current version of this source package is jdk-7u11-linux-x64.tar.gz and this is also what we are going to use in this tutorial. Store this tarball source package into your home directory or some other arbitrary place.

Read more

Setting up apt proxy Server Approx on Ubuntu Linux

Introduction

Approx is a proxy server for Debian archive files. Having such a service within your LAN with multiple Debian like systems will provide you with number of benefits such as update speed since any update package needs to be downloaded only once. This will also lower down Internet download usage requirements, etc. This article will describe a process of approx setup for Ubuntu Linux.

Installation

As any other installation from standard Ubuntu repository, installation of the approx apt proxy server is a fairy simple process. Install the approx apt proxy server with:

$ sudo apt-get install approx

The above command will also install all prerequisites including Internet superserver inetd, which is used to invoke the approx server.

Read more

How to setup latest version of Django framework with Python 3 on Debian 8 Jessie Linux

The following quick guide will help you to setup a latest version of Django framework with Python 3 on Debian Jessie Linux. The current default Django version on Debian 8 Jessie Linux is 1.7 with python 2.7. Follow the below step in order to install Python 3 with latest Django. Let’s start by installation of python3-setuptools:

# apt-get install python3-setuptools

The above command will also install Python 3 on your system. Next, use easy_install3 to install alternative Python package installer pip:

# easy_install3 pip

Read more