Home Blog Page 15

How to Quickly Convert JPG to PDF on Linux

0
How to Quickly Convert JPG to PDF on Linux

1.8K
This guide shows various methods, highlighting the simplicity of using the convert command in ImageMagick for quick conversions, the efficiency of batch processing, and the capability to compile multiple images into a single PDF document. We also introduce pdftk, catering to those seeking more advanced control over their PDF files, such as adjusting metadata and dictating document structure.
Why bother with the command line?
First off, you might wonder, “Why not just use an online converter?” Well, where’s the fun in that? Plus, using the command line offers a level of precision and efficiency that’s hard to beat. And let’s not forget about privacy concerns with online tools. So, let’s get our hands dirty with some terminal magic.
Converting JPG to PDF
Method 1: Using Imagemagick
Preparing your environment
Before we start, ensure you’re working on a Linux distribution like Ubuntu. It’s my go-to because of its user-friendly interface and vast repository of tools. For our purpose, we need to install ImageMagick, a powerful software suite that can create, edit, compose, or convert digital images in a wide variety of formats.
Open your terminal and type:
sudo apt-get update
sudo apt-get install imagemagick

This command updates your package lists and installs ImageMagick. Simple, right?
Convert a single JPG to PDF
Now, for the fun part. Say you have a meme in JPG format that you desperately want to convert to PDF. Here’s how you do it:

Navigate to the directory containing your JPG file.
Use the convert command from ImageMagick:

convert myMeme.jpg myMeme.pdf

Voilà! Check your directory, and you’ll find myMeme.pdf sitting there, probably feeling superior to its JPG counterpart.
Batch conversion
What if you have not one, but a whole folder of memes to convert? Fear not, for the command line is our mighty ally. Enter the following:
mogrify -format pdf *.jpg

This command converts all JPG files in the current directory to PDFs. Each file will retain its original name, which helps keep your meme collection organized.
Merging multiple JPGs into a single PDF
Sometimes, you might want to compile multiple images into a single PDF document. ImageMagick makes this a breeze:

convert *.jpg myCompiledMemes.pdf

This command takes all JPG files in the directory and merges them into a single PDF. How cool is that?
Method 2: Using pdftk for advanced PDF creation
First, we’ll need to install pdftk. On Ubuntu, you can do this by running:
sudo apt-get install pdftk

Once installed, pdftk offers a plethora of features, but let’s focus on creating a PDF from JPG images.
Convert and merge JPGs into a single PDF with pdftk
pdftk itself doesn’t convert JPG to PDF directly, but we can first use convert from ImageMagick to create individual PDF files from our JPGs and then merge them with pdftk. Here’s how:

Convert all JPG images to individual PDFs as before:

convert *.jpg myImage%d.pdf

This command converts each JPG file in the directory to a PDF. The %d formatter in myImage%d.pdf generates a numeric sequence for each output file, ensuring a unique name for each PDF.

Merge the PDF files into a single document:

pdftk myImage*.pdf cat output myCompiledAlbum.pdf

This command takes all PDF files starting with myImage and merges them into myCompiledAlbum.pdf. The cat operation is used for concatenating (merging) PDF files.
Why pdftk?
While the initial process might seem roundabout, pdftk shines in its ability to manipulate PDF files. You can merge PDFs, split them, encrypt or decrypt, rotate pages, and even fill out PDF forms from the command line. It’s a powerful tool for anyone looking to automate their PDF workflows.
Method 3: Using GIMP for JPG to PDF Conversion (GUI way)
GIMP (GNU Image Manipulation Program) is a free and open-source image editor available for Linux, Windows, and macOS. It’s highly versatile, allowing users to perform detailed image editing, create artwork from scratch, and, yes, convert images to different formats, including PDF.
Installing GIMP
If GIMP is not already installed on your system, you can easily install it from the Ubuntu Software Center or via the terminal. To install GIMP using the terminal, open it and type the following command:
sudo apt-get install gimp

This command downloads and installs the latest version of GIMP from the official repositories.

Converting a JPG to PDF

