How to Check Memory (RAM) Information

by lethu on Sun, 04/11/2021 - 05:24

 

 

Question! How to Check Memory (RAM) Information such as size, type and number.

Answer! Input the following command into a terminal or console.

sudo dmidecode --type 17

Note! You might need to install "dmidecode" to be able to execute the above command.

Tags

A Short and Simple Python Script

by lethu on Fri, 03/12/2021 - 10:45

# file: App_V3.py
# Updated the code to add functionality

name = input("Hello, what's your name?: ")
# Using the var.title() function to set upper case for the first letters of entered name
print("Hello, " + name.title() + ", and welcome!")
# Taking an integer value and assigning it to the "service" variable for later use
# while making a "while" loop with an exception catching function in case the user inputs
# an alphabetical number instead of a numerical one redirecting the user to valid input

while True:
    service = input("Now please take a seat and tell me how many guests are you bringing with you tonight?: ")
    try:
        service = int(service)
        break
    except ValueError:
        print("Please tell me a number.")
# Making a condition to define if the subjects will be plural or singular
if service > 1:
    invitee = " guests"
    table = " them."
    clients = " all"
else:
    invitee = " guest"
    table = " the both of you."
    clients = " the both"
print("Oh, " + str(service) + invitee + "..., then I shall prepare a table for" + table)
menu = ["Salad", "Sandwich", "Tiramisu"]
print("In regards to your order, we have " + str(len(menu)) + " specialties today !")
# Code to accept only available choices
while True:
    choice = input("What will you begin with, " + menu[0] + ", " + menu[1] + " or " + menu[2] + " ?")
    if choice != menu[0] or choice == menu[1] or choice == menu[2]:
        print("Please tell me a valid menu item.")
    else:
        break
print("So " + choice + " for" + clients + " of you")

Tags

How to Fix Spotify Crashes

by lethu on Sat, 02/13/2021 - 08:45

Question! How to fix Spotify client crashes on Debian based GNU/Linux distributions, possibly even other types of distributions.

Answer! Launch Spotify client with the following argument.

spotify --no-zygote

Note! This is for terminal, you can however edit your desktop environment's menu entry for Spotify to reflect the mentioned command. Have a good one!

Tags

How to check your HDD/SSD drive's health

by lethu on Mon, 12/21/2020 - 17:02

Question! How to check your HDD/SSD drive's health under linux.

Answer! First, install the SMART drive monitoring tool from a console or terminal. Just type the following command under any Ubuntu/Debian powered GNU/Linux distro:

sudo apt install smartmontools

Then run the following command from a terminal or console:

sudo smartctl -H /dev/sda

Note! Replace "sda" in the "/dev/sda" path by your desired target drive.

Tags

How to Make a Bootable USB From Linux ISO File

by lethu on Thu, 12/17/2020 - 01:04

Question! How do I make a bootable usb pendrive out of a linux distro ISO image?

Answer!  Open up a console then type in the following command:

sudo dd bs=4M if=/path/to/ISO/File.iso of=/dev/sdX status=progress oflag=sync

Then push the enter key.

Note! Repalce the "X" in "sdX" by your pendrive corresponding letter.

Tags

Batch Image Resize

by lethu on Thu, 12/17/2020 - 00:58

Question! How to resize multiple images at once.

Answer!  You will first need a tool called ImageMagick, so bring up the console and type in the following command to install it :

apt-get install imagemagick

 Then type the following command in the console :

for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done

Note! Replace "jpg" by the extension your images have (it's case sensitive), and "50" by the percentile you want your images to be resized to. The command will resize all images with the mentioned extension in the current directory it is run from.

Tags

Default monitor on dual monitor setup

by lethu on Wed, 12/16/2020 - 21:57

Question! How to set the default monitor for applications in a dual monitor configuration.

Answer!  Open up a console then type in the following command:

xrandr -q

Identify your primary monitor among the list you get, then type in the following command :

xrandr --output DVI-0 --primary

Note! Replace DVI-0 by your identified monitor's id.

Tags

Installing *.msi files through WINE

by lethu on Wed, 12/16/2020 - 18:06

Question! How to install .msi files on WINE.

Answer! Type the following command in the console :

wine msiexec /i xyz.msi

Note! Replace xyz by your file name.

Tags

Mounting ISO files

by lethu on Wed, 12/16/2020 - 18:04

Question! How to mount an ISO image file so that you can read its content.

Answer! Type the following command in the console :

mount -o loop <ISO file> <target directory>

Note! Replace <ISO file> and <target directory> by the corresponding names.

Tags

Run a "jar" java file

by lethu on Wed, 12/16/2020 - 18:02

Question! How to run a java file under terminal.

Answer!  Open up a console or terminal then type the following command :

java -jar filenamehere.jar

Tags
Subscribe to Linux Tips