• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

status

Tomcat Install

June 4, 2021

Tomcat requires JRE.

wget jre-8uversion-linux-x64.tar.gz
# or
apt-get install default-jdk

wget jre-8uversion-linux-x64.tar.gz # or apt-get install default-jdk

Install Tomcat 8 on Linux.

wget https://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.66/bin/apache-tomcat-8.5.66.tar.gz
tar zxpvf apache-tomcat-8.5.66.tar.gz
cd /opt/tomcat/apache-tomcat-8.5.66/bin/
./startup.sh

wget https://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.66/bin/apache-tomcat-8.5.66.tar.gz tar zxpvf apache-tomcat-8.5.66.tar.gz cd /opt/tomcat/apache-tomcat-8.5.66/bin/ ./startup.sh

Status|Start|Stop|Restart Tomcat.

systemctl status tomcat8
systemctl start tomcat8
systemctl stop tomcat8
systemctl restart tomcat8

systemctl status tomcat8 systemctl start tomcat8 systemctl stop tomcat8 systemctl restart tomcat8

Filed Under: Misc Tagged With: apache, install, restart, server, start, status, stop, tomcat, web

SSSD Report

May 24, 2021

Generate a SSSD report.

#!/bin/bash
log="log"
> $log
sep () { echo "--------------------------------" >> $log; }
sep
echo "SSSD Status" >> $log
sep
systemctl status sssd >> $log
sep
echo "Contents of /etc/resolv.conf" >> $log
sep
cat /etc/resolv.conf >> $log
sep
echo "Contents of /etc/sssd/sssd.conf" >> $log
sep
cat /etc/sssd/sssd.conf >> $log
sep
echo "Versions of /etc/resolv.conf" >> $log
sep
ls -l /etc/resolv.conf* >> $log
sep
echo "Versions of /etc/sssd/sssd.conf" >> $log
sep
ls -l /etc/sssd/sssd.conf* >> $log
sep
echo "Contents of /var/log/sssd-rollout.log" >> $log
sep
cat /var/log/sssd-rollout.log >> $log
sep
echo "Contents of /var/log/sssd-rollout3.log" >> $log
sep
cat /var/log/sssd-rollout3.log >> $log
sep

#!/bin/bash log="log" > $log sep () { echo "--------------------------------" >> $log; } sep echo "SSSD Status" >> $log sep systemctl status sssd >> $log sep echo "Contents of /etc/resolv.conf" >> $log sep cat /etc/resolv.conf >> $log sep echo "Contents of /etc/sssd/sssd.conf" >> $log sep cat /etc/sssd/sssd.conf >> $log sep echo "Versions of /etc/resolv.conf" >> $log sep ls -l /etc/resolv.conf* >> $log sep echo "Versions of /etc/sssd/sssd.conf" >> $log sep ls -l /etc/sssd/sssd.conf* >> $log sep echo "Contents of /var/log/sssd-rollout.log" >> $log sep cat /var/log/sssd-rollout.log >> $log sep echo "Contents of /var/log/sssd-rollout3.log" >> $log sep cat /var/log/sssd-rollout3.log >> $log sep

Filed Under: Linux Tagged With: generate, report, sssd, status

HTTPD on Redhat & Centos

December 4, 2020

Here are the commands to start, stop, enable and get the status of Apache on RHEL and CentOS.

systemctl enable httpd  # enable on bootup
systemctl status httpd  # get status
systemctl start httpd   # start
systemctl stop httpd    # stop
systemctl restart httpd # restart

systemctl enable httpd # enable on bootup systemctl status httpd # get status systemctl start httpd # start systemctl stop httpd # stop systemctl restart httpd # restart

Filed Under: Linux Tagged With: centos, enable, redhat, start, status, stop

NetApp Unlock File

January 15, 2020

To get status of a file.

lock status -f "/vol/folder/path/filename.doc" -p cifs

lock status -f "/vol/folder/path/filename.doc" -p cifs