Open GIMP: Start by opening GIMP. You can find it in your applications menu or launch it from the terminal by typing gimp.
Open the JPG File: Click on File in the menu bar, then Open, and select the JPG file you want to convert.
Export as PDF: Once your image is open, click on File again, then hover over Export As. In the export window, change the file extension of your image to .pdf. For example, if your image is named myImage.jpg, you would change it to myImage.pdf. Click Export.
Adjust PDF Settings: A dialog will appear with PDF export options, such as applying compression or including the layers as separate pages. Adjust these settings as needed, then click Export.

And that’s it! Your JPG file is now saved as a PDF document.
Conclusion
As we wrap up this journey through converting JPGs to PDFs on Linux, it’s clear that the process is not just about achieving the end result but also about embracing the ethos of Linux. The command line, with tools like ImageMagick and pdftk, offers a playground for efficiency, customization, and control, transforming what might seem like a simple task into a craft.

Understanding How Cybersecurity and Data Privacy Impact Your SEO Ranking

0
intro to cybersecurity

While not obvious at first sight, cybersecurity has an immense role in SEO ranking. There are numerous dangers to which your business is exposed if you don’t recognize the importance of cybersecurity.

The Internet journey for more than 68% of people starts with a search engine, signalizing the importance of taking care of your ranking. SEO improves numerous aspects of a business, but that’s not the topic.
This article explains the intersection between two interesting fields, cybersecurity and SEO. At first glance, they don’t seem connected, but good cybersecurity practices can prevent unnecessary penalties for your website.
Effect of web security on SEO
Although there are more ways in which your website can be harmed through cyber threats, here are some of the most common problems you need to be aware of. Understanding your vulnerabilities can be half the problem.
Infected websites
In the past, there were situations in which Google would altogether blacklist certain websites for containing malware. With the intention of protecting anyone who’s browsing the internet, blacklists aim to prevent malware from spreading to users.
Unfortunately, if your website happens to have a major vulnerability and gets infected by malware, search engines can penalize you. This can plummet your rankings.
SEO spam
Whatever industry you point toward, you will find numerous methods of getting ahead of your competitors. Are all of them ethical? Rarely. SEO spam is a black-hat technique that purposefully lowers the ranking of a certain website.
There are a couple of ways that this can be conducted inside out. Spamming keywords, linking toward blacklisted websites, publishing spammy content, and numerous other methods.
On the other hand, people can also link fraudulent or poorly ranked websites to yours. This can be recognized by regularly checking your backlink profile.
Crawling errors
Bots are an important part of the SEO ecosystem. However, not all of them are used for good. Many crawlers are used for malicious purposes. This includes actions such as scraping content or trying to find vulnerabilities.
Even if these bots don’t manage to successfully conduct attacks on your website, they can still cause problems. For example, because they are constantly attacking your website, legitimate bots from Googlebot won’t be able to crawl your website successfully.
This can be recognized if you stumble upon 404 or 503 errors in your Google Search Console for web pages that you’re sure that they are legitimate.
Website downtime
Website aspects such as speed and security have an important impact on the ranking of the website. The overall downtime can lower your ranking because your website won’t be considered reliable.
Even a few minutes, which are insignificant in the wider picture, can be a sign of unreliability. There are numerous reasons why your website can be down. One of them can be previously discussed as malware. Other problems can include denial-of-service attacks that make your website inaccessible.
Good cybersecurity practices can prevent some of these malicious attacks on the website. However, don’t neglect the idea that downtime can happen because of a poorly developed website or hosting servers that can’t handle the traffic.
Methods of mitigating risks
Now that you’ve understood some of the common problems that can be caused by website vulnerabilities let’s go over the list of methods used to protect them.
While it’s best to use all of these methods at the same time, it’s understandable that not all companies have the budget to implement them equally.
Use the SSL certificate
One of the most basic steps that you should take in terms of cybersecurity is the implementation of an SSL certificate. SSL is a networking protocol that ensures that the traffic between your website and the user is secure.
If you’ve noticed, there’s a padlock sign left of the URL on your web browser. This is because you’re reading this article on a website that has a secure connection. Search engines don’t prefer websites that aren’t secure.
Furthermore, once you open a website that’s not secure, you’re met with the warning that this website isn’t secure. This also turns away many potential visitors from proceeding with opening your website.
Cybersecurity audits
To receive an overall protected and secure website, you should find a professional who will conduct a cybersecurity audit. Although this can be expensive, remember that no website is considered too insignificant to be attacked by hackers.
Adequate cybersecurity protocols for your website and your company can help you protect not only your website but also individual employees and your business as a whole. Through different types of pentesting, cybersecurity experts can test the weaknesses of your website and help you with fixing them.
The end goal of cybersecurity audits is to ensure that your website isn’t vulnerable to hacking methods. If you happen to lead a large company, it will be useful to conduct cybersecurity training courses.
Training your employees can help your company defend against common online threats such as phishing attempts, trojans, and other types of malware.
Hiring proper SEO experts
While SEO can be done at times completely free, you can do a lot more harm than good. Finding a company or an individual that will conduct a proper SEO campaign can help you not only protect yourself from damaging your ranking but also boost it in the long run.
If you’re based in the United Kingdom, finding UK-based SEO firms can help you get ahead of your competition regardless of the industry that you’re in. At best, poor SEO practices can lead to lowered traffic and ranking, but at worst, they can seriously penalize your website.
Common SEO practices include keyword stuffing, cloaking, having duplicate content, or plagiarizing content from other websites.
Updating CMS and plugins
One of the most important actions you need to take to ensure a secure website is to regularly update your content management system and plugins. Some of the largest data breaches happened because the companies were using outdated websites.
As a website owner, you need to do research on the most stable version of plugins and CMS that you’re using and then adequately update it. New software updates are often fixing bugs and vulnerabilities of previous versions, which is why it’s important to be aware of them.
Although outdated plugins won’t directly impact your ranking, these vulnerabilities can be exploited by hackers and then used to execute other harmful activities.
You should also research whether there are useful security plugins that can help you with making your website more secure.
Reasons why websites can be attacked
In the current era, websites are considered property, just like a house or a car. Each website has a certain use and a number of people that visit it. Websites of e-commerce businesses often have users who are leaving their financial information.
Other websites are simply fitting targets for building backlinks. Don’t neglect the idea that someone wants to take over a website to sell it. Furthermore, some hackers are after the data that the website is collecting.
Depending on your location, there are certain regulations that your business must adhere to. However, your website must satisfy regulations as well. If you’re based in Europe, you should do thorough research on how to be compliant with GDPR. On the other hand, Californians need to understand CCPA website requirements.
If your website’s security compromise leads to data leakage, then you will be the one responsible. This can lead to fines and blows to your reputation. So not only that you should ensure website security for adequate ranking, but you should also avoid fines for failing to adhere to regulations.
Cybersecurity can be essential for your SEO ranking
Once you understand the effects of cybersecurity on SEO, as well as how to prevent wrongdoers from harming your business, you’ve set a firm foundation. You might struggle to understand where a threat can come from, but it’s best to be safe than sorry.
This article has hopefully helped you understand what the vulnerabilities that one’s business might have are and how to mitigate them. Some of the methods from this list won’t cost you a lot, while others require a budget set out for them.
Overall, spending money on the protection of your website can pay out in numerous ways. Whether good cybersecurity practices prevent a data breach, SEO spam, or your website gets hacked, each of these problems would cost you a lot more than the money you’ve invested into cybersecurity.

