Skip to content

Instantly share code, notes, and snippets.

View tankibaj's full-sized avatar

Naim tankibaj

  • Berlin, Germany
  • 03:09 (UTC +02:00)
View GitHub Profile
# This is the network config written by 'subiquity'
# nano /etc/netplan/*.yaml
network:
bonds:
bond0:
interfaces:
- enx0050b6fdfb89
- enp2s0
ethernets:
enx0050b6fdfb89: {}
#!/usr/bin/env bash
# Error Handling
set -o errexit; set -o pipefail; set -o nounset;
# Grab exit code
# cat /tmp/doesnotexist && rc=$? || rc=$?
# echo exitcode: $rc
# cat /dev/null && rc=$? || rc=$?
# echo exitcode: $rc

Method 1 - Disable IPv6 using GRUB

Configure GRUB to pass kernel parameters at boot time. You’ll have to edit /etc/default/grub. Once again, make sure you have administrator privileges:

sudo nano /etc/default/grub

Now you need to modify GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to disable IPv6 on boot:

@tankibaj
tankibaj / Sed.md
Last active September 16, 2021 15:29

Remove empty line from file

sed -i '/^\s*$/d' data.txt

OR

sed -i '/^$/d' textfile
# This is the network config written by 'subiquity'
network:
bonds:
bond0:
interfaces:
- enx0050b6fdfb89
- enp2s0
ethernets:
enx0050b6fdfb89: {}
enp2s0: {}

Install it as follows from the Github:

sudo apt install build-essential extlinux wimtools syslinux libc-bin jq
curl -L https://git.io/bootiso -O

Libvirt allows you to expose any USB device attached to your physical machine to the guest VMs. To do it, first, you have to get the vendor id and product id.

Run lsusb on terminal:

Qg8kPL8

Create a hostdev xml with vendor and product nano usb.xml

You must be the root user.

cat /dev/null > ~/.bash_history && history -c && >/var/log/lastlog && >/var/log/wtmp && >/var/log/btmp && exit

This setting is done in the /etc/sudoers file, which drives sudoers to use default security policy plugin for the sudo command under the user privilege specification section.

To allow a user (naim in the example below) to run all commands using sudo without a password, open the sudoers file:

echo 'naim ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
sudo sh -c 'echo GRUB_RECORDFAIL_TIMEOUT=0 >> /etc/default/grub';
sudo update-grub;