Friday, June 5, 2015

Set up a Web Server with your old Desktop System

By: sachin On: 10:13 PM
  • Share The Gag
  • Set up your own webserver

    We all pay for our own web hosting, But if we have a good internet connection upto 2MBPS, and a old working desktop computer , we can set up a web server which can handle upto 5 wordpress websites, with moderate traffic.



    To set up your own Server you need is only a old desktop computer, here we have used a old AMD Sempron based processor which is clocked at 1.6GHz ( Single Core) and 512 MB of RAM.

    Steps involved to set up your own Web Server

    • Make sure your desktop can run without any major issues for quite longer time.
    • Install the very light Operating system on it, so that no much hardware is consumed by the Operating System itself.
    • We prefer to install Operating systems like Puppy Linux, for very low end hardwares , but since we have 512 MB of RAM, we prefered to install Ubuntu 8.04 LTS in our machine.
    • Install LAMP Server(L- linux , A- Apache , M-MySQL) using the commands bellow
    1. sudo apt-get install apache2
    2. sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
    3. sudo mysql_install_db
    4. sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    • Once you install all the packages, you need to start the server manually with the following command, ( the server automatically starts once you reboot the system )
    • You can place the WebPages of your website in /var/www/website_name folder , this will set up your webserver
    Check out how to install Wordpress manually in your LocalHost
    Check out how to configure FreeDNS to get a Static Ip for your Dynamic IP

    Compile and install from source code using make in Linux (ubuntu)

    By: sachin On: 10:12 PM
  • Share The Gag
  • Build from source code using make file

    Installing Packages / Softwares from the source code is pretty easy task. We make use of "gnu make -j" to aid us in the installation of the package from the source code.The gnu make file which is provided with the source code is used and the gives code is compiled automatically. The gnu make scripts are pretty different from the native UNIX shell scripts .
    Now the question is why we do not have one single double click install feature, It exists for Debian and Red hat .deb and .rpm respectively, but for providing the multi architecture portability we have to build them in the machine where you are using it itself.
     

    Steps in building from make file from source code sample

    Here to build from the source we are making use of  utility source for the demonstration purpose.
    Step 1 : To build software's we need some building tools like compilers , linker etc. So we have a tool / software called " build-essentials "  before starting the installation you need to install this package into your computer, Sometimes it is provided Built In.
    sudo apt-get install build-essential


    Step 2 : So in this Article we consider Pidgin Chat tool for the demonstration Download Pidgin source file from here ( To demonstrate the installation only )
    Step 3 : The Source you have downloaded will be by defatult in the /Downloads Directory in your home, So just move to your Downloads Directory and Decompress the files. Use either of them based on the compression extension
    tar -xzvf file.tar.gz
    tar -xjvf file.tar.bz2  
    Step 4 : Once you have decompressed the files, You can find the folder with same name, just move into that folder using the cd command , Here in this example we move to  cd  /Downloads/Pidgin*/. Now you need to run the configuration file from the extracted folder, The configuration file will check weather all the softwares that are required in building exists in your system, If they exists then it will execute normally else it eill list out the required Dependencies which you need to manually install using the sudo apt-get install PACKAGE_NAME.
     ./configure
    Step 5 : Now if all the dependencies are available , then you can execure the "make" command to install / build your source code.Execure these commands within install will be done with execution of the installation command bellow, if you keep all these files , You can uninstall during the time of uninstallation with the second Command
    For Installation  :  sudo make install 
    For uinstallation  :  sudo make uninstall 

    Create Simple Debian Package

    By: sachin On: 10:10 PM
  • Share The Gag
  • Creating debian packages

    All major linux system has their own packaging system, Such as rpm for red hat package manager, .deb for Debian systems and there are several more formats. This article deals with the creation of a very simple .deb / Debian package of a python script, this method of debian package also works for java and c scripts , but in case of complex software which need several dependencies this is not suitable.


    What is a Debian (.deb) package
    A package is the collection of necessary data in specified format which enables the operating system to fetch necessary information about the script/software which you are going to install. This concept is used all the modern day computer Operating systems like windows (.exe ) which is also a package with extension .exe.
    SIMPLE PACKAGING OF A PYTHON SCRIPT
    1. Create a folder with any name on your home eg: mypyscript.
    2. Open the folder and create two folders with names ‘DEBIAN’ and ‘usr’.
    3. Open the folder DEBIAN. Create a text file (without extension) with name ‘control’ there.
    4. Open ‘control’ and type as follows and save it on DEBIAN
    Package: mypyscript
    Version: 0.01
    Architecture: all
    Maintainer: your name<your mail id>
    Installed-Size: 2
    Depends: python-appindicator
    Section: extras
    Priority: optional
    Homepage: your homepage
    Description: describe
    5. Back to the folder named mypyscript. Open ‘usr’. Create a folder named ‘bin’. Open ‘bin’ and
    paste your pythonscript file there.
    6. Back to the home folder where the folder ‘mypyscript’ lies or close the file browser.
    Open terminal. Be sure that terminal is in the home folder. type dpkg -b mypyscript .Then
    press enter. In seconds your deb package is ready
    Note: This is just a simple packaging.

    Create your own linux based operating system Using Linux Kernel from Scratch

    By: sachin On: 9:58 PM
  • Share The Gag
  • Create your own operating system from scratch

    Creating your own custom operating system, is a dream for many of us , But now it has come true. Creating your own operating system using the linux kernel as the base has been explained in this article.
    To create your own operating system you need to have the basic idea of the linux commands , which you will be using to perform the operations in the terminal.

    What is initrd

    INITRD is initial boot disk, means this is the one which helps all the other modules of an operating system to load. this is loaded as part of the kernel loading procedure, let us stop the explanation on initrd for the time being.

    Basic knowledge of linux / bash commands

    cd : Change directory
    ls : List the files in the current directory
    mkdir : Makes a directory
    cp : Used to copy / move a file
    rm : To refove a file / directory
    sudo : This is to access the super user permision

    Prerequisites for building OS  

    You need to download tiny core Linux  kernel , here we used tiny core since it is lite ( Download ).
    The required files are downloaded by you ? if yes proceed

    Procedure to create your own custom Linux Operating System

    Initial setup
    All the files are not allowed to extract in your local filesystem so here we are creating a separate file system , initially we create a empty binary file using dd command , later on we willl make it a file system so we can handle all types of files
    dd if=/dev/zero of=output.fliename bs=1024 count=5000000
    This is the command to create a empty binary file.
    Explination of above command
    Here ‘ if ‘ is the input file that is /dev/zero/ this is the input file which writes zero to the output file. ‘ of ‘ is the path and name the output file , ‘ bs’ is the block size that is the size of each block which is 1024 bytes then the count means the total size of the empty binart file here we have given 500MB ( 500000).
    Once we set up the empty binary file the next step is to make it a file system this is achieved using another command
    mke2fs -F -m 0 -b 1024 sactest 500000
    mke2fs is a linux command to turn a binary block into a filesystem,
    Here -F stands forthis forces the system to turn the specified binary file into file system even if it is not one,
    -m removes the reserved 5% space for the superuser
    -b is the block size
    The next is the path and name of the empty binary file we had just created using dd command , next is the file size.
    The last step in this procedure of initial set up is to mount your newly created file system so you can perform all the operations here
    sudo mount sactest sac -t ext4
    The above command will mount your filesystem inside a mount point sac with ext4 format
    This completes your initial step to set up the environment.

    Creating your initrd image
    Here we basically need to create a initrd image.
    Initially we create a directory of your choice of name i have created a directory named  ‘ my_new ‘

    Then we need to create certain no of files and folders inside this as per the linux standards.
    Step 1 : Create a folder named  ” bin ” ,this is where all the execttable binaries has to be placed , you can compile your own c or c++ cprogram and paste it here and directly run it from terminal just by typing its filename.
    for the sake of easy usage we need to copy following necessary files like busybox for the standard linux functioning.
    If you dont have busybox binary download it ( Download busybox )
    NOTE : This is a 64 bit version the kernel to be choose should also be 64 bit one which will be used in later sessions
    ( learn more on busybox )
    use the command ” busybox ” in your current running system will give you list of the functions busybox provides , now you need to create the link manually for each of the command inside the ” bin ” folder where you have the busy box binary
    Syntax : ln -s busybox command_name
     Example : ln -s busybox cd cd
    the above example creates a link to busybox for cd command and redirects the direct entry of ” cd ” command to ” busybox cd ”
    This is quite time consuming , complete doing this.
    Step 2 : Create a folder named ” etc ” inside which you need to create your fstab file ( a text file ) Paste following command and save it ( The explination is very huje so better let us skip for the time being )
    # /etc/fstab
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    devpts /dev/pts devpts defaults 0 0
    tmpfs /dev/shm tmpfs defaults 0 0this will create several mount points.
    Step 3 :Create a folder ” lib ” inside which all the dependent liberaries has to be placed ( i personally recomend to copy and paste this from the tiny core linux ).
    Step 4 : Create an empty folder proc this stores all the runtime files ( in linux all the process are considered as files ).
    Step 5 : You need to create a link named ” sbin ” which points towards the ” bin ” folder .
    ln -s bin sbin
    Step 6 : Create a ” sys ” folder also and leave it empty.
    Step 7 : Create a floder named ” dev ” and you need to copy and paste the following into it , such as “tty1 , tty , tty2 , tty3 , console , null ” . These files are available in your current running linux filesystem inside ” dev ” , you cannot just copy and paste these files as they need root permision and copy them using ” cp ” command.
    Syntax : sudo cp source_address Destination_address
    Example : sudo cp /dev/tty /Desktop/sac/dev/
    Step 8: Final step is to create a ” init ” file and paste the following .
    #!/bin/ash
    mount -t proc /proc /proc
    mount -t sysfs none /sys
    /bin/ash
    Explination : the above code sinppet is a init script which performs the following actions
    1 : mounts all the processess in proc directory
    2 : mounts file system
    3 : Shifts control to ash ( link BASH )
    You are almost done with this.
    You need to change the chmod of the init script to execuitable using the following command
    chmod +x (pathname)/init
    replace the (pathname) with the apth to init script
    Now just you need to do is to make the compressed image files of all these
    Change the current directory inside the folder in which you have created all these sub directories and execute the following command
    find . | cpio –create –format=’newc’ > ../sac
    here we use find command and the output is piped to cpio utility which creates a cpio image if all the output of find command and then is saved in “sac” file name in the succeeding directory( Note : ../sac)
    Once you do this next is to make the zip image of this so use gzip tool to make its zip
    gzip -9 ./sac
    this will make the zip achieve in compression level 9 and name it as ” sac ”
    You are done with second step too, This completes the init creation, Further things are very simple and is nothing hard at all.
     Creating your bootable OS Pendrive
    This is actually an exploit of the softwares, We use Unitbootin a windows application , using which we will create a bootable image of some other linux version in the pendrive so there eill be a bootable pendrive  with us,We use WINE tool for doing this using which we can run lite windows apps on ubuntu or other Linux flavors.
    Copy and paste the init achive you have created into the pendrive
    Copy and paste the vmlinuz which is already been downloaded in the beginning ( Download now )
    The only thing left is to insert new mount point , This can be done by adding a new label in the ” /boot/syslinyx.cfg. ” or the ” isolinux.cfg ” , Based on bootloader installed this may change, You are done, For this part please check our video which will be uploaded very soon.

    This completes the session on how to build / create your own operating system using Linux kernel

    External Reference : Click here

    Easy Steps To Fix Windows 8.1 Master Boot Record

    By: sachin On: 9:56 PM
  • Share The Gag
  • Fixing Windows 8.1 Master Boot Record

    Windows Master Boot record required to boot into your windows systems can be deleted accidentally or due to malfunctioning of other software. So this article explains you how to fix your Windows master boot record . This task requires a windows 8.1 DVD ( Recovery Disk ). The Steps invilved in recovering the Master bot record is given stepwise bellow.
    The Article here explains only a method to fix your master boot record using the recovery disk , there are other techniques also to fix your master boot record, but this is a very easy and simple technique to fix it.

    Steps to Fix Windows 8.1 Master Boot Record

    Step 1 : Insert your Windows Disk and Allow it to boot

    Step 2 : Select  Troubleshoot >> Command Prompt
    Step 3 : Once you get your Command prompt, You have to execute the following DOS Commands , Which will automatically check and fix your Master Boot Record .
    bootrec /FixMbr
    bootrec /FixBoot
    bootrec /ScanOs
    bootrec /RebuildBcd
    Sponsored Content
    Step 4 : After each Command you have to hit ENTER key ( As always )
    Step 5 : Remove the DVD and then restart your Windows System, It is ready to Boot.

    Install Sublime Text 3 in Ubuntu

    By: sachin On: 9:54 PM
  • Share The Gag
  • Sublime Text 3 Installation Guide

    Sublime Text 3 editor is a very good text editor for developer, The Sublime Text 3 has a very good support for the coding, with auto indentation and syntax highlighting feature. The Editor is very user friendly and easy to use with plugin system.


    Ubuntu Commands to install Sublime Text 3 in Ubuntu

    Step 1 : Add the new repository into the software system
    sudo add-apt-repository ppa:webupd8team/sublime-text-3
    Step 2 : Update the new repository
    sudo apt-get update
    Step 3 : Now install Sublime Text 3 on your Ubuntu System
    sudo apt-get install sublime-text-installer

    Installing WordPress in your localhost machine ( PC )

    By: sachin On: 4:25 AM
  • Share The Gag
  • Install WordPress at local host

    Installing Wordpress on your local system ( local host ) is a very simple task, You just need to install a web server software within your system.In this example we have opted to use LAMP /WAMP servers for linux and windows users, Since the functionality of both these server softwares are same, we just opted and explained using one of these 2 softwares.

    Steps involved in setting up WordPress In your LocalHost

    Step 1 : Download the LAMP / WAMP server Softwares based on your Operating system.(LAMP : Linux , WAMP : Windows ).
    Step 2 : Download the latest version of Word press Software Click Here
    Step 3 : Install The Server software you have installed, For WAMP ( Windows ) server you need to install an .exe file and it is simple, For LAMP ( Linux ) USers  Check this article to install LAMP

    Step 4 :  Once you install one of these servers, you need to start that server from its controle pannel for WAMP server , for LAMP server starts automatically once you start the computer.To check weather your server is running, Just  type " localhost " in you web browser, if no error page appears then server has been successfully installed.
    Step 5 : Your server will have a directory named " www " inside its installed folder, this is the place where you need to place your files to be displayed on the web page.
    For windows, we installed on C:/ drive so the path is c:/wamp/www/ , For linux users in LAMP the path is /var/www/, You need to place the files/folders inside this for them to appera on webpage.
    Step 6 : Extract the wordpress you downloaded and paste those files inside the 'www' folder either directly or make a folder called wordpress and paste them for easy handling ( if u paste the files directly inside www folder then just typing localhost in browser will enable you to load your wordpress, if you place files inside a folder named word press within 'www' then you can access these files by typing "localhost/wordpress" as the url.
    Step 7 : You need to go to url ' localhost/phpmyadmin ' and create a database and set a user to that database with all priveledges, These database name and user details ( username and password ) you have set needs to be filled in the installation wizrd of wordpress.
    phpmyadminphp-database-setup-2
    Step 8 : Go to 'localhost' or 'localhost/wordpress' where ever you have installed wordpress, Then simple fill the details asked ( Details like database name, database username, database userpassword, login username,login password etc ), If you have done all the above steps of setting up the database properly , you will successfully run wordpress.