Send Files Securely Over The Local Network With Cross-Platform LocalSend App

0
Send Files Securely Over The Local Network With Cross-Platform LocalSend App

LocalSend is a free and open source, cross-platform alternative to AirDrop for sending files securely over the local network. The Flutter app runs on Linux, Microsoft Windows, macOS, Android / Android TV, iOS, and Fire TV / OS.The application doesn’t use any third-party servers and doesn’t require an Internet connection to work. For communication in the local network, it makes use of its custom LocalSend Protocol and HTTPS encryption. The data is sent securely over HTTPS, and the TLS/SSL certificate is generated on the fly on each device.LocalSend is new, having its first GitHub commit in December 2022, but it already packs quite a few features like the ability to send not only files but also text, automatically display nearby devices, send to multiple recipients, detailed file transfer information, received files history, Quick Save (auto accept file transfers until this is turned off), rename incoming files, and more. It cannot send folders, at least right now.LocalSend Linux application – Receive tabThe application user interface includes three tabs: Send, Receive and Settings. Choose Receive to receive files, and the application will display its automatically generated computer alias, which will help you identify that device from other machines. You can change this alias from the Settings tab. The Receive tab also includes a Quick Save toggle – with this set to ON, file requests from everyone in the local network are automatically accepted, so only use this if you know what you’re doing!Without the Quick Save option enabled, users need to accept each transfer. On the accept screen you’ll find an Options button from where you can select which files to receive, where to save them, as well as rename the files.You might also like: croc Is A Tool For Resumable, Encrypted File And Folder Transfers Between Computers (Command Line)On the Send tab, which you can see in the screenshot above, you’ll find buttons to select a file or text while using the desktop app, and file, media, text, or app on Android; these are the 2 devices I’ve tested this on. After selecting a file or entering some text to send, click on the device alias from the Nearby devices list to send it.This is the Send tab on the Android LocalSend app:Both the send and receive screens include an Advanced button which shows detail about the transfer, such as upload / download speed, files remaining and file size:By default, sending files to nearby devices is set to single recipient mode. Click on the gear icon next to the Nearby devices text, and you’ll be able to switch to the multiple recipients mode:Now you’ll be able to send the same text or file to multiple nearby devices at the same time.From the LocalSend Settings users can change the application theme and language, choose the default file save path, and change various network details like the device alias, port, or multicast address.Other LocalSend features include received files history (with details such as the sender) and minimize to tray on Windows and macOS.Download LocalSendLocalSend is available for Linux, Microsoft Windows, macOS, Android, iOS and Fire OS. On Linux, it can be downloaded as an AppImage package, which can be used directly, without any installation (make the file executable, then double click to run it), as an AUR package for Arch Linux / Manjaro users, and it can be installed from Flathub.To install it from Flathub, which should work on most Linux distributions (on some, you will need to follow the Flatpak and Flathub quick setup), use the following command:flatpak install flathub org.localsend.localsend_app

