Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, October 18, 2019

Some Popular Linux VPS Bench Scripts



Cloud service providers often define host tiers by the allocated resources, but the differences in the underlying hardware, architecture and performance tuning can result in varying capabilities even between similar configurations. The easiest way to measure the real differences between servers is to run a set of tests, i.e. a benchmark, to create simple to read values for comparisons.


UnixBench

    UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system. Hence, multiple tests are used to test various aspects of the system’s performance. These test results are then compared to the scores from a baseline system to produce an index value, which is generally easier to handle than the raw scores. The entire set of index values is then combined to make an overall index for the system.
    Some very simple graphics tests are included to measure the 2D and 3D graphics performance of the system.

    UnixBench Benchmark repository is at https://github.com/cloudharmony/unixbench

    Wednesday, September 25, 2019

    Install Portainer to Manage Containers - Nginx, MySQL, WordPress

    Portainer is a lightweight management UI which allows you to easily manage your different Docker
    environments (Docker hosts or Swarm clusters). It is meant to be as simple to deploy as it is to use. It consists of a single container that can run on any Docker engine (can be deployed as Linux container or a Windows native container). Portainer allows you to manage your Docker containers, images, volumes, networks and more !


    1. Installation in CentOS / Ubuntu
    1.1 CentOS 7/Debian 9

    Here is an easiest way to install docker into your CentOS / Debian system. It is just one command:
    
    
    sudo -i
    yum -y update
    curl -sSL https://get.docker.com/ | sh

    Tuesday, September 17, 2019

    Using SSMTP to Send Email From Linux VPS Command Line Through Gmail Account

    Ssmtp (Simple SMTP) is a little nice tool you can use under Linux command line to send out email. SSMTP allows users to transfer emails through an SMTP server from the Linux command line. It provides the means to connect to a mailhub with a proper configuration file. If your config file was set up right, all your worries regarding command line email sending can disappear.

    System Repository Update
    Before we do anything else we should bring the Ubuntu Repository up to date. Type the following command to update Ubuntu System Repository:
    sudo apt-get update


    Install the ssmtp package:
    sudo apt-get install ssmtp

    Thursday, September 5, 2019

    Monit - Linux Open Source System or Process Monitor Program

    1. What is Monit?
    Monit is a utility for managing and monitoring processes, programs, files, directories and file systems on a Unix like system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. E.g. Monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses too much resources. You can use Monit to monitor files, directories and file systems for changes, such as timestamps changes, checksum changes or size changes.

    Monit is controlled via an easy to configure control file (/etc/monit/monitrc) based on a free-format, token-oriented syntax. Monit logs  to syslog or to its own log file (/var/log/monit.log) and notifies you about error conditions via customisable alert messages.

    Monday, September 2, 2019

    Linux Virtual Machine PHP Invoked OOM-killer (Out of Memory) Issue

    One of my GCP VM is running at f1-Micro type which only has limited memory, 614MB. From syslog, I found it has a PHP invoked OOM killer messages. This usually means this server essentially ran out of memory and extra memory should add into this system, Based on some posts online, especially this 2010's  post :

    "The Linux kernel likes to always allocate memory if applications asking for it. Per default it doesn’t really check if there is enough memory available. Given that behavior applications can allocate more memory as really is available. At some point it can definitely cause an out of memory situation. As result the OOM killer will be invoked and will kill that process:"

    Friday, August 30, 2019

    Ubuntu Basic System and Service Configuration Commands


    1. Update / Upgrade Commands
    • sudo apt-get update : In a nutshell, apt-get update doesn't actually install new versions of software. Instead, it updates the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.
    • sudo apt-get upgrade : will fetch new versions of packages existing on the machine if APT knows about these new versions by way of apt-get update. An update must be performed first so that apt-get knows that new versions of packages are available.
    • sudo apt-get dist-upgrade: will do the same job which is done by apt-get upgrade, plus it will also intelligently handle the dependencies, so it might remove obsolete packages or add new ones. 

    Note: we can combine commands with && signs, such as:
    • sudo apt-get update && sudo apt-get dist-upgrade

    Friday, February 1, 2019

    Kali Usage Tips and Tricks

    Kali Linux is a Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. Kali contains several hundred tools which are geared towards various information security tasks, such as Penetration Testing, Security research, Computer Forensics and Reverse Engineering.

    Download Kali: https://www.kali.org/downloads/

    Basic Configuration Videos:


    Tuesday, January 8, 2019

    CentOS Basic Configuration and Services/Software Installation (Docker, Vsftp, Samba, etc)

    The CentOS (Community Enterprise Operating System) Project is a community-driven free software effort focused on delivering a robust open source ecosystem. For users, CentOS offers a consistent manageable platform that suits a wide variety of deployments. For open source communities, CentOS offers a solid, predictable base to build upon, along with extensive resources to build, test, release, and maintain their code.

    CentOS uses the Red Hat source code base to create a product similar to RHEL. So CentOS is very close to being RHEL without the branding and support. In particular, the library versions are the same, so binaries that work on one will work on the other. The administration tools are the same and configured in similar ways. However, there are a few differences, as the two distributions sometimes apply different minor patches.

    Tuesday, December 18, 2018

    Ubuntu 16.04.5 LTS (Xenial Xerus) Installation Step by Step in VMWare Workstation (Not Easy Installation)


    1. Ubuntu16.04 Installation
    1.1 VMware Workstation Virtual Machine Creation for not easy installation
    If you are using VMware workstation , by default, system will do easy installation for you, which means all settings will be automatically entered by VMware Workstation. You wont need to provide too much or any information during installation process. We are not going to use this method in this post. We just choose  the option "I will install the operating system later" to skip easy installation.

    YouTube Video:
    Easy Install vs Non Easy Install

    Tuesday, April 17, 2018

    Install OpenVAS on Ubuntu


    OpenVAS is a framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution. The framework is part of Greenbone Networks' commercial vulnerability management solution from which developments are contributed to the Open Source community since 2009.

    1. Install dependencies

    OpenVAS Virtual Appliance / GreenBone Installation

    OpenVAS Framework
    The GSM Community Edition is a derivate of the GSM ONE and allows a quick and easy option on Windows, Linux or Mac to give the solution a trial. No particular know-how is needed.
    In contrast to the commercial solution the Community Feed instead of the Greenbone Security Feed is used. Also some management functions like for TLS certificates are not included. Feed updates happen on a regular basis, but the system itself can not be updated. The commercial version can be updated seamless and also includes access to the Greenbone Support.
    The Community Edition as well as the GSM ONE are designed for use with a laptop. The full feature set for a vulnerability management process (schedules, alarms, sensors) are only available with the bigger GSM models (see here for an overview) and can be obtained from Greenbone as an evaluation unit.

    1. OpenVAS / GreenBone Installation Video





    Saturday, April 14, 2018

    Metasploit Installation on Windows 7 and 10

    The Metasploit Framework (MSF) is far more than just a collection of exploits. It’s an infrastructure that you can build upon and utilize for your custom needs. This allows you to concentrate on your unique environment, and not have to reinvent the wheel. I consider the MSF to be one of the single most useful auditing tools freely available to security professionals today. From a wide array of commercial grade exploits and an extensive exploit development environment, all the way to network information gathering tools and web vulnerability plugins, the Metasploit Framework provides a truly impressive work environment.

    1. Installation on Windows 7
    Youtube Video:



    Kali Virtual Appliance Installation and Usage

    Kali Linux is the world’s most powerful and popular penetration testing platform, used by security professionals in a wide range of specializations, including penetration testing, forensics, reverse engineering, and vulnerability assessment. It is the culmination of years of refinement and the result of a continuous evolution of the platform, from WHoppiX to WHAX, to BackTrack, and now to a complete penetration testing framework leveraging many features of Debian GNU/Linux and the vibrant open source community worldwide.

    Kali Linux has not been built to be a simple collection of tools, but rather a flexible framework that professional penetration testers, security enthusiasts, students, and amateurs can customize to fit their specific needs.
    1. Installation Kali Virtual Appliance


    Saturday, September 30, 2017

    LAMP and WordPress with HTTPS Certification Cloud Installation on Ubuntu

    I have selected Ubuntu as OS platform to install my php, wordpress and mysql. It gave me lots of learning experience on Linux. Here is many steps I recorded during working on my 51sec.org blog site.

    For Windows: WAMP and Wordpress Install on AWS Free Tier Windows 2012 R2
    For Ubuntu: LAMP and WordPress Installation on Ubuntu

    1. Basic Ubuntu Configuration (Not in Cloud)
    1.1 Configure Interfaces

    Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-16-generic x86_64)

     * Documentation:  https://help.ubuntu.com/

    48 packages can be updated.
    37 updates are security updates.

    Last login: Sat Feb 13 20:16:03 2016 from 192.168.2.62
    [email protected]:~$ cd /etc/network
    [email protected]:/etc/network$ sudo vi interfaces
    [sudo] password for john: 

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    source /etc/network/interfaces.d/*

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface -- use DHCP 
    auto eth0

    iface eth0 inet dhcp

    # The secondart network interface -- use static ip address
    auto ens160
    iface ens160 inet static
    address 192.168.2.22
    netmask 255.255.255.0
    gateway 192.168.2.1
    dns-nameserver 8.8.8.8
    ~

    ~
    [email protected]:/etc/network$sudo /etc/init.d/networking restart


    Wednesday, August 6, 2014

    Linux : find big file in the all directories

    1. Juniper Firewall  

    find . -type f -size +10000 -exec ls -lh {} \; 

    Sample output:

    [email protected]% find . -type f -size +10000 -exec ls -lh {} \; 
    -rw-r--r--  1 930  929   134M Jan  5 17:34 ./cf/packages/junos-11.4R6.6-domestic
    -rw-r--r--  1 root  wheel   139M Sep  8  2011 ./cf/var/log/junos-srxsme-11.2R2.4-domestic.tgz
    -rw-r-----  1 root  wheel   4.9M Feb 11 17:12 ./cf/var/db/idpd/db/secdb_02.db
    -rw-r-----  1 root  wheel   6.7M Feb 11 17:13 ./cf/var/db/idpd/db/secdb_03.db
    -rw-r-----  1 root  wheel    64M Feb 11 17:13 ./cf/var/db/idpd/db/secdb_06.db
    -rwxr-xr-x  1 admin  20    24M May 23 08:38 ./cf/var/db/idpd/nsm-download/SignatureUpdate.xml
    -r-xr-xr-x  1 root  wheel   5.2M Jan  5 17:33 ./jail/html/dynamic-vpn/client/jam/InstallerComponentSRX.exe
    -rw-r--r--  1 root  wheel   139M Sep  8  2011 ./jail/var/log/junos-srxsme-11.2R2.4-domestic.tgz
    -rw-r-----  1 root  config    14M Feb  8 22:16 ./mfs/var/run/db/schema.db
    -rw-r-----  1 root  wheel    10M Feb  8 22:19 ./mfs/var/sdb/log.0000000001
    -r--r--r--  1 root  wheel   6.5M Jan  5 13:59 ./usr/lib/dd/libjkernel-dd.so
    -r-xr-xr-x  1 root  wheel    13M Jan  5 15:39 ./usr/sbin/authd
    -r-xr-xr-x  1 root  wheel   6.0M Jan  5 16:51 ./usr/sbin/chassisd
    -r-xr-xr-x  1 root  wheel    27M Jan  5 13:05 ./usr/sbin/flowd_octeon
    -r-xr-xr-x  1 root  wheel    34M Jan  5 13:05 ./usr/sbin/flowd_octeon_hm
    -r-xr-xr-x  1 root  wheel   5.5M Jan  5 16:51 ./usr/sbin/kmd
    -r-xr-xr-x  1 root  wheel    13M Jan  5 16:24 ./usr/sbin/rpd



    2. Checkpoint Firewall gateway:


    [[email protected]]# find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
    ./sysimg/CPwrapper/linux/CPEndpointSecurity/EndpointSecurityServer.bin: 145M
    ./sysimg/CPwrapper/linux/windows/SmartConsole.exe: 194M
    ./sysimg/CPwrapper/linux/CPrt/CPrt-R75.40-00.i386.rpm: 53M
    ./sysimg/CPwrapper/linux/CPportal/CPportal-R75.40-00.i386.rpm: 59M
    ./var/log/db: 336M
    ./var/log/upload/WebUpload.IjyBg6: 91M
    ./var/log/upload/Check_Point_R77.10_T151_upg_WEBUI_and_SmartUpdate.Gaia.tgz: 1.5G
    ./var/log/upgrade/RPMS/auto_hfs-0.2-cp990150005.i386.rpm: 59M
    ./var/log/upgrade/scripts/linux/CPcvpn/CPcvpn-R77-00.i386.rpm: 67M
    ./var/log/upgrade/scripts/linux/CPvpn/CPsuite-R77-00.i386.rpm: 504M
    ./var/log/upgrade/scripts/linux/CPuepm/CPuepm-R77-00.i386.rpm: 125M
    ./var/log/upgrade/scripts/linux/CPportal/CPportal-R77-00.i386.rpm: 62M
    ./var/log/upgrade/scripts/linux/windows/SmartConsole.exe: 302M
    ./var/log/upgrade/scripts/linux/CPrt/CPrt-R77-00.i386.rpm: 53M
    ./var/log/opt/CPsuite-R75.40/fw1/fw.log: 55M
    ./var/CPbackup/backups/backup_CP-M-.test.com_9_7_2013_13_21.tgz: 59M
    ./var/opt/CPsuite-R75.40/fw1/conf/appfw/appfw_tables.sqlite: 130M
    ./sys/devices/pci0000:00/0000:00:02.0/resource2: 256M
    ./proc/kcore: 1015M