Apr 17 2017

Find And Delete Files Greater Than Given Size on Linux

Category: Linux & UnixFatih Acar @ 19:56

If you want to delete files which are greater than given size on Linux, you can use below examples by changing as your need.

Delete Files

Delete files which are size more than 2 MB. and type is jgp.

[root@testserver ~]# find /tmp/ -type f -size +2M -name “*.jpg” -exec rm -rf {} \;

Delete files which are size more than 2 MB low than 5 MB. and type is jpg.

[root@testserver ~]# find /tmp/ -type f -size +2M -size -5M -name “*.jpg” -exec rm -rf {} \;

Delete files which are size low than 10 MB. and type is zip.

[root@testserver ~]# find /tmp/ -type f -size -10M -name “*.zip” -exec rm -rf {} \;

3,005 total views, 25 views today

Tags: Linux Administration, System Administration


Dec 09 2016

Check Service Status With Python on OEL 7 / Centos 7

Category: Linux & Unix,PythonFatih Acar @ 21:42

I write a python code to check mysql service open or close. It is simple and you can change service_name parameter in the code to check another services. You can download from here check_service_status.py Below code maybe can not run because of python language format is tab structure. You can use with download original code check_service_status.py

Check MySQL Service Status


#-*- coding: utf-8 -*-

import os
import commands

service_name = "mysql"

def check_service_status(service_name):

        status = os.system('systemctl status '+service_name+ ' > /dev/null')
        return status

def main():

        if (check_service_status(service_name) == 0):
                print "Running"
        else:
                print "Stopped"
main()

Download

Execute Script
Continue reading “Check Service Status With Python on OEL 7 / Centos 7”

3,130 total views, 6 views today

Tags: Linux Administration, Python, System Administration


Nov 30 2016

Change Hostname on OEL 7 CentOS 7

Category: Linux & UnixFatih Acar @ 10:24

You can use hostnamectl command to list and change hostname of operating system on OEL 7 or CentOS 7 version.

List Hostname Status


[root@localhost ~]# hostnamectl 

   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 6f021291e2384a219e1f23ca39eadc9a
           Boot ID: ec195c69cfde417b88b86f4d7419cf24
    Virtualization: vmware
  Operating System: Oracle Linux Server 7.3
       CPE OS Name: cpe:/o:oracle:linux:7:3:server
            Kernel: Linux 4.1.12-61.1.28.el7uek.x86_64
      Architecture: x86-64

Change Hostname Status
Continue reading “Change Hostname on OEL 7 CentOS 7”

2,570 total views, 5 views today

Tags: Linux Administration, System Administration


Nov 01 2016

Change Hostname in RHEL 7

Category: Linux & UnixFatih Acar @ 10:29

Changing hostname is different from RHEL 6 version in RHEL 7. You can use few method to change hostname. I will demonstrate useful and easy method that is hostnamectl command.

Show Current Hostname

[root@localhost ~]# hostname
localhost.localdomain

or

[root@localhost ~]# hostnamectl status
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 418f684e1a5c45c9a22f76065c732de3
Boot ID: 9b07d8a45e60437e9ef31164d394ad17
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.36.3.el7.x86_64
Architecture: x86-64

Change Hostname
Continue reading “Change Hostname in RHEL 7”

2,943 total views, 2 views today

Tags: Linux Administration, System Administration


Oct 31 2016

Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7

Category: Linux & UnixFatih Acar @ 16:32

What is firewalld

Firewalld provides a dynamically managed firewall with support for network/firewall zones that define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings, ethernet bridges and IP sets. There is a separation of runtime and permanent configuration options. It also provides an interface for services or applications to add firewall rules directly.

Benefits of using firewalld

Changes can be done immediately in the runtime environment. No restart of the service or daemon is needed.

With the firewalld D-Bus interface it is simple for services, applications and also users to adapt firewall settings. The interface is complete and is used for the firewall configuration tools firewall-cmd, firewallctl, firewall-config and firewall-applet.

The separation of the runtime and permanent configuration makes it possible to do evaulation and tests in runtime. The runtime configuration is only valid up to the next service reload and restart or to a system reboot. Then the permanent configuration will be loaded again. With the runtime environment it is possible to use runtime for settings that should only be active for a limited amount of time. If the runtime configuration has been used for evaluation, and it is complete and working, then it is possible to save this configuration to the permanent environment.

firewall

Add a Port to Firewalld as temporary

[root@test ~]# firewall-cmd –add-port=1521/tcp

Add a Port to Firewalld as permanent
Continue reading “Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7”