The Dark Web And How To Access It

0
The Dark Web And How To Access It

Contents

What’s the dark web

How to access the dark web
Installation of TOR browser – Windows and Kali
Finding onion websites

Dark Web

What is the dark web

In short, dark web is part of the web which requires special software to browse, and isn’t indexed by search engines. (More technical content is enclosed in tags ahead, and colored purple. Scroll through it if you just want to browse the dark web right away.)

<EXTRA>

Originally, the internet used telephone network for communication. My first internet connection was a “dial-up” connection which used the telephone network at my house to connect to my ISP. This is what an overlay network is, and in that case, internet was an overlay over the telephone network. Now, the reverse phenomenon can be seen, with people using the internet for voice calls (Voice over IP to be precise), and the telephone network is turning into an overlay over the internet.

How does knowing what an overlay network is help us? Well, to understand the dark web, we need to understand what the dark net is first.
The dark net is the opposite of clear-net. Clear-net is simply parts of the internet which are index-able by search engines. This means that search engine crawlers can read up the pages, understand what the content is, and return those pages when relevant search queries are made to the search engine. On the other hand, dark net can’t be indexed, and usually uses uncommon communication protocols, encryption, etc. to achieve that result. Here’s where overlay networks get relevant, all of dark net is an overlay network over the internet. Hence, while the Darknet and clear-net reside on the internet, Darknet still manages to be structurally different from the rest of the internet.

From the darknet, we move to the dark web, which is a subset of the dark net. While dark net consists of all sorts of stuff, from www pages to file transfer service and peer to peer connections, dark web only includes the world wide web pages of the dark net (Hence the change from the more encompassing term net in darknet to web in dark web). 

