Category Archives: Linux

How to Install or Remove Windows PowerShell in Ubuntu/Lubuntu Linux

How to Install or Remove Windows PowerShell in Ubuntu/Lubuntu Linux

What is PowerShell? PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on 18 August 2016 with the introduction of PowerShell Core.

How to install

We are going to use the snap command and the –classic preffix

snap install powershell --classic

And if we need to remove PowerShell

snap remove powershell

Why to use PowerShell anyway?

Windows Power Shell is an application that specializes in Windows commands, but that doesn’t mean that some people wouldn’t have to use it while running Linux.

how to install zoom ubuntu lubuntu linux terminal

How to install Zoom on Ubuntu or Lubuntu (latest version) using terminal

What is zoom? Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars. You can use free and payed versios.

How to download

wget https://zoom.us/client/latest/zoom_amd64.deb
Code language: JavaScript (javascript)

How to install

sudo apt install ./zoom_amd64.deb

How to speed up apt downloads using apt-fast in ubuntu

Have you ever had to install a lot of updates? And does it take you a long time? Keeping our systems always up to date is important, but it’s also important to save time and optimize our work.
Apt-fast is a script that allows each package to be pulled from multiple locations during its download. This in turn leads to faster download of all packages, and this leads to faster completion of our work on updating and installing packages.

First things first, lets add the repository, download and install app-fast

sudo add-apt-repository ppa:apt-fast/stable sudo apt-get update sudo apt-get install apt-fast
Code language: JavaScript (javascript)

Now you can use it just like apt-get or apt

sudo apt-fast update sudo apt-fast upgrade sudo apt-fast dist-update

Here is the output of apt-fast installing bmon

root@webleit:~# apt-fast install bmon bmon 1:4.0-6 45KiB libconfuse2 3.2.2+dfsg-1 24KiB libconfuse-common 3.2.2+dfsg-1 5.4KiB libnl-route-3-200 3.4.0-1 146KiB Download size: 219KiB Do you want to download the packages? [Y/n] 02/20 17:07:47 [NOTICE] Downloading 4 item(s) 02/20 17:07:47 [NOTICE] Verification finished successfully. file=/var/cache/apt/apt-fast/libconfuse2_3.2.2+dfsg-1_amd64.deb 02/20 17:07:47 [NOTICE] Download complete: /var/cache/apt/apt-fast/libconfuse2_3.2.2+dfsg-1_amd64.deb 02/20 17:07:47 [NOTICE] Verification finished successfully. file=/var/cache/apt/apt-fast/libnl-route-3-200_3.4.0-1_amd64.deb 02/20 17:07:47 [NOTICE] Download complete: /var/cache/apt/apt-fast/libnl-route-3-200_3.4.0-1_amd64.deb 02/20 17:07:47 [NOTICE] Verification finished successfully. file=/var/cache/apt/apt-fast/libconfuse-common_3.2.2+dfsg-1_all.deb 02/20 17:07:47 [NOTICE] Download complete: /var/cache/apt/apt-fast/libconfuse-common_3.2.2+dfsg-1_all.deb 02/20 17:07:47 [NOTICE] Verification finished successfully. file=/var/cache/apt/apt-fast/bmon_1%3a4.0-6_amd64.deb 02/20 17:07:47 [NOTICE] Download complete: /var/cache/apt/apt-fast/bmon_1%3a4.0-6_amd64.deb Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= a26dfb|OK | 5.6MiB/s|/var/cache/apt/apt-fast/libconfuse2_3.2.2+dfsg-1_amd64.deb adf53e|OK | 10MiB/s|/var/cache/apt/apt-fast/libnl-route-3-200_3.4.0-1_amd64.deb 977019|OK | 2.6MiB/s|/var/cache/apt/apt-fast/libconfuse-common_3.2.2+dfsg-1_all.deb 77f61e|OK | 5.4MiB/s|/var/cache/apt/apt-fast/bmon_1%3a4.0-6_amd64.deb Status Legend: (OK):download completed. Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libconfuse-common libconfuse2 libnl-route-3-200 The following NEW packages will be installed: bmon libconfuse-common libconfuse2 libnl-route-3-200 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/224 kB of archives. After this operation, 798 kB of additional disk space will be used. Do you want to continue? [Y/n] y
Code language: Bash (bash)

