مدیریت سرورها

آموزش مدیریت سرورهای لینوکس و ویندوز

مدیریت سرورها

آموزش مدیریت سرورهای لینوکس و ویندوز

سایت در باره انواع آموزشها در زمینه IT می باشد.
مانند: لینوکس، ویندوز، سیسکو، میکروتیک، طراحی وب
به دلیل شخصی بودن وبلاگ ارائه مطالب متفرقه در آن بلامانع است.
با تشکر

طبقه بندی موضوعی

۴۳ مطلب با موضوع «لینوکس» ثبت شده است

۰۴
تیر

The ANSI/VT100 terminals and terminal emulators are not just able to display black and white text ; they can display colors and formatted texts thanks to escape sequences. Those sequences are composed of the Escape character (often represented by ”^[” or ”<Esc>”) followed by some other characters: ”<Esc>[FormatCodem”.

In Bash, the <Esc> character can be obtained with the following syntaxes:

  • \e
  • \033
  • \x1B

Examples:

Code (Bash) Preview
echo -e "\e[31mHello World\e[0m"
Hello World
echo -e "\033[31mHello\e[0m World"
Hello World

NOTE¹: The -e option of the echo command enable the parsing of the escape sequences.

NOTE²: The ”\e[0m” sequence removes all attributes (formatting and colors). It can be a good idea to add it at the end of each colored text. ;)

NOTE³: The examples in this page are in Bash but the ANSI/VT100 escape sequences can be used in every programming languages.

  • طاهر ضیائی
۱۷
دی

SSH (Secure SHELL) is an open source and most trusted network protocol that is used to login into remote servers for execution of commands and programs. It is also used to transfer files from one computer to another computer over the network using secure copy (SCP) Protocol.

In this article we will show you how to setup password-less login on RHEL/CentOS 7.x/6.x/5.x and Fedora using ssh keys to connect to remote Linux servers without entering password. Using Password-less login with SSH keys will increase the trust between two Linux servers for easy file synchronization or transfer.

SSH Passwordless Login

Setup SSH Passwordless Login

My Setup Environment
SSH Client : 192.168.0.12 ( Fedora 21 )
SSH Remote Host : 192.168.0.11 ( CentOS 7 )

If you are dealing with number of Linux remote servers, then SSH Password-less login is one of the best way to automate tasks such as automatic backups with scripts, synchronization files using scp and remote command execution.

In this example we will setup SSH password-less automatic login from server 192.168.0.12 as user tecmint to 192.168.0.11 with user sheena.

  • طاهر ضیائی
۱۷
آذر

برای اضافه کردن مخازن حرفه ای به CentOS و RedHat از این لینک استفاده می کنیم.

  • طاهر ضیائی
۱۹
آبان

A description of the hierarchy specified in the FHS

/bin/

Essential command executable (binaries) for all users (e.g., cat, ls, cp) 
(especially files required to boot or rescue the system)

/boot/

Boot loaderkernels and initrd files

/dev/

devices files (e.g., :/dev/null)

/etc/

Host-specific system-wide configuration files (from et cetera)

/home/

Users' home directories

/lib/

Libraries essential for the binaries in /bin/ and /sbin/ 
(library required to boot or rescue the system)

  • طاهر ضیائی
۲۱
مهر

In Debian:

Check your /root/.bashrc file for these lines

if [ -f /etc/bash_completion ]; then
  . /etc/bash_completion
fi

If they do not exist add them to the end of the file using your favorite text editor.


In CentOS:

# yum install bash-completion

How do I use bash Autocomplete feature?

  • طاهر ضیائی
۲۰
مهر

Install Perl Modules Manually

Download Perl module

Go to CPAN Search website and search for the module that you wish to download. In this example, let us search, download and install XML::Parser Perl module. I have downloaded the XML-Parser-2.36.tar.gz to /home/download

# cd /home/download
# gzip -d XML-Parser-2.36.tar.gz
# tar xvf XML-Parser-2.36.tar
# cd XML-Parser-2.36

Build the perl module

# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parser
# make
# make test

Install the perl module

# make install

  • طاهر ضیائی
۰۶
مهر

This is for reference purposes for those who get the error:


# qmailctl start

qmail-send supervise not running

qmail-smtpd supervise not running



Though the solution for me was simple, it took quite a while to track down.


The problem was during my install of daemontools, I did not want to restart my server (don't like resetting my uptime :-p ), even though the instructions said I should. This caused the problem that 'svscanboot' was not running, though it would have been started after a reboot. Well, I saved my uptime and solved the problem with one simple command:


# svscanboot &


Now when I start and stop qmail I get:

# qmailctl start

Starting qmail

# qmailctl stop

Stopping qmail...

qmail-smtpd

qmail-send


  • طاهر ضیائی
۲۷
شهریور

شکل خطا:

> # make setup check 

> ( cat warn-auto.sh; \ 

> echo CC=\'`head -1 conf-cc`\'; \ 

> echo LD=\'`head -1 conf-ld`\' \ 

> ) > auto-ccld.sh 

> cat auto-ccld.sh make-load.sh > make-load 

> chmod 755 make-load 

> cat auto-ccld.sh find-systype.sh > find-systype 

> chmod 755 find-systype 

> ./find-systype > systype 

> ( cat warn-auto.sh; ./make-load "`cat systype`" ) > load 

> chmod 755 load 

> cat auto-ccld.sh make-compile.sh > make-compile 

> chmod 755 make-compile 

> ( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \ 

> compile 

> chmod 755 compile 

> ( ( ./compile tryulong32.c && ./load tryulong32 && \ 

> ./tryulong32 ) >/dev/null 2>&1 \ 

> && cat uint32.h2 || cat uint32.h1 ) > uint32.h 

> rm -f tryulong32.o tryulong32 

> ( ( ./compile tryvfork.c && ./load tryvfork ) >/dev/null \ 

> 2>&1 \ 

> && cat fork.h2 || cat fork.h1 ) > fork.h 

> rm -f tryvfork.o tryvfork 

> ./compile fastforward.c 

> fastforward.c: In function âmainâ: 

> fastforward.c:287: warning: return type of âmainâ is not âintâ 

> ./compile slurpclose.c 

> ./compile coe.c 

> ./compile strset.c 

> ./compile qmail.c 

> ./compile auto-str.c 

> auto-str.c:9: warning: conflicting types for built-in function âputsâ 

> auto-str.c: In function âmainâ: 

> auto-str.c:17: warning: return type of âmainâ is not âintâ 

> cat auto-ccld.sh make-makelib.sh > make-makelib 

> chmod 755 make-makelib 

> ( cat warn-auto.sh; ./make-makelib "`cat systype`" ) > \ 

> makelib 

> chmod 755 makelib 

> ./compile substdio.c 

> ./compile substdi.c 

> ./compile substdo.c 

> ./compile subfderr.c 

> ./compile subfdouts.c 

> ./compile subfdins.c 

> ./compile substdio_copy.c 

> ./makelib substdio.a substdio.o substdi.o substdo.o \ 

> subfderr.o subfdouts.o subfdins.o substdio_copy.o 

> ./compile error.c 

> ./compile error_str.c 

> ./makelib error.a error.o error_str.o 

> ./compile str_len.c 

> ./compile str_diff.c 

> ./compile str_diffn.c 

> ./compile str_cpy.c 

> ./compile str_chr.c 

> ./compile str_rchr.c 

> ./compile byte_chr.c 

> ./compile byte_diff.c 

> ./compile byte_copy.c 

> ./compile byte_cr.c 

> ./makelib str.a str_len.o str_diff.o str_diffn.o str_cpy.o \ 

> str_chr.o str_rchr.o byte_chr.o byte_diff.o byte_copy.o \ 

> byte_cr.o 

> ./load auto-str substdio.a error.a str.a 

> /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss 

> mismatches non-TLS reference in substdio.a(substdo.o) 

> /lib/libc.so.6: could not read symbols: Bad value 

> collect2: ld returned 1 exit status 

> make: *** [auto-str] Error 1 

نکته:  در ابتدا توجه داشته باشید که حتما باید gcc نصب شده باشد تا به این خطا برسید.


راه حل:

This is "errno.h" problem! 

Please edit 

conf-cc 

like follows:


gcc -O2 -include /usr/include/errno.h 

This will be used to compile .c files. 

  • طاهر ضیائی
۲۳
شهریور

Open N windows stacked.

vim -o file1 file2 [file...]


Open N windows side by side.

vim -O file1 file2 [file...]


How does one switch between windows on VIM?

Ctrl + Shift + w

  • طاهر ضیائی
۱۷
شهریور

  1. Use Ctrl+Shift+v to select the first column of text in the lines you want to comment.
  2. Then hit Shift+i and type the text you want to insert.
  3. Then hit Esc, wait 1 second and the inserted text will appear on every line.
  • طاهر ضیائی