What does it contain

Child pornography and illegal drug markets – These are the two things which the dark web is most infamous for, and if you’ve heard about the dark web, it’s quite likely it in reference to either (or both) of these.
Bitcoin services – Bitcoin is a Cryptocurrency, and considering the nature of activities that go on in the dark web, and the need for anonymity, it’s the most common form of payment for any service that you seek on the dark-web.
Hackers for hire 
Carding forums
Plenty of scam sites, phishing sites, etc.
Terrorism
Social media
File sharing

However, the dark web, in general, consists mostly of file sharing, as shown by many studies. While the first few pointers in the list stand out in the crowd, they are not what the dark web is all about. PS: I make no guarantee about the accuracy of these stats.

Dark web statistics

Note : Using TOR is not illegal (in most countries) , but many of the things on the dark web are illegal. Despite the strongly encrypted communications and high level of anonymity, I’d like to suggest that you don’t access any illegal content of the site. This article is only meant to educate you about the presence of the dark web, as not knowing about it doesn’t mean it’ll cease to exist, and as someone interested in the field of computer security/hacking, you must know about the dark web.

 How to Access the dark web

There are many ways to access the dark web. Being a part of the deep net, dark web operates differently than the clear-net, and needs special client software to be accessed. While there are multiple ways to access the dark web, the most common and recommended method involves using TOR, and then visiting the .onion websites. All dark web website have a url with .onion TLD (top level domain), which looks similar to the way the clear-net websites have .com, .org, .net, etc. TLD. Once you have TOR and find out the .onion address of a deep web site (hidden web site), you can simply enter it in the URL bar on TOR browser, and it’ll open, just as normal websites open in usual browsers.

<EXTRA>

If you read the previous boring section, you’d see that I mentioned how the darknet often uses uncommon communication protocols, etc. In case of the dark web, we see that phenomenon with respect to the onion websites. I won’t go in much depth, but first look at a .onion URL suggests that it’s similar to the clear-net websites. However, internally, the way they work is nothing similar to the clear-net. Precisely, .onion is not part of the internet’s DNS root, and hence, normal DNS servers can’t resolve your request if you type the URL of a .onion website on your browser. TOR redirects these requests through it’s own servers, similar to the way proxies work, and then we get to the website, without the involvement of DNS servers anywhere. This ensures that search engine bots can’t browse around the deep web, and that anonymity is maintained, both of the client looking at the web pages, as well as the server serving the web pages. In other words, the server doesn’t know who the client is, and the client doesn’t know anything about where the server is.)

</EXTRA>

Install TOR

All required instructions can be found here, and I suggest you skip this section of the guide and use the official page (which has very very detailed instructions if you scroll down on that page)

Windows

Simply go to TOR Browser Download page, and download and run the executable provided. No further instructions are needed as far as installation goes, since it’s quite similar to how you’d install regular software on windows.

Linux

Go to TOR Browser Download page, and download the .tar.xz archive (according to your architecture, 64bit or 32bit). There is no installation procedure. Simply extract the archive (using GUI or using tar on terminal).

Just extract the archive and you’re good to go

Common for both Windows and Linux

Finding onion websites

Now that you have what looks like Mozilla Firefox running in front of you. You can simply enter normal URLs and enjoy surfing the web with privacy. However, we are here to browse the dark web, and we have no idea what to enter in the URL bar.The solution is simple, just head over to the hidden wiki (clearnet link), and you’ll have a list of websites you can go to. Better yet, go to the dark web hidden wiki (link opens only on TOR), with an indexing of dark web websites. You are now surfing the dark web. This is the furthest I’m taking you, and from here on, you can go wherever you want. You can simply click URLs on the hidden wiki like you’d do on a regular browser, and the website would open. Regardless of what happens behind the scenes, the user experience from here on is what it’s like in the clear web (albeit a lot slower).As far as finding websites is concerned, you are left with indexes of websites, such as the hidden wiki, and some search engines, which are nowhere as good as the clearnet search engines, which is, by design, the intention of the dark web.

