Articles tagged with: Linux tricks

Centos Sıkılaştırma

  • Proxy kullanılıyor ise tanımlanır:

export http_proxy=http://proxyserver:portnumber
export https_proxy=http://proxyserver:portnumber
export ftp_proxy=http://proxyserver:portnumber

  • Update yapılır:

yum update -y

  • ssh ayarları yapılır:

Loading

Change or setup default gateway with route command in linux

$ /sbin/route -n

Output:

Kernel IP routing table
Destination           Gateway              Genmask                 Flags       Metric        Ref       Use         Iface
191.255.255.0     0.0.0.0                  255.255.255.0       U             0                0           0            eth0
169.254.0.0         0.0.0.0                  255.255.0.0           U             0                0           0            eth0
0.0.0.0                 191.255.255.1     0.0.0.0                    UG           0                0           0            eth0

Please note that a destination entry 0.0.0.0 (or default) is the default gateway.
In above example 191.255.255.1 is a default gateway.

Loading

Virtualbox installation error on ubuntu “Kernel driver not installed (rc=-1908)”

Easy way to install virtualbox on Ubuntu

root:~# sudo dpkg-reconfigure virtualbox-dkms dpkg-query

dpkg-query: package ‘virtualbox-dkms’ is not installed and no information is available
Use dpkg –info (= dpkg-deb –info) to examine archive files,
and dpkg –contents (= dpkg-deb –contents) to list their contents.
/usr/sbin/dpkg-reconfigure: virtualbox-dkms is not installed

Loading

Permission Modes in Linux

   8             5              5
user      group      world
r+w+x r+x r+x
4+2+2 4+0+1 4+0+1 = 855

The permission mode is computed by adding up the following values for the user, the file group, and for everyone else. The diagram shows how.
▪ Read 4 – Allowed to read files
▪ Write 2 – Allowed to write/modify files
▪ Execute 1 – Read/write/delete/modify/directory

    7             4              4
user      group      world
r+w+x r r
4+2+1 4+0+0 4+0+0 = 744

Loading

sudoedit (şifresiz root kullanıcısı olma )

Aşağıdaki komut ile sudo dosyası açılır

root#sudoedit /etc/sudoers

daha sonra dosyaya aşağıdaki satır eklenir

[kullanici adi]              ALL=(ALL)       NOPASSWD: ALL

Daha sonra sudo -s veya sudo su – ile şifresiz root olunur.

Loading

route add in Linux

route add -net networkaddress netmask 255.255.255.0 gw gateway ip

or only one host

route add -host networkaddress netmask 255.255.255.255 gw gateway ip

color red: change your own ip address

Loading

Copy file to remote computer on Centos

Remote to local copy

#scp -P 22 remote_IP:/home/myfile.gz . (. meaning local current folder)

Local to remote copy

#scp -P 22 myfile.gz remote_IP:/home/

 

FOLDER COPY

 

#scp  -r -P 22 /folder/name/* remote_IP:/home/

Loading

How do I kill process in Linux?

Kill process in Linux or terminate a process in UNIX or Linux systems

Kill command works under both Linux and UNIX/BSD like operating systems.

1.   First, you need to find out process PID (process id)

Use ps command or pidof command to find out process ID (PID). Syntax:
ps aux | grep processname
pidof processname

Loading