To unlock a file.

lock break -f "/vol/folder/path/filename.doc" -p cifs

lock break -f "/vol/folder/path/filename.doc" -p cifs

Filed Under: Cloud Tagged With: lock, netapp, status, unlock

Icecast PHP Class

March 14, 2014

I modified an existing Icecast PHP class that I found online. I’ve added a couple of extra fields particularly the ‘status’ field where you’ll be able to determine if your Icecast server is streaming or not. I’ve initially set the status variable to ‘On Air’ and ‘Off Air.’ To use the class, take a look at the code below:

// include the class file
include( 'icecast.php' );
 
// instantiate class
$stream = new IceCast();
 
// set server and mount
$server = 'http://yourdomain.com:8001';
$file   = '/status.xsl?mount=/yourmount.ogg';
 
// set the url
$stream->setUrl($server,$file);
 
// get status info
$radio = $stream->getStatus();
 
// assign array to variables
extract($radio);
 
// echo the status
echo $status.'<br/>';
 
// display more stats if ON AIR
if ($status=='ON AIR') :
echo $listeners.' listeners<br/>';
echo $most_listeners.' max listeners<br/>';
endif;

// include the class file include( 'icecast.php' ); // instantiate class $stream = new IceCast(); // set server and mount $server = 'http://yourdomain.com:8001'; $file = '/status.xsl?mount=/yourmount.ogg'; // set the url $stream->setUrl($server,$file); // get status info $radio = $stream->getStatus(); // assign array to variables extract($radio); // echo the status echo $status.'<br/>'; // display more stats if ON AIR if ($status=='ON AIR') : echo $listeners.' listeners<br/>'; echo $most_listeners.' max listeners<br/>'; endif;

Here’s the Icecast class.

class IceCast {
    var $server = "http://yourdomain.com:8001";
    var $stats_file = "/status.xsl?mount=/yourmount.ogg";
    var $radio_info=array();
 
    function __construct() {
        // build array to store our Icecast stats   
        $this->radio_info['server'] = $this->server;
        $this->radio_info['title'] = '';
        $this->radio_info['description'] = '';
        $this->radio_info['content_type'] = '';
        $this->radio_info['mount_start'] = '';
        $this->radio_info['bit_rate'] = '';
        $this->radio_info['listeners'] = '';
        $this->radio_info['most_listeners'] = '';
        $this->radio_info['genre'] = '';
        $this->radio_info['url'] = '';
        $this->radio_info['now_playing'] = array();
        $this->radio_info['now_playing']['artist'] = 'Unknown';
        $this->radio_info['now_playing']['track'] = 'Unknown';
        $this->radio_info['status'] = 'OFF AIR';
    }
 
    function setUrl($url,$file) {
        $this->server=$url;
        $this->stats_file=$file;
        $this->radio_info['server'] = $this->server;
    }
 
    private function fetch() {
        // create a new curl resource
        $ch = curl_init();
 
        // set the url
        curl_setopt($ch,CURLOPT_URL,$this->server.$this->stats_file);
 
        // return as a string
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
 
        // $output = the status.xsl file
        $output = curl_exec($ch);
 
        // close curl resource to free up system resources
        curl_close($ch);
 
        return $output;
    }
 
