Find Shutdown Log Windows 10

The other day while working at a client’s office I had to deploy an application update using a Thin Client management console. I pushed the update to all Thin Clients. Shutdown Log Windows 10

This was supposed to be a non-intrusive deployment of the application – meaning the Thin Clients were not supposed to reboot. One Thin Client rebooted and I needed to find out why.

In Windows 10 there are three events that gives you information about reboots and shutdown:

Event ID 1074 – Indicates that the shut down process was initiated by an app. For example, it can be Windows Update.

Event ID 6006 – The clean shut down event. This means Windows 10 was turned off correctly.

Event ID 6008 – Indicates a dirty/improper shutdown. Appears in the log when the previous shutdown was unexpected, e.g. due to power loss or etc.

To find these events simply do:

  • Press Windows key + R one the keyboard to open the Run dialog and then type eventvwr.msc followed by enter.
  • In Event Viewer, select Windows Logs and then System on the left.
  • On the right, click on the link Filter Current Log.
  • In the next dialog, type the line 1074, 6006, 6008 into the text box under Includes/Excludes Event IDs.
  • Click OK to filter the event log.

Now, the Event Viewer will display only events related to shut down and you can investigate reasons why. Hope this Find Shutdown Log Windows 10 brief tutorial helps.

Now, go see my sister website NYC Moments to see inspirational pictures of New York City.

How to Generate SSH Key Pair in Linux

The other day I got a new laptop and needed to generate ssh key pair. Sometimes you forget basic commands when you don’t run them on a daily basis. So, I took a short walk in Brooklyn, New York City before I started working on my new laptop setup.

To generate ssh key pair in Linux is quite simple. Use the ssh-keygen command. Open your Terminal and type:

ssh-keygen -t rsa

Next, you will need to specify the location of the file where you want to save the key such as for example:

Enter file in which to save the key (/home/youruser/.ssh/id_rsa):

Don’t type anything to leave your key at the default location with the default name /home/youruser/.ssh/id_rsa. If you want to you can specify a different name. I do this when I need to ssh to different servers, this helps me keep organized.

Finally, you will need to type a password if you like:

Enter passphrase (empty for no passphrase):

I usually leave it empty, but this is really up to you.

This will create a private key written to: /home/youruser/.ssh/id_rsa 

and a public key written /home/youruser/.ssh/id_rsa.pub

Copy the contents of your .pub file into your server’s .ssh/authorized_keys

Now you should be able to SSH to your server without using a password. Give it a try and Contact me if you have any questions.

Change Default Shell to bash macOS Big Sur

The other day I got a new Apple M1 processor chip (I really don’t like there’s only two ‘USB-4’ ports and the ‘Magic bar’ bothers me!). But, anyways when I opened my terminal i noticed the below message and wanted to change default shell to bash for this macOS Bir Sur.

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.

I got used to bash on my nice old friend macOS High Sierra. So, I found a way to change default shell to bash for it. Before changing this I brewed one of my favorite Latin America coffees from Honduras.

How Change Default Shell to bash macOS Big

This is very easy to do:

  1. Open your terminal
  2. List available shells by typing: cat /etc/shells
  3. To change your account to use bash type: chsh -s /bin/bash
  4. Close your terminal
  5. Open your terminal and verify that bash is your default shell running: echo "$SHELL" or printf "%s\n" "$SHELL"
  6. You should see the following output: /bin/bash

Find out your current bash version

Simple, type this command in your terminal:

bash --version

Hope this quick tutorial was helpful. See my other quick tips on Docker.

Python’s built-in HTTP server handy one

While building my own Flask application for learning purposes. I was not sure how it was being served on the web. I did not install Apache of any other web server, but it is running on my Digital Ocean test server. The I found out about Python’s built-in HTTP server.

This final purpose of this app is to keep track of your blood pressure at home. I will keep you posted about the progress. You can also see my Github repo and offer any suggestions if you like.

Anyways, after having a great cup of Latin America coffee I discovered that Python has an standard HTTP server built into the standard library. So, when I run my CMD python run.py at the end of my Dockerfile it starts the Python standard HTTP build-in server for me.

If you like to run it alone for other testing purposes you can do the below.

For Python 3.x:

python3 -m http.server

For Python 2.x

python -m SimpleHTTPServer 8000

This will serve the current directory at your http://localhost:8000 or http://127.0.0.1:8000

Python’s built-in HTTP server is a useful standard library that I was not aware or did not occur to think about it until today. Don’t know why.

I invite you to check my other posts about setting up Ubuntu server static IP. Thanks and let me know if you have any questions.

How to Check Linux OS version Command Line

While having a great Latin America coffee from Ecuador I came to realize that I did not remember how to check Linux OS version using the command line.

Below are some examples for finding your Linux OS version. Open your command line:

/etc/os-release file

Type the following command using cat in Debian based distros:

cat /etc/os-release

I got the below result in my terminal:

Check Linux OS version Command Debian

/proc/version file

Using cat /proc/version worked for me for both Debian and Red Hat distros. Simply run:

cat /proc/version

And you should get the below result:

Linux version 4.4.0-198-generic (buildd@lgw01-amd64-051) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) )

Other commands to find Linux OS version

Try running in your terminal the below commands and experiment to see what output you get. If your Linux distro does not support it you should get a “command not found” error.

cat /etc/issue
hostnamectl
uname -a
lsb_release -a (mainly for Debian distros)

Basic Linux Commands for Newbies

