Monthly Archives: January 2016

How Linux & open source saves money ?

There has been lot of debate about how linux and open source softwares that whether it saves cost or it is just a manipulative perception but from my perception it does with various points it scores really well as compared to other OS, softwares and also reduction in privacy.

Linux desktops operating systems such as Fedora, Ubuntu, OpenSuse, Debian etc are free and quite stable with excellent hardware support. Server based operating systems like Centos,Ubuntu Server are giving stiff competition to Redhat Enterprise Linux  and Suse Linux Enterprise Linux. Even this OS can be installed without license leading to no updates and no technical support that makes them more acceptable.

OpenOffice, Kingsoft office, Libreoffice are best alternatives to Microsoft Office and their installables on Windows OS have been also in great demand.There are various video and audio players in linux like Cmus,mp3blaster,mplayer,vlc which also serves your entertainment purpose.

If you talk about webservers nginx,apache are more scalable and preferrable choice of web servers than other windows based webservers like IIS.

Open source load balancers like haproxy,pound, balance which are also quite comparable and competitive in terms of commercial load balancers based on cloud like elastic, cisco or F5 Big IP.

All browsers firefox,chrome,few others are available on Linux.Even for kiosks based applications the OS choice is Linux.Android where you can root your own device and upgrade your own mobile operating system isn’t that so exciting and wonderful as compare to other mobile OS.In Linux you have the choices of virtual 3D desktops and cool wallpapers.Car Infotainment and in flight entertainment systems runs linux.

All compilers like gcc,g++, python,perl,cgi etc are also available in Linux. LAMP(Linux apache mysql php) can also be configured. Postgresql, Maria DB, MongoDB can also be installed and configured in Linux environment. AutoCAD alternatives like FreeCAD,QCAD community edition fulfill your needs of designing. Even for UI designing you have all the alternatives you need for Adobe Illustrator etc which you can find on http://www.linuxalt.com/.

You have skype, pidgin and all the IM’s for Linux as well.Even for Visio you have Dia and yed software for diagrams and designing architecture workflows.

In short there is nothing you cannot find an alternative in Linux. I leave it on you to decide that Linux really helps in cost reduction and providing more stable environments in terms of server and desktop needs.

Please free to comment and queries.

-Alok Thaker

 

Artificial Intelligence in Linux

AI the term artificial intelligence sounds so interesting and make us curious what stores in future of AI.  There has been recent updates about how Facebook creator Mark Zuckerberg wants to create his own JARVIS.  AI has been fascinating me when I was kid Star Wars, Eliza and now as grown up we have  SIRI as a virtual assistant and many other.

First step up to start using AI is to create a chatbot which has lot of readymade stuff available or you can use opensource such as charliebot (http://sourceforge.net/projects/charliebot/).

You can download the tar archive and building it is very easy.

tar -xzvf charliebot-src_4.1.8.tar.gz
cd charliebot
./server.sh
Starting Charliebot version 4.1.8

Eventually, you’ll see Alice come online.
Response 1 in 483 ms. (Average: 483.0 ms.)
Alice> Can you tell me any gossip?
Alice] user>

You can now start chatting with Alice and also other 3 personalities.
/talkto Charlie
/talkto Anna
To shift to any of the personalities.

Charliebot runs and listens on 2001 port where you can also get the logs of chats.

http://localhost:2001/?botid=Alice&template=alice

This is an example where you can see Charliebot on the browser and see the conversations in the logs folder too in charliebot directory.

You can create and write your own chatbot with python and AIML(Artificial Intelligence Markup Language). You can see the link Create your own Chatbot.

I am very much fascinated with text to speech thing where I would love to say when I booted my computer in Linux and it says Welcome Alok and during shutdown it says Goodbye Alok. I used open source espeak TTS speech software which is quite good and also MARY TTS also scores really well.

I have been using Raspberry pi for my home hobby projects and Raspberry pi is becoming one of the favorite devices for IOT(Internet of Things) and also for AI. A very good website which has good listing and documentation of AI on Raspberry pi on http://rpiai.com/ and also learn about machine learning  language.

There is a big name emerging in AI known as Mycroft

They are going to launch a home automation and responsive system for playing your own movie, locking your door, starting coffee, waking you up etc. It is an open source AI which is going to be released soon in 2016 and also a device running on Raspberry pi 2 which helps you everything for home automation and AI.

Feel free for any comments or queries.

-Alok Thaker

Some good Linux OS Hacks

Today is republic day of my motherland India. I got time to just check my Linux OS and was thinking to play and have some tweaks.  In Linux OS we have environment variables which you can check by giving the command env on bash shell.

Say you want to change the linux prompt to your name you can use PS1 environment variable with the following command.

#PS1=”alok”

Now you prompt would change to alok.If you want to save this changes even after reboot you can put the above line in .bash_profile file on Centos/Fedora/Redhat systems and in ubuntu .profile file.

You can put your own label by changing the label option in /etc/grub.conf and reboot to see that you would see your own label while booting linux.