The hidden wiki, link provided above

Torch search engine, the hidden wiki has a link to it, which can be opened directly on TOR

Conclusion

Go around, explore the place, don’t go anywhere illegal, don’t do anything illegal. Also, beware of scams, and don’t leave your personal information anywhere. Take a look at instructions on how to be safe when using tor, follow them properly, and you won’t face any troubles.

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

0
Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

This is a guide for configuring Raspberry Pi4 to boot Ubuntu from external USB SSD drive instead of SD card. SSD drives are much faster than SD cards, more reliable and now lower cost than SD cards for larger memory sizes.Instructions for Ubuntu server 22.04 LTS are provided. Note that earlier versions of Ubuntu are much more difficult to configure for using external SSDs so I recommend using this latest Ubuntu release.

Hardware used in this guide

Raspberry Pi 4 with 8GB RAM
32GB micro SD card
Kingston A400 120GB SSD
StarTech SATA to USB adapter
Eluteng SATA to USB adapter
Adequate Power Supply due to additional SSD power consumption. (3.5A recommended)

Software used:

Windows 10 or Windows 11 PC however guide will be similar for MAC and Linux Users.
Raspberry Pi Imager (Balena Etcher is also a good tool for writing to SD cards)

NOTE: It turns out that there are a lot of SATA to USB adapters that do not work correctly when used to boot the Raspberry Pi. After many lost hours trying to get an incompatible cable to work I found this great resource on this topic with a database of know working cables.
James Chambers’ blog was also a great resource for writing other parts of this guide.
1. Upgrade bootloader firmware on Raspberry Pi 4
You need to make sure that the your Raspberry Pi 4 is running the latest bootloader firmware available. USB boot feature was enabled on the Pi 4 bootloader in the fall of 2020.

Use Raspberry Pi Imager V1.6 to install Raspberry Pi OS (lite version without desktop is best) on SD card
Copy empty text file called ssh.txt onto the system-boot partition of the SD card. Remove SD card from PC and insert into Raspberry Pi
SSH into PiDefault user: pidefault password: raspberry
Make sure you have the latest kernal updates. This will take several minutessudo apt update && sudo apt full-upgrade -y
Restart Pi to apply updatessudo reboot
SSH into Pi
Your Pi may currently be configured to use critical or stable bootloader releases. Normally I configure it to use the stable releases. Open file and change the FIRMWARE_RELEASE_STATUS entry to stable.sudo nano /etc/default/rpi-eeprom-update
Check bootloader firmware versionsudo rpi-eeprom-update

If bootloader is out of date you will see something like this:
BCM2711 detected
Dedicated VL805 EEPROM detected
*** UPDATE AVAILABLE ***
BOOTLOADER: update available
CURRENT: Thu 16 Apr 17:11:26 UTC 2020 (1587057086)
LATEST: Thu 3 Sep 12:11:43 UTC 2020 (1599135103)
FW DIR: /lib/firmware/raspberrypi/bootloader/stable
VL805: update available
CURRENT: 000137ad
LATEST: 000138a1

If bootloader is up to date you will see something like this:
pi@raspberrypi:~ $ sudo rpi-eeprom-update
BCM2711 detected
Dedicated VL805 EEPROM detected
BOOTLOADER: up-to-date
CURRENT: Thu 3 Sep 12:11:43 UTC 2020 (1599135103)
LATEST: Thu 3 Sep 12:11:43 UTC 2020 (1599135103)
FW DIR: /lib/firmware/raspberrypi/bootloader/critical
VL805: up-to-date
CURRENT: 000138a1
LATEST: 000138a1

Update bootloader if it is out of datesudo rpi-eeprom-update -a
Restart Pi to apply updatessudo reboot 
Check to see if update was appliedsudo rpi-eeprom-update

2. Select Boot Device Preference
The default boot setting on our Pi is likely to boot off of SDcard only. We are going to change this so it cycles between trying to boot from SDcard first and then from external USB drive if SD card boot fails.
SSH into the Pi OS installation that you used to upgrade the bootloader in step 1.