In case during download a file crashes you can use the command clean

sudo apt-fast clean
How to install Lubuntu 20.10 on Windows 10 Hyper-V

How to install Lubuntu 20.10 on Windows 10 Hyper-V

If you need a lite and fast Linux for your test in windows 10 – Lubuntu is definitely an option.

What is lubuntu?

Lubuntu is a fast and lightweight operating system with a clean and easy-to-use user interface. It is a Linux system, that uses the minimal desktop LXDE/LXQT, and a selection of light applications. Because of this, Lubuntu has very low hardware requirements. Lubuntu was founded by Mario Behling and has been grown for many years by Julien Lavergne.

Today we are going to try it by installing it on a hyper-v server here is a video tutorial:

How to Disable USB ports, CD-ROM and Floppy drives in Ubuntu

How to Disable USB ports, CD-ROM and Floppy drives in Ubuntu

In the company where I work, the employees often had to work from their homes during the pandemic. This necessitated the need to encrypt these laptops, and then to the question of how to stop all USB ports and CDs. In this article, we will look at some simple but effective methods to disable USB ports, CD drives and floppies.

But in the end, why do we need all this?
Well, often people, without even realizing it, can forget their laptop unlocked in a cafe and a conscientious person can quickly download a few key files or do a bunch of other nonsense. Therefore, in some cases, locking all communication ports on the laptop would increase your corporate security.

So what to do for usb ports. There is a very simple command that will help us in this case.

sudo echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf
Code language: Bash (bash)

Now for the CD-ROM just a reminder for all of this commands you have to be as root..

eject -i 1 chmod 000 /cdrom chmod 000 /media

It’s a simple solution but it works perfectly.

And for the floppy drive

chmod 000 /dev/fd0

In conclusion, we could say that the time consuming for this whole operation is no more than two minutes and the headache that we could save from possible theft of information is staggering.

How to stop a package from being updated in ubuntu apt with apt-mark

How to stop a package from being updated in ubuntu apt with apt-mark

Apt-mark is a command line tool that can help you choose which applications to be updated disabled or halted. You can set various settings for a package, such as
marking a package as being automatically/manually installed or changing dpkg selections such as hold, install, deinstall and purge.

For automatic and manual installation of packages you have several options like auto ( auto is used to mark a package as being automatically installed, which will cause the
package to be removed when no more manually installed packages depend on this package ), manual ( package as being manually installed, which will prevent the
package from being automatically removed if no other packages depend on it. ), showauto ( to print a list of automatically installed packages ) and showmanual ( can be used in the same way as showauto except that it will print a list of manually installed packages instead )

Here is an exmaple:

To prevent changes for a package we have the commands hold ( used to mark a package as held back, which will prevent the package from being
automatically installed, upgraded or removed ), unhold ( used to cancel a previously set hold on a package to allow all actions again ) and show hold ( used to print a list of packages on hold in the same way as for the other show commands ).

Here is an example:

In conclusion, we would say that the apt-mark command is one of the tools we need to know and be aware of its capabilities. For example, if you use the squid application and do not want the whole company to crash from one of its updates with the apt-mark command, you can easily defend yourself and test before launching the new update.

How to create a custom wordlist (password generator dump file) using Crunch

Create a custom wordlist (password generator dump file) using Crunch

What is Crunch?

Crunch is a great linux tool used for generating passwords. You can tell him what combination you need and it will generate it. If you need all the password combinations containing 6 digits and for example “abcde1234!” it will generate a file with all of them. The output from crunch can be sent to the screen, file, or to another program.