If you want to put your own customized message after login of any user over ssh likes of putty or ssh client you can put your message in /etc/motd file.  You can even put your before login messages in /etc/ssh/sshd_config file by uncommenting the line

#Banner /etc/msg

You can create file named msg in /etc and put your message which you want users to see before login.

You can even change grub splash image in Centos-7 by the following steps :-

1) Create/convert your splash picture to .tga in gimp

2) Edit /etc/default/grub and add line:
GRUB_BACKGROUND=”/path/to/your/tga/file.tga”

3) Edit /etc/default/grub and comment following line:
GRUB_TERMINAL_OUTPUT=”console”

4) run:
grub2-mkconfig -o /boot/grub2/grub.cfg

5) reboot and enjoy your work!

You can create your own shortcut to your commands with alias command in linux. Like for clear command you can create alias c=’clear’. You want to ssh to a particular server everytime you need you can create alias.

alias myssh=’ssh roo@192.x.x.x.’

You can create permanent alias by storing this command in /root/.bashrc and you can use unalias command to remove alias.

There might be some other interesting hacks you can found and can come across. I just shared some of my favourites.

Feel free for any comment or queries.

-Alok Thaker

 

Audio video players in Linux console & setting up alarm to wake you up

Being sunday lazy afternoon I was going through an idea of having a music player which I can play on my Linux laptop but to save the memory I have been running it through console mode instead of GUI.

I also was thinking to setup alarm using music player in linux.That really helps when your mobile switch offs due to low battery or malfunctions.  As such listening to your alarm with your own music is a great boost to wake up early in mornings for workouts or running to your office.

There are many console players available in linux but one of the most common music players are MPlayer, CMus,mp3blaster etc.

For installing CMus on Centos :-

On CentOS, first enable Repoforge repository from here, then type:

#yum install cmus

For video player I am very much impressed by likes of MPV & SMPlayer.

Now considering the alarm setup you can use cron job for scheduling the job to play an mp3 at your considered time.

Install mplayer on centos/redhat by following the link https://wiki.centos.org/TipsAndTricks/MultimediaOnCentOS

Use Cron job to schedule your alarm :-

#crontab -e

0 5 * * * mplayer  /opt/alok.mp3

Save the cron job and every 5am you would be having your own mp3 played to get you up.

For understanding cronjob string :-

It consists of five parts:

  1. minute (0-59)
  2. hour(0-23)
  3. day of month(1-31)
  4. month(1-12)
  5. day of week(0-6)

Feel free for comments or any queries.

-Alok Thaker

 

Web sites performance optimization

In today’s world if you have any website which is loading slow it is bad for the people who visit to your site and also leads to bad impression in online presence leading to bad business. In fraction of delays you can lose a lead leading to some good sales.

So your website optimization plays a very vital role in terms of business and sales. Even if it is your personal blog as mine slow speeds can affect page ranks by google, alexa ranking etc.

I have identified some of the pointers which might be helpful for you too in terms of website speed up and performance.

  1. Ensure you have a web server optimized like compression of images enabled.Use nginx,apache optimization parameters for optimal performance.
  2. Good OS Configuration like memory, CPU cores, network bandwidth,storage with good prevention through firewall and IDS-IPS(Intrusion Detection-Prevention Systems)
  3. Database should be optimized and kept seperate from web server.
  4. Usage of Load balancers to handle traffic.
  5. You can use yslow addons in mozilla browser to check the pages which are having issues and also shows you the reports.
  6. I mostly use https://gtmetrix.com to get the reports from Pagespeed, Yslow and waterfall view of pages.
  7. Use CSS instead of images.
  8. Enable http caching and usage of varnish cache to accelerate.
  9. Usage of less redirects.

Some of the  more details you can find on : –

https://developers.google.com/web/fundamentals/performance/?hl=en

http://blog.crazyegg.com/2013/12/11/speed-up-your-website/

Feel free to comment or any queries.

-Alok Thaker

 

 

 

Hardening and Securing your linux OS & Servers

There has been lot said about hardening and security of Linux OS. I would like to highlight some points which are quite essential to secure your servers from attacks, hacks and hijacks.

  1. File-Directory Permissions :- Linux operating system is presented with file and directory permissions of 644 and 755(where r=4,w=2,x=1 and 1st user is owner,2nd is group ownership,3rd is for others who are not part of groups ). So never give 777 for a file or directory if you want user to get access try giving him a limited access rights of read.
  2. Passwords :- Passwords shouldn’t be predictable and kept strong  with alpha numeric and special characters. Use chage command restricting users to change password after few months or days and faillog command to identify the failure logins and then locking the user.
  3. Disable root logins, enable sudo privileges for any user who has to use any root privileged services restart,shutdown etc.
  4. Have firewall(iptables,shorewall,tcp wrappers) etc enabled to prevent unauthorized packets and attacks like DOS,DDOS.Use IDS-IPS (Intrusion Detection-Prevention Systems) like OSSEC,Suricata etc for identifying & preventing attacks.
  5. Antivirus like ClamAV (Open Source) or Trend Micro,Commodo, Avast should be installed and configured well with regular updates.
  6. Kernel up-gradation & patching to prevent any loopholes or exploits in the kernel.
  7. Use portscanner like nmap,nessus for any unwanted ports opened and shut them off.
  8. Disable unwanted services if you are not using it.
  9. If you have an application server running on LAMP, jboss,tomcat enable application hardening like using of certificates (SSL), code & vulnerability scanning as per OWASP vulnerabilities as mentioned in my previous blog posts with tools like W3AF, OpenVAS,Acunetix etc.
  10. Ensure and use 3 tier architecture(Loadbalancer->Webserver->Application server-Database Server) with DMZ architecture so that your servers are not directly accessible and visible globally.