run raspi-config utilitysudo raspi-config
Select option 6 Advanced Options
Select option A6 Boot Order
Select option B1 USB BootYou should get pop up window that says “USB device is default boot device”
select ok
select finish and select Yes when asked if you would like to reboot now.the Pi should reboot like normal. Start SSH session to confirm
shutdown Pisudo shutdown now

3. Install Ubuntu Server 22.04 LTS on USB 3.0 SSD
USB booting Ubuntu Server 22.04 LTS is very simple now with the latest Pi bootloader.

Connect SSD to PC via SATA->USB cable
Download Ubuntu Server 22.04 LTS 64bithttps://ubuntu.com/download/raspberry-pi
Use Raspberry Pi Imager V1.6 or Balena Etcher to write Ubuntu Server 22.04 LTS on the external SSD.Be very careful when selecting the drive number that you choose the correct external drive and not your internal computer hardrive!
Connect the SSD to the USB3 port(blue) on the Pi4.
Make sure SDcard used previously to update the bootloader has been remove
Power up the Pi. If everything is good the USB boot should work.
SSH into Pi to confirm bootDefault user: ubuntudefault password: ubuntu

killall Command Examples in Linux

0
killall Command Examples in Linux

The killall command in Linux allows you to kill the process using the process name. Sure, you can do the same with the kill command but it requires a specific option to use the process name instead of the PID. So in this tutorial, I will guide you through how you can get the most out of the killall command by covering the following points:Syntax and available options for the killall command Practical examples of the killall command Let’s start with the first one.How to use the killall command in Linux To use any command to its maximum potential, it is recommended to get started with the syntax and the same goes for the kill command:killall [OPTIONS] nameHere, [OPTIONS]: Optional flags (also known as options) which are used to modify the default behaviour of the killall command. For example, you can use the -I option to perform a case-insensitive search.name: The name of the process which you want to terminate.Now, let’s take a look at the available options with the killall command:

Option
Description

-e
Require an exact match for the process name.

-I
Match process names case-insensitively.

-i
Interactively ask for confirmation before killing processes.

-q
Suppress error messages if no processes are found.

-r
Interpret the process name as a regular expression.

-s SIGNAL
Specify the signal to be sent to terminate the processes (default is SIGTERM).

-u USER
Kill processes owned by the specified user.

-v
Report if the signal was successfully sent (verbose output).

-w
Wait for all killed processes to die.

Practical examples of the killall command In this section, I will share some helpful examples of the killall command to help you better understand the applications of the killall command.1. Kill a specific process By far this is the most useful application of the killall command where you append the process name to the killall command and it terminates the process. Yes, it’s that simple! Here’s how you do it:killall process-nameFor example, if I want to kill htop, then I’ll use the following command:killall htop2. Send a specific kill signal By default, the killall command uses the SIGTERM termination signal which is enough for the most part but there are times when you expect different behaviour while terminating the process.The killall command allows you to choose from multiple termination signals. To use multiple termination signals use the -S flag along with the termination signal as shown here: killall -s <Termination_Signal> processFor example, if I want to kill the apache2 process using the SIGKILL signal, then I’ll be using the following:killall -s SIGKILL apache23. Kill processes interactively You can also use the killall command to kill the process interactively which will prompt you to ask for confirmation to kill the process. To kill process interactively, you can use the -i option as shown here:killall -i processFor example, here, I have used the interactive prompt while killing the htop process:killall -i htop4. Kill process owned by a specific userWhen you try killing a process owned by another user, it gives you an error saying “Operation not permitted”:Unable to kill process owned by another userTo kill a process owned by a specific user, you can use the -u flag to specify the username along with the process name as shown:sudo killall -u <username> processFor example, if I want to kill the htop process owned by the user team, then I’ll use the following:sudo killall -u team htop5. Kill process using regular expression If you want to kill multiple processes at once, then using a regular expression could be a great option. To use the regex, you have to use the -r flag as shown here:kill -r REGEXFor example, If I want to terminate all processes whose names start with “http”, such as “httpd” or “http-server”, I’ll use the following command:killall -r ‘http.*’More ways to kill (processes)Linux provides multiple ways you can kill processes. For example, if you want to kill a process on a specific port, then you can refer to the given guide:Kill Process Running on a Specific Port in LinuxWant to kill the processes running on specific ports? No need to know the process ID or name. You can terminate a process based on the port number it is using.If you are wondering about the difference between the kill and killall commands, here’s your answer:Kill vs Killall: Difference Between the Two Linux CommandsBoth kill and killall commands are used for force stopping (killing) processes in Linux. Learn the difference between the two similar commands.I hope you will find this tutorial helpful and if you have any queries, feel free to leave us a comment.

