Linux Command Line Check Physical Disk Size

I am going to show you how to get the physical disk size for every disk in your system.

First, open a shell so you can access the command line (CLI). If you are on a server, you should already be there, unless you installed a GUI.

With the CLI ready, there two great commands you can use. They are:

df -HT

fdisk -l | grep Disk

Use either or both of those commands to get the disk sizes. If you get a “permission denied” message, just put sudo front of the command.

I hope that helps!

Install Cockpit on Ubuntu 18

Every Linux guru loves to show off their L33T (elite) cli skills, but sometimes a nice GUI rules. Like when you are monitoring a bunch of servers and just don’t feel like messing around with cryptic commands and ascii characters.

One tool I like for a simple overall of servers is “Cockpit”. After you log in it gives you the basics every sysadmin wants, CPU, Memory, Disk I/O and Network Traffic.

You can get details by selecting the appropriate selection in the sidebar. It’s not the most feature rich server GUI, but it nails the basics, it’s easy to install, and it does the job. Did I mention it’s free?

Read more on the project here:

https://cockpit-project.org/

To install on a server you wish to monitor, log into it and open a command line. If you are using Ubuntu, just hit CTL+T.

Enter each line individually:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install cockpit cockpit-docker

Heads up: if you are run a firewall on your local machine, you will have to open port 9090.

Now that every thing is installed, you can access Cockpit.

From a PC:

  • Open your web browser
  • In the address bar, type in the ip address of the server plus the port like so:
192.168.1.23:9090 
(YOUR server ip address, not this example)

That should open Cockpit to the login screen.

Now log in and you should be at the main menu seeing a bunch of great statistics on your server.

Feel free to select items from the sidebar to get details of your server.

That’s it. I hope you found this useful!

Redirect HTTP to HTTPS

On rare occasions, we see situations where your SSL certificate installation looks perfect but does not redirect the http:// traffic to https:// properly. It may leave you stuck on a white screen, not to be confused with the white screen of death due to improper WordPress setups.

To test that it’s NOT a WordPress problem, just open your index.php file and add echo ‘Hello”; exit(); and test your site. If you get the Hello on either the http or https version of your website, then it’s not a WordPress issue, it’s an HTTPS redirect issue. After troubleshooting, remember to remove the Hello and exit() function or your site won’t work anymore ūüėČ

This redirect issue is a real pain because a lot of visitors don’t type out http or http into the address bar, they just type your domain and the dot-com, or dot-whatever and press Enter. That will likely take your visitor straight to the problematic http leaving them stuck at the white screen. If you have banged your head against the desk trying to figure this one out, join the club.

How To Fix It:

To fix this, open the following file with nano or your fav editor:

/etc/apache2/sites-enabled/yourDomain.com.conf

Look for ServerName www.yourDomain.com and just below it add…

Redirect permanent / https://www.yourDomain.com/

When you are down it should look like this

<VirtualHost *:80>
ServerName www.yourDomain.com
Redirect permanent / https://www.yourDomain.com/

…what ever else was below this line, just leave that alone.
</VirtualHost>

example of altering the yourDomain.com.conf file.

That usually solves it for us and I hope it solves it for you! If you can’t hammer it out, just give us a call.

Moving Windows To New SSD

So you ordered a new SSD to replace your slow-booting hard drive.¬† Awesome!¬† Now…how do you get the data over to the new drive?

If it’s just a data drive, then you could drag-n-drop or use copy, xcopy or Robocopy with mirroring (/MIR) assuming you are tech savvy know how to do this.

But what if you want the drive to be a bootable operating system drive?

Well, that’s a little trickier than you think.¬† You can’t just copy or Robocopy because those tools will not copy necessary system files you need to make your new SSD Windows bootable.¬†¬† Nor will they create the partitions, you have to do that manually.¬† You could attempt your own clone, but if you go clone in the wrong direction, you will lose all your data!¬† So please be careful and have a good backup..

Kayonix can get your data onto the new SSD safely and it will boot as expected.¬† We have decades experience cloning and copying massive amounts of data during builds and rebuilds.¬† We know exactly what to do so everything goes without a hitch while keeping your data safe and achieving your goal…

Getting that new SSD in place for a faster booting, snappier feeling computer!

 

 

 

 

Byobu Autostart

Byobu is a great terminal multiplexer.

You can usually get it on a debian system via:

    • apt install byobu

After it’s installed, just invoke it from the cli:

    • byobu

Now that it’s open, here some common navigation tips:

  • F1 – Brings up the Help and Configuration page
  • F2 – Opens another terminal.  This is indicated at the bottom via: 2:–
  • F3 – Change focus,/go FORWARD one screen.
  • F4 – Change focus/go BACK one screen.

At any time you may look at bottom to see which session you are in:   1:–, 2:–, 3:–, etc

Those commands are the most used and will get you goign in a jiffy, however there are many other options you can read about on the Help page, which can be accessed via F1.

One thing we get alot is, “How do you set it to auto start when I log in?

Easy, just type:

    • byobu-enable

Don’t want it to autostart anymore?  Type:

byobu-disable

That’s it!

Find Your Linux Version

The CLI commands to find your Linux version are easy as pie, but they are also easy as pie to forget.  Let this post be your goto reminder.  To use these commands, simply open a terminal shell. Then type in any of the commans below.  Don‚Äôt type the dollar sign that‚Äôs preceding each command;  It just represents the shell prompt.

My Favorite Way

hostnamectl

KERNEL INFO

All Kernel Information

$ uname -a

Abbreviated Kernel Version

$ uname -r

DISTRIBUTION AND VERSION

$ lsb_release -a

or…

$ cat /etc/lsb-release

or…

$ cat/etc/issue.net

Also try…

