• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

start

Migrate VM to Other Network

July 20, 2021

Here’s how to move a VM to another network.

Stop the VM.

gcloud compute instances stop server-name \
--zone=us-central1-c \
--project project-id

gcloud compute instances stop server-name \ --zone=us-central1-c \ --project project-id

Migrate the VM. Use self link for network and subnetwork.

gcloud compute instances network-interfaces update server-name \
--zone=us-central1-c \
--network-interface=nic0 \
--network=your-network \
--subnetwork=your-sub-network \
--project project-id

gcloud compute instances network-interfaces update server-name \ --zone=us-central1-c \ --network-interface=nic0 \ --network=your-network \ --subnetwork=your-sub-network \ --project project-id

Start the VM.

gcloud compute instances start server-name \
--zone=us-central1-c \
--project project-id

gcloud compute instances start server-name \ --zone=us-central1-c \ --project project-id

Filed Under: Cloud Tagged With: compute, gcloud, gcp, instance, move, network, network-interface, start, stop

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

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

Run Docker Compose

February 27, 2020

Here’s how to run docker-compose. I have an Icecast docker-compose.yml file. Icecast is an audio streaming server.

version: "2"
 
services:
  icecast:
    image: moul/icecast
    environment:
      - ICECAST_SOURCE_PASSWORD=secret
      - ICECAST_ADMIN_PASSWORD=secret
      - ICECAST_PASSWORD=secret
      - ICECAST_RELAY_PASSWORD=secret
    ports:
      - "8000:8000"
    restart: always

version: "2" services: icecast: image: moul/icecast environment: - ICECAST_SOURCE_PASSWORD=secret - ICECAST_ADMIN_PASSWORD=secret - ICECAST_PASSWORD=secret - ICECAST_RELAY_PASSWORD=secret ports: - "8000:8000" restart: always

To run Icecast in a container , I run docker-compose in the background.

docker-compose up -d

docker-compose up -d

Check to see if Icecast is running on your browser.

http://localhost:8000

http://localhost:8000

To stop the Icecast container, I simply stop the docker-compose.

docker-compose stop

docker-compose stop

Here are the other docker commands you can run.

docker images
docker ps
docker-compose ps

docker images docker ps docker-compose ps

Filed Under: Cloud Tagged With: docker, docker-compose, icecast, start, stop

Wowza 4.8.0 Scripts

February 22, 2020

Here are the start and stop scripts for the lastest Wowza version 4.8.0.

Start scripts

sudo service WowzaStreamingEngine start
# or
/etc/init.d/WowzaStreamingEngine start

sudo service WowzaStreamingEngine start # or /etc/init.d/WowzaStreamingEngine start

Stop scripts

sudo service WowzaStreamingEngine stop
# or
/etc/init.d/WowzaStreamingEngine stop

sudo service WowzaStreamingEngine stop # or /etc/init.d/WowzaStreamingEngine stop

Filed Under: Cloud Tagged With: 4.8.0, script, start, stop, wowza

GCP Start Multiple Instances

January 19, 2020

Here’s how to start multiple instances using Bash and Google SDK.

#!/bin/bash
while IFS=', ' read -r a b c; do
  instance="${a//[[:blank:]]/}"
  project="${b//[[:blank:]]/}"
  zone="${c//[[:blank:]]/}"
  echo "Starting $instance ...."
  gcloud compute instances start $instance \
  --zone $zone --project $project --async
done < instance-list.txt

#!/bin/bash while IFS=', ' read -r a b c; do instance="${a//[[:blank:]]/}" project="${b//[[:blank:]]/}" zone="${c//[[:blank:]]/}" echo "Starting $instance ...." gcloud compute instances start $instance \ --zone $zone --project $project --async done < instance-list.txt

Instances are read from an external file. The file format is displayed below.

server1,project1,us-central1-a
server2,project2,us-central1-b
server3,project3,us-central1-c

server1,project1,us-central1-a server2,project2,us-central1-b server3,project3,us-central1-c

To stop multiple instances, replace “start” with “stop.”

Filed Under: Cloud Tagged With: compute, gcloud, instances, multiple, sdk, start, stop

AWS RDS Start and Stop Policy

August 29, 2019

Here’s a IAM policy that you can add to an IAM user or an IAM role so they are able to start and stop a specific RDS instance.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Condition": {
                "StringEqualsIgnoreCase": {
                    "rds:db-tag/Application": "application-name"
                }
            },
            "Action": [
                "rds:DescribeDBInstances",
                "rds:StartDBInstance",
                "rds:StopDBInstance"
            ],
            "Resource": "arn:aws:rds:us-east-1:xxxxxxxxxxxx:db:db-instance-name",
            "Effect": "Allow"
        }
    ]
}

{ "Version": "2012-10-17", "Statement": [ { "Condition": { "StringEqualsIgnoreCase": { "rds:db-tag/Application": "application-name" } }, "Action": [ "rds:DescribeDBInstances", "rds:StartDBInstance", "rds:StopDBInstance" ], "Resource": "arn:aws:rds:us-east-1:xxxxxxxxxxxx:db:db-instance-name", "Effect": "Allow" } ] }

Filed Under: Cloud Tagged With: aws, instances, policy, rds, start, stop

GCP CLI Start Stop Instances

March 12, 2019

Here’s the CLI commands to start and stop Google Cloud instances.

gcloud compute instances start server-name --zone=us-central1-c
gcloud compute instances stop server-name --zone=us-central1-c
gcloud compute instances reset server-name --zone=us-central1-c

gcloud compute instances start server-name --zone=us-central1-c gcloud compute instances stop server-name --zone=us-central1-c gcloud compute instances reset server-name --zone=us-central1-c

Filed Under: Cloud Tagged With: cloud, google, instances, start, stop

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023