Myriam  Rogahn

Myriam Rogahn

1598933400

Execute Commands on Remote Machines using sshpass

In this blog I am going to explain how sshpass can help us to increase productivity in our day to day system admin job. Although it is not a secure way to connect to the remote machine, still we can use sshpass for connecting on intranet machines to run different commands to quickly get the results like checking the uptime of a remote machine, check the disk usage of a remote machine, or check the software version of a machine, etc.

Typically we used to run the ssh command to log in to a remote machine either by key-based login or using username and password. In this process we have to log in to the remote machine then run the command to get the desired result but if we can run the command on a remote machine from our own machine and can get the result on the same machine rather than on the remote machine then… :) For that we have sshpass which enables this functionality.

Using** sshpass**, we can execute the command on the remote machine directly from our machine and can get the result from a remote machine. So this is the introduction of sshpass now let’s move forward and start implementing it but before that we need to install sshpass.

Install sshpass:

I am going to explain how we can install sshpass on CentOS-based distribution and Ubuntu based distribution.

  1. CentOS-based distribution
yum -y install sshpass
  1. Ubuntu-based distribution
apt-get install sshpass

By executing the above command, we can install sshpass on our machine. After installing sshpass we can see the help related to sshpass by typing following command:

sshpass -h

Which gives us the following response:

Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
 -f filename Take password to use from file
 -d number Use number as file descriptor for getting password
 -p password Provide password as argument (security unwise)
 -e Password is passed as env-var "SSHPASS"
 With no parameters - password will be taken from stdin
 -h Show help (this screen)
 -V Print version information

By seeing the help command response you may have an idea how we can execute the command. Now let’s execute the command to perform the commands on a remote server.

To get the uptime details of a remote machine we can execute the following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'uptime'

If we want to see the machine details we can execute following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'uname -a'

To check the disk usage we need to run following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'df -h'

#servers #automation #sshpass #ssh #remote-working

What is GEEK

Buddha Community

Execute Commands on Remote Machines using sshpass
Ray  Patel

Ray Patel

1625843760

Python Packages in SQL Server – Get Started with SQL Server Machine Learning Services

Introduction

When installing Machine Learning Services in SQL Server by default few Python Packages are installed. In this article, we will have a look on how to get those installed python package information.

Python Packages

When we choose Python as Machine Learning Service during installation, the following packages are installed in SQL Server,

  • revoscalepy – This Microsoft Python package is used for remote compute contexts, streaming, parallel execution of rx functions for data import and transformation, modeling, visualization, and analysis.
  • microsoftml – This is another Microsoft Python package which adds machine learning algorithms in Python.
  • Anaconda 4.2 – Anaconda is an opensource Python package

#machine learning #sql server #executing python in sql server #machine learning using python #machine learning with sql server #ml in sql server using python #python in sql server ml #python packages #python packages for machine learning services #sql server machine learning services

Myriam  Rogahn

Myriam Rogahn

1598933400

Execute Commands on Remote Machines using sshpass

In this blog I am going to explain how sshpass can help us to increase productivity in our day to day system admin job. Although it is not a secure way to connect to the remote machine, still we can use sshpass for connecting on intranet machines to run different commands to quickly get the results like checking the uptime of a remote machine, check the disk usage of a remote machine, or check the software version of a machine, etc.

Typically we used to run the ssh command to log in to a remote machine either by key-based login or using username and password. In this process we have to log in to the remote machine then run the command to get the desired result but if we can run the command on a remote machine from our own machine and can get the result on the same machine rather than on the remote machine then… :) For that we have sshpass which enables this functionality.

Using** sshpass**, we can execute the command on the remote machine directly from our machine and can get the result from a remote machine. So this is the introduction of sshpass now let’s move forward and start implementing it but before that we need to install sshpass.

Install sshpass:

I am going to explain how we can install sshpass on CentOS-based distribution and Ubuntu based distribution.

  1. CentOS-based distribution
yum -y install sshpass
  1. Ubuntu-based distribution
apt-get install sshpass

By executing the above command, we can install sshpass on our machine. After installing sshpass we can see the help related to sshpass by typing following command:

sshpass -h

Which gives us the following response:

Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
 -f filename Take password to use from file
 -d number Use number as file descriptor for getting password
 -p password Provide password as argument (security unwise)
 -e Password is passed as env-var "SSHPASS"
 With no parameters - password will be taken from stdin
 -h Show help (this screen)
 -V Print version information

By seeing the help command response you may have an idea how we can execute the command. Now let’s execute the command to perform the commands on a remote server.

To get the uptime details of a remote machine we can execute the following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'uptime'

If we want to see the machine details we can execute following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'uname -a'

To check the disk usage we need to run following command:

sshpass -p 'yourpassword' ssh user@192.168.12.xx 'df -h'

#servers #automation #sshpass #ssh #remote-working

Arvel  Parker

Arvel Parker

1591627260

How to Use the Screen Command in Linux

Screen is a terminal program in Linux which allows us to use a virtual (VT100 terminal) as full-screen window manager which multiplexes an open physical terminal between multiple processes, which are typically, interactive shells. It allows us to access multiple terminal sessions within a single terminal or a remote terminal session. It is most useful when addressing multiple Linux shell commands on the command line, as well as separating commands from the shell that started the commands.

Screen also allows a user to initiate a command from one terminal, disconnect from that terminal, and then reconnect from a different location to that same terminal, while using a different terminal without having to restart the command. This simply lets a user better control multiple and separate command windows.