Ubuntu

$ lsb_release -a

Debian

$ cat /etc/debian_version

CentOS

$ cat /etc/centos-release

Calculating Sub-Seconds

I just know all you fellow geeks are out there drooling over the answer to this one, so I won’t keep you waiting.

What’s a sub-second, you ask?

Let’s make this easy…

Sub-Seconds and their Equivalents

a SECOND is 1000 milliseconds
a millisecond is 1000 microseconds
a microsecond is 1000 nano seconds
a nanosecond is 1000 picoseconds
a picosecond is 1000 femtoseconds
a femto second is 1000 attoseconds
an atto second is the shortest measurement of time as of May 12, 2010.

Interesting facts about the attosecond

  • 1 attosecond – In this amount of time, light can travel the length of two hydrogen atoms.
  • 24 attoseconds – A single unit of atomic time.
  • One attosend is to one second as one second to 31.71 billion years.
  • The attosecond is the smallest measurement of time man-kind can presently make.

Sub-Seconds to their Negative Powers

  • milli = 10^-3
  • micro = 10^-6
  • nano = 10^-9
  • pico = 10^-12
  • femto = 10^-15
  • atto = 10^-18

Worst CPU Bug Ever Found

WHAT HAS HAPPENED

Have you heard of the two latest threats to your computer security?¬† They are Meltdown and Spectre, and they are serious computer security flaws.¬† It affects Intel processors all the way back to 1995 and potentially AMD CPUs as well.¬† If your computer has been rebooting intermittently lately, it’s a result of patches gone wrong to try and neutralize the problem.

Daniel Gruss – the Graz University of Technology researcher who discovered the problem stated that Meltdown is ‚Äúprobably one of the worst CPU bugs ever found‚ÄĚ

Meltdown is a flaw in security that allows hackers to side-step the hardware barrier separating user apps from your computer’s core memory.

Spectre is a flaw that allows hackers to trick your programs and get access to your secret information.

Meltdown + Spectre = Really Bad News for all computer-users.¬† It won’t be long before hackers start making their attempts now that this information is widely known.¬† Some experts suggest that hackers are already developing hacks and adding them to their hackers tool kits to launch attacks against the unsuspecting and undefended.

Dan Guido, Chief Executive of Cybersecurity for Trail of Bit, stated: ‚ÄúExploits for these bugs will be added to hackers‚Äô standard toolkits.‚ÄĚ

DO YOU HAVE THIS PROBLEM?

Most likely, yes.¬† Every Intel CPU since 1995 has the problem, even though it’s only recently been discovered.¬† This will include all Windows and all Intel Macs.¬† This includes laptops, desktops, tablets, smartphones, and more.

MEASURES TAKEN

Apple, Intel, Microsoft and others have released white papers on the problem and are taking measures to provide solutions.  Apple recommends only downloading updates and apps from the App Store or other trusted sources.  Microsoft has released an emergency patch but is must be installed manually.  Per Microsoft,

Microsoft is aware of a new publicly disclosed class of vulnerabilities that are called ‚Äúspeculative execution side-channel attacks‚ÄĚ that affect¬†many modern processors and operating systems, including Intel, AMD, and ARM.

Note This issue also affects other operating systems, such as Android, Chrome, iOS, and MacOS. Therefore, we advise customers to seek guidance from those vendors.

Clearly this is an emergency situation.  Here are some tips to help avoid trouble until a proper fix is implemented by the major computer companies:

  • Do not download software from unknown sources
  • Be careful opening all emails
  • Don’t download or execute email attachments

WHAT WE CAN DO TO HELP YOU

Call us and let a Kayonix Microsoft Certified Systems Engineer scan and diagnose your computers for problems and implement resolution to eradicate any virus you have and stop any trying to get in.  Let us:

  • Scan for Meltdown/Spectre vulnerability
  • Configure antivirus software
  • Scan for and clean any current virus
  • Resolve performance issues

As always, Kayonix is staying on top of this situation.

SOURCES

Ars Technica

The Guardian

The Verge

Windows Central

Apple

Microsoft

SATA Speeds

People often ask about the speed of SATA. It’s handy to know these speeds when comparing SATA devices like hard drives and SSDs.

First a little background information.  Here is the definition of SATA with some older acronyms thrown in for comparison.

  • SATA – Serial Advanced Technology Attachment
  • PATA – Parallel Advanced Technology Attachment
  • ATA – Advanced Technology Attachment

Perhaps you remember these older hard drive attachments methods.  If so, you can see where SATA got it’s name.

There have been several revisions of SATA.  Here are the major revisions and their speeds:

  • SATA 1.0 = 1.5 Gbps
  • SATA 2.0 = 3 Gbps
  • SATA 3.0 = 6 Gbps
  • SATA 3.1 = 6 Gbps
  • SATA 3.2 = 6 Gbps

Gbps = Gigabits per second

For more about SATA, read Wikipedia.

Speed up your Android Phone

Nothing magical or expensive here, just a couple tips to help speed up your Android phone.

Clear your Phone Cache:

  • Settings\Storage\Cached data
  • Select “OK

Remove Unwanted Apps:

  • Select-Hold the app you want to get rid of
  • Drag up to Remove or Uninstall.

Update Your Apps:

  • App Drawer\Google Play Store
  • Select the Menu icon (three gray lines) at top left.
  • Select My apps and games
  • Select UPDATE ALL

Update Your Phone Software:

  • App Tray\Settings
  • Scroll down to System Update
  • Select Update Software

Remove unwanted Photos and Videos:

  • App Tray\Gallery
  • Select Album
  • Select–Hold photos to remove
  • Select DELETE from upper menu (the three gray dots)

I got these great tips from the Republic Wireless blog.  Check them out some time!