A few facts about scripting language and Why you need to know about Scripting

coding, computer, hacker, hacking, html, programmer, programming, script, scripting, source code, Free Images In PxHere

Is scripting being used in automation?

Scripting can be a powerful tool for anything in the industry from building cars to even creating orders to ship.   Each one has a specific reason to be there,  in all there are many reason why it makes it easier for the user to have scripting.   I know in my life, scripting can be used in many different reason.   For one you could have a PowerShell script to automate a process to wake the daemon or make a service synchronize a service.  In all even in the Microsoft world there are services that need to be restarted or maybe just synched due to the daemon not keeping up.   Having seen this and having to do it from time to time or even create a script to run every hour to keep the what ever might need to be synchronized up to date.   Is that something hard to do or easy, the real questions you should be asking yourself is can you really do it and not make any mistakes?   After all, we are human and bound to make a mistake or two.   So we have to at least consider how any script will affect us in the long run.    Scripting can definitely make certain tasks so much easier when something arises that needs to be done to a server or even process.

What are the options for a script?

Before we begin the options we have to at least consider why scripts are so vastly different from applications.   The short answer is that they can’t do nearly the things applications can because they aren’t integrated into the kernel or there might be processes that the script can’t do without SU permissions and programs can have SU permissions and run in the background without any need for verification from the user.  Now let’s at least talk about the options for what a script  be used for or how we should at least consider it to be used.   First and foremost is to restart a process, and this one is the most common I have seen in the past.   I used to have to restart the Xorg services or drivers due to how the applications caused it to crash for one reason or another in Linux.   This was definitely when the drivers for Nvidia and AMD were still relatively new to the Linux environment.   It would on occasion need to be restarted and people started to have script to use to do that so they didn’t have to write the same codes down each time to restart the service.  This was truly cutting edge for Linux to be able to use a script to restart the graphics drivers and allow the user to continue to use their computer.   Another good option for tasks that can be scripted is downloading files that you might use for Windows and have them update with newest version as they are coming.  You could even create a script to download all the Windows Updates on Linux just like you can on Windows to be able to install them offline if the need arises.

Scripts are just Amazing!

As you can see, I really do love to use scripts and have in the past come up with scripts that can be used for the people who use Linux or might need a script for a certain situation.   Each person can come up with some truly amazing scripts to share with others to help make working in the Linux environment even more better for everyone.  Do you agree or disagree?  Do you have a favorite script you want to share with others?  why not leave a comment and let people know your script and tell them what OS it can be used on.   I am going to link a few good useful bash scripts to let you explore even more.

 

How to Install your Favorite Apps on Linux OS.

Photo by Markus Spiske temporausch.com from Pexels

Command Line Rocks

I simply love using command in Linux.   I currently using Linux Mint because I didn’t want to upgrade my laptop to Windows 10.   If you know anything about Linux, they seldom install the necessary apps for Laptops or Desktops.   You’d have to install them separately and some of the apps do some really useful things on Linux.   Such as the touch pad inidcator which will disable the touch pad when you are typing or when you are using a mouse.   I hate to use the Graphical User Interface to find and install these apps.  So I decided to create a shell script to install the needed laptop apps for any installation of Linux on a Laptop.  I do like to install programs from the GUI but that is when I am looking to install one program or just curious what they’ve added to the Synaptic Package Manager.   Since most of these apps are open sourced, I thought it would be nice to show you how to create a shell script that you might want to use from time to time.  The nice thing this helps if you are re-installing Linux or installing Linux on a new laptop Linux.

Creating a Shell Script

Before you begin this process, you’ll want to wrap your head around how to create the Linux script.  Once you learn about the process of creating the script.  You will understand more about the next process but you should at least get the basics so you can know what you can and can’t do in a script.   A shell script is almost like a batch file in Windows and you can do a lot of things in it.  Some things you can do are If/then or Echo, or Sudo commands.   If you want to make a complicated menu then that is fine also. I believe simplistic is best.   So I created my own little simple script to install the laptop apps that will help me on my laptop.

Laptop-linuxinstall.sh

echo Installing Touchpad Inidcator
sudo add-apt-repository ppa:atareao/atareao
sudo apt update
sudo apt install touchpad-indicator

echo installing cpu frequency Inidcator
sudo add-apt-repository ppa:artfwo/ppa
sudo apt update
sudo apt-get indicator-cpufreq

echo Installing Battery Optimization
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo tlp start

echo Installing Laptop Mode Tools
sudo add-apt-repository ppa:ubuntuhandbook1/apps
sudo apt-get update
sudo apt-get install laptop-mode-tools

You could easily copy this and paste it into a text editor and start using it right away but I hope you at least learn about scripting.   This script will work with Linux Mint or Ubuntu, but I am unclear if it will work with other Linux OS.  This is why you will want to learn the create your own script because you might have to modify or add new lines into the script.  If you decide to use Laptop Mode tools, I suggest you read about how to configure the tools once you installed it.

Changing Permission in Linux

Changing Permissions

Once you have created the script and saved it to a file you will need to change the permissions of the file so Linux can run it from command line or if you decide to run it from the GUI.   You can either right click the file > Properties then go into permissions (See above for example) and check mark “Allow executing file as a program” or go into terminal mode.

Go to where the file is located and type “sudo chmod +x filename.sh”  and enter your Password.  Once this is done you can now either use the GUI or type “./locationoffile/file.sh” in the terminal.

All is Good!

After you have done all that, You now should keep the shell script on several locations so you can always use it if you need it.   I occasionally like to reinstall Linux to keep the system running smoothly so that is why I created shell scripts to install my favorite programs or stuff I might want to use on my laptop.   Do you have a favorite application or a suggestion please feel free to leave a comment below.   I’d love to hear what you install on your Linux OS and why.