5,831 total views, 12 views today

Tags: Linux Administration, System Administration


Oct 12 2016

Turkey Stay Summer Time Zone and How to Implement TZDATA Package for Linux Systems

Category: Linux & UnixFatih Acar @ 15:59

Turkey is breaking step with Europe and keeping summer time through the winter. Instead of turning clocks back an hour as they do in the European Union in the autumn, Turkey will keep the clocks as they are and effectively change the country’s time zone. You have to implement new tzdata-2016g package on your systems to accommodate new decision.

You can install from Red Hat yum repository if you use Red Hat system. (Red Hat, Centos, Oracle Linux)

https://access.redhat.com/errata/RHEA-2016:1982

yum install tzdata*2016g*

Both tzdata-java-2016g and tzdata-2016g package installation will be useful.

Check New Adjustment

You check new time zone status with zdump command like below.

zdump -c 2016,2017 -v “Europe/Istanbul”

tzdataturkey

You have not to see Oct 30 date and gmtoff value 7200. You have to see gmtoff value 10800.

6,666 total views, 2 views today

Tags: System Administration


Dec 04 2015

RPM Command Using on Linux Systems

Category: Linux & UnixFatih Acar @ 15:46

If you connect linux repo, you can use yum install or yum update to manage your package. On the other hand, if you have RPM package, you can use rpm command to manage packages.

RPM command has been using for installing, uninstalling, upgrading, listing,querying and checking RPM packages on linux system. You can use rpm command with root user.

Frequently Used RPM Commands

Install RPM Package

[root #] rpm -ivh postgresql-libs-8.4.20-1.el6_5.x86_64.rpm

Update RPM Package

[root #] rpm -Uvh postgresql-libs-8.4.20-1.el6_5.x86_64.rpm

List All Installed Packages

[root #] rpm -qa

Search From Installed Packages

[root #] rpm -qa | grep postgresql-libs

Take Information From Installed Package

[root #] rpm -qi postgresql-libs

Uninstall RPM Package

[root #] rpm -ev postgresql-libs

5,357 total views, 5 views today

Tags: Linux Administration, Oracle Linux, System Administration


Nov 21 2015

How to Lock and Unlock Users on Oracle Linux / Centos / Redhat

Category: Linux & UnixFatih Acar @ 13:25

Lock User

Method 1

[root@test ~]# passwd -l username

Method 2

[root@test ~]# usermod -L username

Unlock User

Method 1

[root@test ~]# passwd -u username

Method 2

[root@test ~]# usermod -U username

Check Status of Users

[root@test ~]# more /etc/shadow

username:!!$6$pmQO0ZPH$POolvCzxe1nsd1OpLkMc6E3cd1ffOkcz224caQs1d/oL.OwscUhYfcas//41sS12.:16531:0:99999:7:::

Note : If you see “!!” expression or “!” expression start of password of username, the user is locked.

1,870 total views, 5 views today

Tags: Linux Administration, System Administration


Oct 26 2015

Error Code 80072EE6 Windows Update Error Solution

Category: WindowsFatih Acar @ 11:02

If you receive a 80072EE6 error code when you download an update from Windows Server Update Services in Windows 7 or Windows Server 2008 R2, your update service location can be wrong. You have to control and change with true.

Error

80072EE6 error code when you download an update from Windows Server Update Services.

Solution
Continue reading “Error Code 80072EE6 Windows Update Error Solution”

1,359 total views, no views today

Tags: System Administration


Oct 02 2015

How to Create Virtual IP Address on Oracle Linux System

Category: Linux & UnixFatih Acar @ 16:50

You can create virtual IP addresses on Oracle Linux, Redhat and Centos Operating Systems with below operations.

Virtual IP address can be temporary or static according to your wishes. You have to have a ethernet adaptor interface for example eth0. You can use ifconfig eth0:0 <IP address> syntax to create temporary virtual IP.

Create Temporary Virtual IP

[root@test ~]# ifconfig eth0:0 192.168.27.150

Delete Temporary Virtual IP

[root@test ~]# ifconfig eth0:0 down

Create Static Virtual IP

[root@test ~]# cd /etc/sysconfig/network-scripts
[root@test ~]# vi ifcfg-eth0:0

DEVICE=eth0:0
IPADDR=192.168.27.150
NETMASK=255.255.255.0
NETWORK=192.0.0.0
BROADCAST=192.168.27.255
ONBOOT=yes

Activate Network Configuration

[root@test ~]# service network restart

13,973 total views, 15 views today

Tags: Linux Administration, Oracle Linux, System Administration


Next Page »