    function getStatus() {
        $output=$this->fetch();
 
        // loop through $output and sort arrays
        $temp_array = array();
 
        $search_for = "<td\s[^>]*class=\"streamdata\">(.*)<\/td>";
        $search_td = array('<td class="streamdata">','</td>');
 
        if(preg_match_all("/$search_for/siU",$output,$matches)) {
           foreach($matches[0] as $match) {
              $to_push = str_replace($search_td,'',$match);
              $to_push = trim($to_push);
              array_push($temp_array,$to_push);
           }
        }
 
        if(count($temp_array)) {
            //sort our temp array into our ral array
            $this->radio_info['title'] = $temp_array[0];
            $this->radio_info['description'] = $temp_array[1];
            $this->radio_info['content_type'] = $temp_array[2];
            $this->radio_info['mount_start'] = $temp_array[3];
            $this->radio_info['bit_rate'] = $temp_array[4];
            $this->radio_info['listeners'] = $temp_array[5];
            $this->radio_info['most_listeners'] = $temp_array[6];
            $this->radio_info['genre'] = $temp_array[7];
            $this->radio_info['url'] = $temp_array[8];
 
            if(isset($temp_array[9])) {
                $x = explode(" - ",$temp_array[9]);
                $this->radio_info['now_playing']['artist'] = $x[0];
                $this->radio_info['now_playing']['track'] = $x[1];
            }
            $this->radio_info['status'] = 'ON AIR';
 
        }
        return $this->radio_info;
        }
 
}

class IceCast { var $server = "http://yourdomain.com:8001"; var $stats_file = "/status.xsl?mount=/yourmount.ogg"; var $radio_info=array(); function __construct() { // build array to store our Icecast stats $this->radio_info['server'] = $this->server; $this->radio_info['title'] = ''; $this->radio_info['description'] = ''; $this->radio_info['content_type'] = ''; $this->radio_info['mount_start'] = ''; $this->radio_info['bit_rate'] = ''; $this->radio_info['listeners'] = ''; $this->radio_info['most_listeners'] = ''; $this->radio_info['genre'] = ''; $this->radio_info['url'] = ''; $this->radio_info['now_playing'] = array(); $this->radio_info['now_playing']['artist'] = 'Unknown'; $this->radio_info['now_playing']['track'] = 'Unknown'; $this->radio_info['status'] = 'OFF AIR'; } function setUrl($url,$file) { $this->server=$url; $this->stats_file=$file; $this->radio_info['server'] = $this->server; } private function fetch() { // create a new curl resource $ch = curl_init(); // set the url curl_setopt($ch,CURLOPT_URL,$this->server.$this->stats_file); // return as a string curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // $output = the status.xsl file $output = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); return $output; } function getStatus() { $output=$this->fetch(); // loop through $output and sort arrays $temp_array = array(); $search_for = "<td\s[^>]*class=\"streamdata\">(.*)<\/td>"; $search_td = array('<td class="streamdata">','</td>'); if(preg_match_all("/$search_for/siU",$output,$matches)) { foreach($matches[0] as $match) { $to_push = str_replace($search_td,'',$match); $to_push = trim($to_push); array_push($temp_array,$to_push); } } if(count($temp_array)) { //sort our temp array into our ral array $this->radio_info['title'] = $temp_array[0]; $this->radio_info['description'] = $temp_array[1]; $this->radio_info['content_type'] = $temp_array[2]; $this->radio_info['mount_start'] = $temp_array[3]; $this->radio_info['bit_rate'] = $temp_array[4]; $this->radio_info['listeners'] = $temp_array[5]; $this->radio_info['most_listeners'] = $temp_array[6]; $this->radio_info['genre'] = $temp_array[7]; $this->radio_info['url'] = $temp_array[8]; if(isset($temp_array[9])) { $x = explode(" - ",$temp_array[9]); $this->radio_info['now_playing']['artist'] = $x[0]; $this->radio_info['now_playing']['track'] = $x[1]; } $this->radio_info['status'] = 'ON AIR'; } return $this->radio_info; } }

Filed Under: PHP Tagged With: class, icecast, status

Git Status

November 3, 2012

Git Status is a command to display the status of files in the local working repository. It displays differences of files whether if updated or if it needs to committed to the repository. The Git Status command is typed in Terminal of the local working directory.

git status

git status

Filed Under: Git Tagged With: status

Subversion Status

November 3, 2012

The Subversion Status command give you the status of the local working directory. Type this command in the Terminal to display the status.

svn status

svn status

Filed Under: SVN Tagged With: status

  • Home
  • About
  • Archives

Copyright © 2023