Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Sunday, December 25, 2022

Add hard drive into Linux Mint 21.1 Vera/Ubuntu/Debian

Add hard drive into Linux Mint 21.1 Vera/Ubuntu/Debian

This is a condensed version on how to add hard disk into Linux Mint/Ubuntu/Debian. First check hard drives in the system, like so:
$: sudo lshw -C disk
It should show (partial data only) like this:
*-disk:1
   description: ATA Disk
   product: WDC WD3200AAKX-0
   vendor: Western Digital
   physical id: 1
   bus info: scsi@1:0.0.0
   logical name: /dev/sdb
   version: 1H15
   serial: WD-WMC2E0871450
   size: 298GiB (320GB)
   capabilities: partitioned partitioned:dos
   configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=e32ff1f9
Using parted, let's now configure the harddisk/partition
$: sudo parted /dev/sdb
In parted prompt, create a new GPT partition table
(parted) mklabel gpt
Change the default unit to GB
(parted) unit GB
Create one partition occupying all the space on the drive
(parted) mkpart primary ext4 0 100%
Check to verify the layout
(parted) print
It should show something like below:
Model: ATA WDC WD3200AAKX-0 (scsi)
Disk /dev/sdb: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name     Flags
 1      0.00GB  320GB  320GB  ext4         primary
Save and quit parted
(parted) quit
Format the partition using ext4
$: sudo mkfs -t ext4 /dev/sdb1
Formatting process should show something like below:
mke2fs 1.46.5 (30-Dec-2021)
/dev/sdb1 contains a ext4 file system labelled 'VMs'
        last mounted on /mnt/b41faa95-6135-47f6-a24e-ed1909d6fc18 on Sun Dec 25 19:06:43 2022
Proceed anyway? (y,N) y
Creating filesystem with 78142464 4k blocks and 19537920 inodes
Filesystem UUID: 1b7f46da-9aa6-4c30-afec-d983f35a19d5
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks):
done
Writing superblocks and filesystem accounting information: done
Now let us create a mount point
$: sudo mkdir /mnt/vmdisk
Add an entry in fstab to automount the new partition
$: sudo vim /etc/fstab
Add a line entry in fstab like below
/dev/sdb1    /mnt/vmdisk   ext4    defaults     0        0
We should be able to use the partition without rebooting, so mount it manually for now.
$: sudo mount /mnt/vmdisk
Add directory to be writable by user
$: sudo mkdir /mnt/vmdisk/vms
Make the user named timus owner of the new folder
$: sudo chown -R timus:timus /mnt/vmdisk/vms
Refs:
https://help.ubuntu.com/community/InstallingANewHardDrive

Sunday, January 03, 2021

iftop shows qqqq under tmux

 Running iftop in tmux shows qqqq for the border, like below.




To fix this do:

$: sudo TERM=xterm iftop

Monday, September 07, 2020

Check if package is installed in Ubuntu/Debian/Mint

To check if a package is installed on Ubuntu/Debian/Mint, do:

$: dpkg -s dkms

This will display information if dkms is installed.

Reference(s):
http://www.cyberciti.biz/faq/find-out-if-package-is-installed-in-linux/


Monday, July 27, 2020

Monday, March 16, 2020

Installing VirtualBox Guest additions in Debian Buster

VirtualBox Guest Additions allow a good number of  host to guest integrations that makes using the VM easier to use, for example copy/pasting text from host to guest and vice versa is very convenient. Another useful feature is resizing the window of the guest VM.

To enable/install VirtualBox Guest Additions, do:
$: sudo apt install dkms

From VirtualBox Guest main UI, select Devices | Install Guest Additions..., then:
$: cd /media/cdrom
$: sudo sh ./VBoxLinuxAdditions.run
$: sudo reboot

Note:


Keywords: Debian Buster, Debian 10.3

Sunday, March 15, 2020

Adding existing user to a group in Ubuntu

Example below adds user timus to the group www-authors

$: sudo usermod -a -G www-authors timus

To add user timus to sudoers group, do:

$: sudo usermod -a -G sudo timus

Note:

  • That for the sudo to take effect you have to logout and log back in.
  • In Debian Buster (10.3), need to reboot for it to take effect


Tested on:
- Lubuntu (13.04)
- Ubuntu (12.04 - 13.04)
- Debian Buster (10.3)

References:
http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line


Sunday, September 11, 2016

Add a regular user in Kali Linux

Create a new user, say timus.
# adduser timus
Add user to sudoers group. This enables the user to become root when needed, for example to install new software.
# usermod -a -G sudo timus

References:
http://8thstring.blogspot.com/2013/07/howto-create-new-user-in-lubuntu.html
http://8thstring.blogspot.com/2012/12/adding-existing-user-to-group-in-ubuntu.html


Thursday, March 31, 2016