This are some pointers which I mentioned. Please feel free to comment or ask for any queries.

-Alok Thaker

 

 

Data mining using open source & Linux

Data mining as the term is used for analysis of big and large data sets such as generating reports, artificial intelligence, data interpretation, surveys,  statistics, large database systems etc.

It is very useful for businesses requiring lot of data interpretation, report generation identifying their turnover, sales, leads generation, accounting, banking, finances, saving costs etc. Contribution of open source in data mining is quite remarkable. Various data mining softwares like Knime, Orange, RapidMiner etc have been gaining tremendous popularity and acceptance.

I have been fan of Orange and one of my favorite data mining tool. Please feel free to learn more about Orange on http://orange.biolab.si/

Just  load your dataset and you are through to your data analytics and mining.

Feel free for any comments or queries.

-Alok Thaker

 

 

Time Synchronization with NTP & also setting up your hardware clock

Time synchronization is very much required when you have a critical task of generating tasks such as report generation, clustering & high availability configured, indexing of documents in document management systems like alfresco, solr search etc.

NTP stands for network time protocol which is used for synchronizing your Linux time with ntp server. There are various ntp servers across the world and you can find the lists on ntp.org .

Installing and configuring ntp is very easy. If you are on Centos/Redhat machines you can use the below steps :-

  1. yum install ntp ntpdate ntp-doc
  2. ntpd

    To keep your server clock automatically synchronized you can run the ntpd daemon which is installed as part of the ntp package.

    Edit the /etc/ntp.conf file to comment out the following lines:

    #server 127.127.1.0     # local clock
    #fudge  127.127.1.0 stratum 10

  3. chkconfig ntpd on (To make service on at the boot time)
  4. ntpdate pool.ntp.org
  5. service ntpd start (Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate)

This won’t synch your hardware clock with NTP. To synch hardware clock to synch with your system time use the  below command.

# hwclock –show
# hwclock –systohc

You can also create a ntp server and allow various clients to synchronize the system time from your local ntp server. You can refer NTP Server & Client.

Please free to comment and for any queries.

-Alok Thaker

OWASP & Vulnerability Scanners

There has been lot of buzz about OWASP(Open web application security project) which concentrates on web application security tools, standards, articles as in form of online community. Their main aim is to educate and make developers,system administrators,security administrators aware for the various web based application vulnerabilities.

Various open source vulnerability scanners have come into existence but there are always different perception about their usage. Most of the common network  scanner and open source vulnerability scanning tool is OpenVAS.

It is very much easy to setup and use it on different linux OS and also can be used with Kali Linux.  OpenVAS has been very useful to scan various vulnerabilities of IP or hostname. For more details regarding installation and setup please refer on http://www.openvas.org

Apart from network vulnerability scanners like OpenVAS, Nessus etc there is a very critical need for application & web scanning vulnerabilities. There are various web application security scanners like Acunetix, Arachni, W3af which are quite reliable and provides good reports about threats in the application.

For more details about W3af please go to http://w3af.org/

Arcachni you can refer to http://www.arachni-scanner.com/ and acunetix on http://www.acunetix.com/

For any queries or comments please feel free to connect with me.

-Alok Thaker

 

 

 

Cloud services

There has been very much curiosity among every IT students, professors, professionals about cloud and what they offer. Cloud is a great alternative and solution to on premise infrastructure where you don’t need to worry about your hardware, power, networking implementation. Cloud gives you a space of yours to build your servers, selection of your OS, installation of your own choices and ready to go environment including static/dynamic IP for your configuration and services. They provide technical support too in cause of any issues or queries.

3 cloud computing models are :-

  1. IAAS (Infrastructure As A Service) consisting of virtual-physical machines, resources,networking for your requirements.
  2. PAAS (Platform As A Service) consisting of your OS, Programming languages, database, web servers etc.
  3. SAAS(Software As A Service) consisting of your application softwares you need where you don’t need to worry about your installation,setup of those softwares like Microsoft 365, wordpress etc

There are various favorite cloud hosting providers one of my favorite is Amazon Web Services where anyone can start using the free tier services with just a credit card registration for an year and try hands on.  To know more about free services of Amazon you can go through the link Amazon web services free tier. You can also know about the free and costing models.

Another good alternatives for cloud service providers are Rackspace, Digital ocean which have been also getting recognition in cloud.

Feel free to ask any queries or comments.

-Alok Thaker