Connect with us

Home

Some Specific Technical Terms Definitions

Published

on

Learn the list of some Specific Technical Terms Definitions

Algorithm :  A set of procedures designed to accomplish something. In the case of computer software, the procedures may appear to the user as a configuration of software components

Bandwidth : The bandwidth is the amount of data that can be transmitted through a network in a given period of time.

Baud rate : The Baud rate is the number of bits of computer information transmitted per second.

Bit : The smallest possible unit of digital information, numerically either a 1 or a 0.

Buffer : An area of memory, It temporarily stores input or output data.

CD-ROM : Compact disc read-only memory. A compact disc format that can store data other than just standard CD audio. Many programs, sound sample libraries, and graphics are distributed on CD-ROM because each CD can store hundreds of megabytes of information, yet costs about the same to manufacture as a floppy disk, which only stores about 1 megabyte.

DirectX : This Microsoft Windows API was designed to provide software developers with direct access to low-level functions on PC peripherals. Before DirectX, programmers usually opted for the DOS environment, which was free of the limited multimedia feature set that characterized Windows for many years

Modem : An Electronic device (modulator/demodulator) that converts analog carrier signal to encode digital signal and also converts digital signal to . analog carrier signal

Motherboard :  The Motherboard is the main circuit board of the computers,which holds important components of the system , that would be the responsible for the computer operations.It is also known as main board, system board

Parallel interface : A connection between two pieces of hardware in which several data lines carry information at the same time.

RAM : Random access memory. RAM is used for storing computer  data. The would be lost if the power is removed..since it s a temporary storage

ROM : Read-only memory. A type of data storage whose contents cannot be altered by the user. An instrument’s operating system, and in some cases its waveforms and factory presets, are stored in ROM.

Serial interface : An electronic connection between two devices in which digital data is transferred one bit after another, rather than several bits at a time.

Sound card : A circuit board that installs inside a computer adding new sound capabilities.

Upload : To transfer a file from a computer to another via computer networks

Continue Reading

Home

Protect the web directories by user authentication in apache

Published

on

By

Directory Password Protection 

In order to restrict the clients from accessing the web directory of a server and to allow only certain users, apache uses the Directory Password Protection Method.

How to Set Password Protection to directory ?

In Apache the .htaccess (Name of the Distributed Configuration file) file is placed under the Directory that we need to protect. To configure this directory password protection follow the below steps.

 Step 1:

In the Apache configuration file httpd.conf, add an entry in Virtualhost container to secure the protected directories.

<VirtualHost 192.168.1.2:80>
Servername 192.168.1.2
DocumentRoot /var/www/html
AccessFileName .htaccess
<Directory /var/www/html/private >
AllowOverride All
</Directory>
</VirtualHost>

In the above configuration we need to protect the /var/www/html/private web directory. The .htaccess is the distributed file name placed under the protected directory, we can change this file name as per our need by assign any name in AccessFileName directive. In the Directory container we should mention the absolute path of protected directory, Inside the Directory container the All option in AllowOverride will allow all the possible configuration directives in the .htaccess file.

Note: If AllowOverride is set to none then the apache ignored the .htaccess file

Step 2:

Now Add a valid authorized user for the protected web directory by using htpasswd command

# htpasswd -c /var/www/html/private/.htpasswd <username>

The htpasswd command is used to generate the username and password for user authentication in protected directory. The option -c is used to create the password file (.htpasswd) if it does not exist.

Step 3:

Now configure the in .htaccess file which is placed under the protected directory “/var/www/html/private/.htaccess” as below.

AuthType Basic
AuthName “Private User Access”
AuthUserFile /var/www/html/private/.htpasswd
Require valid-user
Order Allow,Deny
Allow from all

In this above configuration entered in .htaccess file, the AuthType is configured as Basic, which defines the type of user authentication for the directory. The AuthName defines name of the authorization realm for a directory. The authenticated user password file stored location is denoted by AuthUserFile directive. The Require directive defines the permitted user to access the protected directory. we can also deny or allow from which client IP should access the protected IP by Allow and Deny Directive.

Note: make the .htaccess and .htpasswd file hidden from clients for security purpose.

Output :

All the configurations are over. Now just restart the apache service and call the configured virtual host protected web directory by browser.

 

Continue Reading

Home

Shell Script to add users and corresponding password automatically

Published

on

By

. . .List of Users to be Added . . .
#cat list
ravi
deepak