Session Skate Sim, Skater XL, NBA 2k24 and more sports games in this new bundle

0
Session Skate Sim, Skater XL, NBA 2k24 and more sports games in this new bundle

While you’re here, please consider supporting GamingOnLinux on:Reward Tiers: Patreon. Plain Donations: PayPal.This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!You can find even more ways to support us on this dedicated page any time. If you already are, thank you!

Boost your WordPress site with OpenLiteSpeed

0
Boost your WordPress site with OpenLiteSpeed

WordPress lets you build professional websites without needing to know how to code thanks to its user-friendly interface, a huge library of themes and plugins, and built-in search engine optimization features.

Mod_auth_mysql Installation on Centos 7 and Apache

0
How to install mod_auth_mysql

What Is Mod_Auth_Mysql?mod_auth_mysql is an Apache module used for authenticating users against a MySQL database. It is commonly used to protect items on a website via a user login prompt. The module is able to authenticate against a  MySQL database to check for a valid username and password, it supports various encryption methods. You can view more about it on the project page.This guide assumes you already have a working MySQL installation and Apache is already installed.  If you do not have Apache installed please see our guide on How To Install ApacheInstall mod_auth_mysqlThe last version of the module was created was designed for Apache 2.0 (we will show you how to patch it for 2.2 and 2.4 as well) First change to a download directorycd /usr/srcGet the packagewget https://github.com/linuxadminio/mod_auth_mysql/raw/master/mod_auth_mysql-3.0.0.tar.gzExtract the packagetar xfvz mod_auth_mysql-3.0.0.tar.gzGo into the directorycd mod_auth_mysql-3.0.0If you only have Apache 2.0 you can skip the next few steps, if you have 2.2 or 2.4 get the patchhttps://raw.githubusercontent.com/linuxadminio/mod_auth_mysql/master/mod_auth_mysql-300-apache-22.patchPatch mod_auth_mysql for Apache 2.2patch < mod_auth_mysql-300-apache-22.patchIf you have Apache 2.4, you will need to perform one more step. Open up mod_auth_mysql.cnano mod_auth_mysql.cChange the following linesline 908 fromreturn r->connection->remote_ip;Toreturn r->connection->client_ip;Line 1273  from:const apr_array_header_t *reqs_arr = ap_requires(r);To:const apr_array_header_t *reqs_arr = NULL;Line 1275 from:const array_header *reqs_arr = ap_requires(r);To:const array_header *reqs_arr = NULL;Go ahead and compile itapxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.cYou should now be able to load the module in your httpd.confnano /etc/httpd/conf/httpd.confand add the following lineLoadModule mysql_auth_module modules/mod_auth_mysql.soGo ahead and restart apacheservice httpd restartIt should restart successfully and you should be able to use mod_auth_mysql to authenticate now.  Aug 17, 2017LinuxAdmin.io 3.5 2 votesArticle Rating

You Can Now Upgrade Your Linux Mint 21.3 PC to Linux Mint 22, Here’s How

0
You Can Now Upgrade Your Linux Mint 21.3 PC to Linux Mint 22, Here’s How

We use cookies to optimize our website and our service.

The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.

The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.

The technical storage or access that is used exclusively for statistical purposes.
The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.

The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.