Screen also lets multiple remote computers connect to the same screen session at once. This allows multiple users to connect to the same screen session allowing a second user to follow along with another administrator working on a server.

#tutorials #attach #cli #command line #detach #key bindings #logging #multiplex #multiuser #multiuser mode #remote access #remote management #remote session #remote terminal #screen #screen logging #screen session #screenlog #screens #scrollback #shell #terminal #terminal session #terminal window #tty #vt100

Why Use WordPress? What Can You Do With WordPress?

Can you use WordPress for anything other than blogging? To your surprise, yes. WordPress is more than just a blogging tool, and it has helped thousands of websites and web applications to thrive. The use of WordPress powers around 40% of online projects, and today in our blog, we would visit some amazing uses of WordPress other than blogging.
What Is The Use Of WordPress?

WordPress is the most popular website platform in the world. It is the first choice of businesses that want to set a feature-rich and dynamic Content Management System. So, if you ask what WordPress is used for, the answer is – everything. It is a super-flexible, feature-rich and secure platform that offers everything to build unique websites and applications. Let’s start knowing them:

1. Multiple Websites Under A Single Installation
WordPress Multisite allows you to develop multiple sites from a single WordPress installation. You can download WordPress and start building websites you want to launch under a single server. Literally speaking, you can handle hundreds of sites from one single dashboard, which now needs applause.
It is a highly efficient platform that allows you to easily run several websites under the same login credentials. One of the best things about WordPress is the themes it has to offer. You can simply download them and plugin for various sites and save space on sites without losing their speed.

2. WordPress Social Network
WordPress can be used for high-end projects such as Social Media Network. If you don’t have the money and patience to hire a coder and invest months in building a feature-rich social media site, go for WordPress. It is one of the most amazing uses of WordPress. Its stunning CMS is unbeatable. And you can build sites as good as Facebook or Reddit etc. It can just make the process a lot easier.
To set up a social media network, you would have to download a WordPress Plugin called BuddyPress. It would allow you to connect a community page with ease and would provide all the necessary features of a community or social media. It has direct messaging, activity stream, user groups, extended profiles, and so much more. You just have to download and configure it.
If BuddyPress doesn’t meet all your needs, don’t give up on your dreams. You can try out WP Symposium or PeepSo. There are also several themes you can use to build a social network.

3. Create A Forum For Your Brand’s Community
Communities are very important for your business. They help you stay in constant connection with your users and consumers. And allow you to turn them into a loyal customer base. Meanwhile, there are many good technologies that can be used for building a community page – the good old WordPress is still the best.
It is the best community development technology. If you want to build your online community, you need to consider all the amazing features you get with WordPress. Plugins such as BB Press is an open-source, template-driven PHP/ MySQL forum software. It is very simple and doesn’t hamper the experience of the website.
Other tools such as wpFoRo and Asgaros Forum are equally good for creating a community blog. They are lightweight tools that are easy to manage and integrate with your WordPress site easily. However, there is only one tiny problem; you need to have some technical knowledge to build a WordPress Community blog page.

4. Shortcodes
Since we gave you a problem in the previous section, we would also give you a perfect solution for it. You might not know to code, but you have shortcodes. Shortcodes help you execute functions without having to code. It is an easy way to build an amazing website, add new features, customize plugins easily. They are short lines of code, and rather than memorizing multiple lines; you can have zero technical knowledge and start building a feature-rich website or application.
There are also plugins like Shortcoder, Shortcodes Ultimate, and the Basics available on WordPress that can be used, and you would not even have to remember the shortcodes.

5. Build Online Stores
If you still think about why to use WordPress, use it to build an online store. You can start selling your goods online and start selling. It is an affordable technology that helps you build a feature-rich eCommerce store with WordPress.
WooCommerce is an extension of WordPress and is one of the most used eCommerce solutions. WooCommerce holds a 28% share of the global market and is one of the best ways to set up an online store. It allows you to build user-friendly and professional online stores and has thousands of free and paid extensions. Moreover as an open-source platform, and you don’t have to pay for the license.
Apart from WooCommerce, there are Easy Digital Downloads, iThemes Exchange, Shopify eCommerce plugin, and so much more available.

6. Security Features
WordPress takes security very seriously. It offers tons of external solutions that help you in safeguarding your WordPress site. While there is no way to ensure 100% security, it provides regular updates with security patches and provides several plugins to help with backups, two-factor authorization, and more.
By choosing hosting providers like WP Engine, you can improve the security of the website. It helps in threat detection, manage patching and updates, and internal security audits for the customers, and so much more.

Read More

#use of wordpress #use wordpress for business website #use wordpress for website #what is use of wordpress #why use wordpress #why use wordpress to build a website

Useful Example for the mv command in Linux

mv Command Examples
Below is the basic mv command examples on Linux terminal.

  • Rename file in current directory – For example rename file source.txt to dest.txt in current directory.
  • Move file to destination directory – Move a source.txt file available in current directory to /tmp directory. In above command the file name is unchanged at target directory. You can also rename file name at destination directory just by providing filename at destination.
  • Move file from source directory to destination directory – We can also move files or directory from some other directory to destination directory.
  • Move multiple files to destination at once – The mv accepts multiple source files and move them to the destination directory at once. The following command will move file1.txt, file2.txt in current directory and /opt/file3.txt to the /tmp directory. Here the last command line parameter is used as destination by the mv command.

#linux commands #command #mv #useful example #mv command #linux