The syntax is really simple:

./crunch <from-len> <to-len> [-f <path to charset.lst> charset-name] [-o wordlist.txt or START] options: -f /path/to/charset.lst charset-name Specifies a character set from the charset.lst -o wordlist.txt Specifies the file to write the output to, eg: wordlist.txt ./crunch 8 8 -f charset.lst mixalpha-numeric-all-space -o wordlist.txt crunch should generate a 8 character wordlist using the mixalpha-number-all-space character set from charset.lst and will write the wordlist to a file named wordlist.txt. The file will start at cbdogaaa and end at " dog " For compleate manual please visit crunch man page.
Code language: Bash (bash)

Installation in Ubuntu linux

sudo apt install crunch

Installation in Debian linux

sudo apt-get install crunch
Code language: JavaScript (javascript)

Example 1 generating a 6 digit file containing “abcde1234!”

crunch 6 6 'abcde1234!' -o exportfile.txt
Code language: JavaScript (javascript)
crunch 6 6 'abcde1234!' -o exportfile.txt

Example 2 generating a 8 digit file containing special characters

crunch 8 8 pentest\@\#\$\%\^\&\! -o textnum.txt
Code language: PHP (php)
crunch 8 8 pentest\@\#\$\%\^\&\! -o textnum.txt

Here is a simple video using crunch

Conclusion

Crunch is used from penetration testing teams to generate random passwords to test wireless systems, firewalls and other IoT systems, it simple, easy to use and it’s fast.

If you are interested you can check How to generate a random password in linux using /dev/random

CertBot install ubuntua

How To Install a Let’s Encrypt SSL Certbot for Apache and Ubuntu 20.04

Certbot is part of EFF’s effort to encrypt the entire Internet. Secure communication over the Web relies on HTTPS, which requires the use of a digital certificate that lets browsers verify the identity of web servers (e.g., is that really google.com?). Web servers obtain their certificates from trusted third parties called certificate authorities (CAs). Certbot is an easy-to-use client that fetches a certificate from Let’s Encrypt—an open certificate authority launched by the EFF, Mozilla, and others—and deploys it to a web server.

Anyone who has gone through the trouble of setting up a secure website knows what a hassle getting and maintaining a certificate is. Certbot and Let’s Encrypt can automate away the pain and let you turn on and manage HTTPS with simple commands. Using Certbot and Let’s Encrypt is free, so there’s no need to arrange payment.

Installation of CertBot:

sudo apt update && sudo apt install certbot python-certbot-apache

Now lets get our new CertBot certificate

sudo certbot --apache

You will be asked some questions like your email, do agree to the Terms of Service and so on. Please fill them for your needs.

Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): Enter an email address where you can be contacted in case of urgent renewal and security notices. Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory ------------------------------------------------------------------------------- (A)gree/(C)ancel: Press a and ENTER to agree to the Terms of Service. Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about EFF and our work to encrypt the web, protect its users and defend digital rights. ------------------------------------------------------------------------------- (Y)es/(N)o: Press n and ENTER to not share your email address with EFF. Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: example.com 2: www.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel):
Code language: PHP (php)

Now lets test our certificate

The site ssllabs.com/ssltest/ is perfect for testing

Auto Renewal

As Let’s Encrypt certs expire after 90 days, they need to be checked for renewal periodically. Certbot will automatically run twice a day and renew any certificate that is within thirty days of expiration.

To test that this renewal process is working correctly, you can run:

sudo certbot renew --dry-run

Conclusion

In conclusion Certbot is one of the best tools for the job. It’s automatic, it’s free and on top of that is very easy to install and maintain.

How to install Vim

How to install Vim (vi) on Windows 10

This is a simple installation tutorial for those who don’t know that Vim can be installed in windows 🙂

Vim Website: https://www.vim.org