The other day one of my friends who is a Windows user asked me to basic Linux commands because he wanted to improve his IT skills. I helped him out and also decided to put together a brief list of basic Linux commands for newbies while having fantastic Latin America coffee at home.

Basic Linux Files and Navigation Commands

CommandDescription
lsList of files/directories in current directory
ls -lFormatted listing
ls -laFormatted listing including hidden files
cd <dir>Change directory to <dir>(<dir> is directory name)
cdGo to your home directory
pwdShow current path
mkdirMake a directory e.g. mkdir holadir
rmRemove a file e.g. rm myfile
rm -rDelete a directory e.g. rm -r mydirectory
cpCopy files e.g. cp myfile yourfile
mvRename files e.g. mv myfile yourfile
Files and Navigation Linux Commands

Networking Basic Linux

CommandDescription
pingPing a host
whoisGet whois for a domain
digGet DNS for a domain
wgetDownload a file
wget -r <url>Recursively download files from url
curl <url>Output webpages from url
ssh user@hostConnect to host as user
ssh -p <port> user@hostConnect to host as user using a port
ssh -D user@hostConnect and use bind port
Basic Networking Linux Commands
Continue reading “Basic Linux Commands for Newbies”

List Installed Packages in Red Hat, CentOS and Fedora

I usually work on Debian based Linux distros, but the other day while sorting some NYC street photos I took a friend contacted me asking me how to list installed packages in Red Hat, CentOS and Fedora.

  1. Using RPM Package Manager
  2. Using YUM Package Manager
  3. Using YUM-Utils

Using RPM Package Manager

The RPM package manager is an open source, low level package manager which runs on Red Hat based Linux distros. You can list installed Packages in Red Hat very easy with rpm.

The following command will print a list of all installed packages on your Linux box, the flag -q means query and the flag -a means to list all installed packages:

rpm -qa

Using YUM Package Manager

YUM stands for Yellowdog Updater Modified is an interactive, front-end rpm based package manager.

Using the command below will list all installed packages on your Linux box. One cool thing about this Linux package manager is that it lists the repository from which a package was installed:

yum list installed

Using YUM-Utils

Yum-utils is an assortment of tools and programs for managing yum repositories in your Linux box. Using this tool you can install debug packages, source packages and you can view extended information from repositories. You might need to install it using yum:

yum update && yum install yum-utils

Once you have Yum-Utils installed run the following command in your Linux terminal to list all installed packages:

repoquery -a --installed

Run Docker without sudo Linux

To run Docker without sudo in Linux is quite simple. Using your terminal in Linux and a couple simple commands shown below. You don’t need to be an expert Linux guru software developer to go thru these steps.

If you don’t want to preface the docker command with sudo, create a Linux group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.

Create the docker group:

sudo groupadd docker

Add your user to the docker group:

sudo usermod -aG docker $USER

Log out and log back to activate the group membership in Linux or you can run:

newgrp docker

Now, verify you can run docker without sudo:

docker ps
docker run hello-world

That is all! Super simple, anybody can do it. Now go brew better coffee at home. Contact me using the comments below or shoot me an email using my contact page.

What are SEO stop words summary

Stop words SEO are words such as ‘at’, ‘any’, ‘before’, ‘which’. While having putting together some New York City pictures for my NYC Moments website I took the other day I found myself learning more about SEO. I put together a little list of stop words in SEO. Using them in your permalink is therefore a waste of valuable space.

List of SEO stop words

a
about
above
after
again
against
all
am
an
and
any
are
as
at
be
because
been
before
being
below
between
both
but
by
could
did
do
does
doing
down
during
each
few
for
from
further
had
has
have
having
he
he'd
he'll
he's
her
here
here's
hers
herself
him
himself
his
how
how's
i
i'd
i'll
i'm
i've
if
in
into
is
it
it's
its
itself
let's
me
more
most
my
myself
nor
of
on
once
only
or
other
ought
our
ours
ourselves
out
over
own
same
she
she'd
she'll
she's
should
so
some
such
than
that
that's
the
their
theirs
them
themselves
then
there
there's
these
they
they'd
they'll
they're
they've
this
those
through
to
too
under
until
up
very
was
we
we'd
we'll
we're
we've
were
what
what's
when
when's
where
where's
which
while
who
who's
whom
why
why's
with
would
you
you'd
you'll
you're
you've
your
yours
yourself
yourselves

Removing stop words from your permalink will give you more space for keywords.

If you like this small post and feeling generous get one of my T-Shirts and coffee mugs designs below. Thanks!

Docker error: Cannot start service …: network 0927c not found

I have never seen this Docker error: Cannot start service while using docker-compose in the short time I have been using Docker.

While having amazing Latin America coffee from Honduras I decided to jump back into my personal Flask project. This project is mainly to keep track of your blood pressure by taking daily readings and keeping a record. This record can then be shared with your doctor by email, PDF printout or by giving your doctor access to your profile.

Using Docker with docker-compose I got this “Docker error: Cannot start service…..”

Docker error: Cannot start service …: network 5f9226bdb324e31fa4e4bff6777b18b329dc7e6c55e7a2dca5c72601ff10927c not found

Doing a little research I found out that I did not properly stopped my running containers. I lost track of this project and then did not remember what was the last thing I did. This is not good! Always keep track of your projects specially with learning something new. I use Trello to keep a bit more organized and know what was the last thing I did.

To fix the above error I simply ran this two commands in my working project directory:

docker-compose down
docker-compose up -d <or without the -d>

It was all fixed and I got to go for a walk in NYC! Happy learning!