This would be one of those random posts…

This would be one of those random posts that don’t make sense to you.

P2 could be a nice trick to write several post a day. It takes away that initial inhibition to log into the blog, make post, title, tag, etc. If I am writing for myself why bother.

Now that I think more about it blog is a conversation happening in real time. You keep moving. And that is why a consistent flow is important.

In these past few months working from home one critical lesson that I have learned is that you can’t do everything. You have to pickup your battles.

I can get used to this P2 for…

I can get used to this P2 for its sheer simplicity. Although it is bad for any form of technical or long form writing. Or maybe I should edit the theme.

Install Syncthing on Fedora

Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it’s transmitted over the Internet.

Add COPR Repository

dnf copr enable thunderbirdtr/Syncthing_for_Fedora

Installation

yum install syncthing

Enable and start via Systemd

systemctl enable syncthing@$USER.service
systemctl start syncthing@$USER.service

Access WebUI

http://127.0.0.1:8080/

After that you can follow the getting started guide at Syncthing Docs

Set SELinux To Permissive Mode on CentOS 7

ownCloud 7 on my CentOS 7 VM kept on complaining that I don’t have access to the config directory. On contrary I had both /var/www/html/owncloud/config and /var/www/html/owncloud/data directory set to drwxrwxrwx. and drwxr-x---. respectively. Yet the server complained about not having access to the config directory. Here comes the SELinux part. SELinux is by default set to enforce which we want to set to permissive more. It would be better if you create an exception rather than setting it to permissive mode but for now here is how you set up it to permissive mode.

setenforce 0

You can check the status of SELinux by running sestatus command.

sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

How To Enable EPEL on CentOS 7

EPEL is a repository maintained by Fedora Project which contains various additional packages for enterprise Linux distributions like Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux(OEL).

EPEL can be installed on CentOS 7 as follows.

wget http://epel.mirror.net.in/epel/7/x86_64/epel-release-7-0.2.noarch.rpm
yum install epel-release-7-0.2.noarch.rpm

You can find out more about EPEL on Fedora Project wiki

Happy Installing.

Set Firewall To Allow Access To TCP/80 Over Network From A CentOS VM

Continuing from the last two posts I was able to get the network working and set the static IP but I wasn’t able to access web server from other nodes on my network.

The two simple ways to check if your web server is accessible from your network is as follows.

  1. Python is universally installed on all Linux systems. We could use SimpleHTTPServer module for Python to check the web server. You can spun off a Python web server by running the following command.
    python -m SimpleHTTPServer 8000
    

Check your server at http://vm-ip-address:8000

  1. You could also install Apache web server and run it using systemd.
    yum install httpd
    systemctl start httpd
    

Again go to your machine’s IP address http://vm-ip-address

Now some of you might notice that server is isn’t working. At least it didn’t work on my system. CentOS 7’s firewall was blocking access to 80/tcp. You can create a rule for it as follows.

firewall-cmd --add-port=80/tcp
firewall-cmd --permanent --add-port=80/tcp

For more information please read man firewall-cmd.

Now you can access the web server on any node in your network.

How to Setup Static IP on CentOS 7?

I am working on setting my own CentOS image that I could use quickly with any sort of things that I want to learn for example install LAMP on CentOS. In this quest the next thing I want to do is setup a static IP. I am adopting @fernandoaleman‘s guide for CentOS 6 here.

Basically, we want to make changes to following three files. Remember on my system I am using ifcfg-enp0s3 and you are responsible for finding interface for your system. Also remember that VirtualBox by default uses NAT for VMs but NAT is limited to the VM but we want to access is beyond the VM. We have two other options Bridged connection or Host Only. Bridged will directly work with your network card and make it available to every terminal in your network whereas Host-only will only allow the access to the host. We want to use Bridged connection so that we can use multiple devices for our virtual server.

/etc/sysconfig/network was empty on my system so I had to just append to the file.

/etc/sysconfig/network
------------------------
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.1.1

/etc/sysconfig/network-scripts/ifcfg-enp0s3 will require us to change ONBOOT, BOOTPROTO and add IPADDR and NETMASK. See the following example.

DEVICE="enp0s3"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System enp0s3"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0

The last part of the puzzle is to change the DNS servers in /etc/resolv.conf. You could use either Google’s DNS or OpenDNS as follows.

/etc/resolv.conf
--------------------
# Google IPv4 nameservers
nameserver 8.8.8.8
nameserver 8.8.4.4

You can either restart the VM or restart the network.

systemctl restart network

Source

How To Enable Networking At Boot On CentOS 7?

I booted up CentOS 7 x86_64 Minimal ISO in VirtualBox but it came without pre-enabled networking. According to CentOS 7 FAQ, you can easily enable networking at boot using the following command.

cd /etc/sysconfig/network-scripts/
 sed -i -e 's@^ONBOOT="no@ONBOOT="yes@' ifcfg-enp0s3

Remember to make sure to edit the correct interface. In my case it was ifcfg-enp0s3 which is based on the new naming scheme of network interfaces.

Meta

I regularly change theme of this blog. I can’t seem to find a theme that fits my taste and would look fresh. Readability is so much important. The text should be of perfect size. Most of the blogs that I read tend to have 12pts text. 12pts aren’t readable from any angle. The navigation in most of the blogs and website is in such way that as soon as you click a link you get into a maze and it is hardly possible to come back where you started.

If I had a linear blog what would help users find important posts vs meta posts like this one. Posts like this one is to just satisfy myself. It is a mental exercise. It has nothing to do with users.

I am still confusing the target audience. There are two possibilities either go for a portfolio website or a blog. They can’t be the same thing. The linear nature of blog makes it hard to use.

India 68 Years Old.

Today is the Independence day of Republic of India. I have live in United States for 7 years and have recently moved to India. I am not so happy with the ground reality. There is a lot of I-am-not-sick feeling among Indians. I have long maintained a view that it is not the member of parliament or any other officer that is going to come to your street to clean it up. You live there. It is your responsibility to keep it clean. How can a billion of Indians don’t feel nothing when they walk down street and they see dirt everywhere. We don’t need policy when it comes to honk. The only way to stop noise pollution is to stop honking and stop blocking traffic.

The biggest problem is not lack of sound system but lack of motivated population to live in it. It is a common practice to leave waste outside one’s house for someone to pick up. How can in a civilized nation and cultured for centuries to expect someone to pick our wastes. It is not nice.

We worship animals from cows to goats and many but when we are done with the worship we leave them to eat polyethylene on streets.

One of the problems that we don’t seem to even think about is the problem of population. I try to leave my house whenever I think most people will be at work and I could go shop in peace but to my surprise it is always busy. It is always busy.

None of these problems are going to be solved on its own. We will have to make small groups and tackle one local problem at a time.

But crowds don’t really behave that way. Crowds are destructive.