Install minimal GNOME shell on Debian Stretch

#: apt install gdm3 xserver-xorg-legacy
This will install just the GNOME shell, pretty lean and mean (for GNOME standard :)

Note:

  • This is a pre-release of Debian Strech
  • Need to add xserver-xorg-legacy otherwise it will not work, might be related to this bug.

Sunday, March 27, 2016

Remove VirtualBox guest additions on Debian

# apt-get purge virtualbox*

Reference(s):
https://forums.virtualbox.org/viewtopic.php?f=3&t=54881

Install minimalist GUI on top of Debian Stretch netinstall

LXDE is pretty lightweight desktop environment. There are other lighter weight DEs out there mind you but for most practical purposes LXDE serves most of the modern x86 machines.

To install minimalist (just the core) LXDE on Debian Strech, do:

#: apt-get install lxde-core lightdm

Note:

  • This will also install a lighter version desktop manager LightDM
  • This is a pre-release version, it may change without notice.

Sunday, October 26, 2014

HowTo: Fix "user is not in the sudoers file. This incident will be reported" in Debian

In Debian, the user created during installation is not automatically added to the sudoers list. To fix do:
  1. Change to root user by typing su in a terminal.
  2. As root, do visudo.
  3. Search for line root    ALL=(ALL:ALL) ALL.
  4. Copy that line (in nano, do Ctrl+K then Ctrl+U to uncut and on more Ctrl+U to duplicate the line).
  5. Change that new line to like timus    ALL=(ALL:ALL) ALL. This adds user timus to the sudoers.
Reference(s):
http://ubuntuforums.org/showthread.php?t=1837295

LXPanel no status bar in Debian Sid/Jessie

I just installed latest Debian Sid/Jessie (testing branch-10/25/2014) and selected LXDE as my desktop environment via network install. The problem was that no start menu or status bar was shown. Seems like a bug somewhere in LXDE but as a workaround do:

$: cp -rp /etc/xdg/lxpanel/profile/LXDE/* ~/.config/lxpanel/LXDE/

Reference(s):
https://bugs.launchpad.net/raspbian/+bug/1080966


HowTo: Install linux kernel headers in Debian

As root user, do:

#: apt-get install linux-headers-$(uname -r)

Reference(s):
http://www.cyberciti.biz/faq/howto-install-kernel-headers-package/

HowTo: Logout from LXDE via the command line

$: lxsession-logout

Reference(s):
http://wiki.lxde.org/en/LXSession#Logging_Out

Saturday, October 25, 2014

Re-install grub in Debian 8 Jessie

So I was trying to install Debian Jessie beta 2 (Debian 8) and was not really paying attention what I was doing. It ended up that I don't grub installed.So who do you fix this? As usual in Linux/Debian there so many ways to do this but below are the steps that I have done:
  1. Boot the machine using the boot media, I was using debian-jessie-DI-b2-amd64-netinst.iso and yes I am using VirtualBox.
  2. Select Advanced options | Rescue mode.
  3. Follow text based wizard, change the values as you see fit. I did English for Select a language. Then United States for Select your location. American English for Configure the keyboard. Used debian in Configure the network - note that this does not have to match to the machine that you want to recover.  Left blank for the domain. Then for Configure the clock I selected Central.
  4. In Enter rescue mode, I have selected /dev/sda1 as I only have one SATA HD and I know that the first partition was my root. You probably to make guesses if you want to do quick and dirty fix. Of course you can always mount the partition and check if it looks like a root partition.
  5. In Enter rescue mode, second screen, select Reinstall GRUB boot loader.
  6. In Enter rescue mode, third screen, I did /dev/sda. This will change depending on your specific circumstance. In my scenario it was easy as it was a VM and it was the only operating system on the disk.
  7. Select Reboot the system and you are done.

Wednesday, February 13, 2013

Cleanup or purge configuration files from packages

When removing packages, like sudo apt-get remove virtualbox-guest-utils, it may leave configuration files in the system. This can be verified by running dpkg -l | grep 'virtualbox' for example. If the first string shows rc (removed, configuration files present) then purging is necessary, like so:

$: sudo lshw -class memory

List installed package(s) in Debian based distro

Show installed package that has a string 'virtualbox'

$: dpkg -l | grep 'virtualbox'

Saturday, January 19, 2013

Installing Ubuntu font family in Debian 7 Wheezy

Download Ubuntu font family from http://font.ubuntu.com. Using file manager and as a user root, do:

  1. Create a directory in /usr/share/fonts/truetype named ttf-ubuntu.
  2. Using a file manager copy the *.ttf files to /usr/share/fonts/truetype/ttf-ubuntu.
Note:
- I am not sure if this is the proper way to do it but it works.

CPP Quick Guide

Basics Hello world User input While loop If statement For loop Switch statement Read file using ifstream Write to a file using ofstr...