. . .Script to automate User and their Password Adding . . .
#vim auto.sh
#!bin/bash
cat /dev/urandom | tr -cd “a-zA-Z0-91234567890-=\`” | fold -w 9 | head -n 2 > pass
cp pass check
u=`cat list`
for j in $u
do
useradd $j
echo “User $j Added”
echo “==================================”
done
for i in $u
do
echo “User Name is :$i”
p=`cat pass`
echo “$p” | passwd –stdin “$i”
sed -i ’1d’ /home/rajm/script/blog/auto/pass
#sed -i ’1d’ $p
echo “User $i ’s password changed!”
echo “==============================”
done

. . .Give permisson and run the script. . .
#chmod +x auto.sh
sh auto.sh
User ravi Added
==================================
User deepak Added
==================================
User Name is :ravi
Changing password for user ravi.
passwd: all authentication tokens updated successfully.
User ravi ’s password changed!
==============================
User Name is :deepak
Changing password for user deepak.
passwd: all authentication tokens updated successfully.
User deepak ’s password changed!
==============================

. . .The File check used to check the password. . . .
#cat check
5<YX<jR0I
=tAn`0;mt

Continue Reading

Home

Sed command with examples

Published

on

By

Sed stands for stream editor. A stream editor performs the text transformation from input stream and the input stream may be a file or input from a pipeline.

#cat editing.txt
hi
hello
welcome
how are you
hope you are fine

. . .Sed command to print lines. . .

1.#sed ’1p’ editing.txt
hi
hi
hello
welcome
how are you
hope you are fine

==> 1p which tells that print the first line and show the remaining lines. so we can see from the output hi is priented twice.

2.#sed -n ’1p’ editing.txt
hi

===> -n options is nothing but noprint, (i.e) It prints only the first line and didn’t show the other lines.

3.#sed -n ’2,4p’ editing.txt
hello
welcome
how are you

===> The above command is used to print only a certain range of lines.

4.#sed -n ‘$p’ editing.txt
hope you are fine

===> The above command displays only the last line. The ‘$’ symbol indicated the last line and ‘-n’is used for no print and it combines with option ‘p’ to displays only the last line .

. . .Sed Command to delete lines. . .

1. #sed ’1d’ editing.txt

hello
welcome
how are you
hope you are fine

===> The above command used to delete only the fisrt line and display the remaining lines.

2. #sed ’2,4d’ editing.txt
hi

===> The above command is used to delete a range of lines.

. . .Sed Command for search and replace. . .

1.#sed ‘s/hi/changed/’ editing.txt
changed
hello
welcome
how are you
hope you are fine

==> The above command search for hi and replace to changed and print the remaining lines

2.#sed -n ‘s/hi/changes/p’ editing.txt
changes

===> The above command search for hi and replace to changed and don’t print the remaining lines

3.#sed ’1,4s/are/is/’ editing.txt
hi
hello
welcome
how is you
hope you are fine

===> The above command used to do search and replace only for a range of lines.

. . .How to delete empty lines using sed command. . .

#cat new_file
hi

The above line is empty

1.#cat new_file | sed -e ‘/^$/d’
hi
The above line is empty

2.#sed -e ‘/^$/d’ new_file
hi
The above line is empty

===> The above two commands produce the same results, It search for empty line and delete it. ‘^’ is nothing but starting of the line and ‘$’ tells the end of the line, so from the starting to ending of the line is empty means delete it.

. . .How to remove space from a word. . .

#cat remove.txt
s p a c e.

#cat remove.txt | sed ‘s/ //g’
space

# sed ‘s/ //g’ remove.txt
space

===> It nothing but search and replace, the above command search for empty space and replace it with nothig, so then space becomes nospace.

. . .How to remove a lines permanently from a file. . .

#cat new_file
hi

The above line is empty

#sed -i ’2d’ new_file

===> This above command will delete the line number 2 permanently from the file new_file.

. . .How to assign numbers for lines using sed command. . .

#cat editing.txt
hi
hello
welcome

#sed ‘=’ editing.txt
1
hi
2
hello
3
welcome

===> In the above command ‘=’ symbol is used to assign number for each lines, it works like as same as ‘nl’ command.

. . .How to use Word Boundaries using sed command. . .

Word Boundaries – \<\>

#cat first_text
raj
rajkumar
i am rajkumar

#sed -e ‘s/\<raj\>/kumar/g’ first

kumar
kumarkumar
i am kumarkumar

===> Normally if u use search and replace it will replace any word which contains raj to kumar, if ‘g’ is specified.

#sed -e ‘s/\/kumar/g’ first_text
kumar
rajkumar
i am rajkumar

===> If u use Word Boundaries means the only exact work will be searched and get replaced.(Its same like as ‘grep -w’ command)

. . .How to include files in sed command. . .

#cat commands
raj
linux

#vim lol
{
s/raj/kumar/g
s/linux/linuzzzzzzzz/g
}

#sed -f lol commands
kumar
linuzzzzzzzz

===> The ‘ -f ‘ option is used to include files in command prompt.

Continue Reading

Trending

Copyright © 2022 The Technical Stuff.