Issues : #Virtualbox

Error when installing/ running Ubuntu in VirtualBox


Disabled hyper-v by doing the following.

  • Open 'Turn Windows features on or off'

(search for that in the start menu)

  • Untick hyper-v, Windows hypervisior platform and virtual machine platform.

  • Start the command prompt as an administrator.

(type cmd in the start menu, right click 'command prompt' and select 'run as administrator')

  • Run the following command

bcdedit /set hypervisorlaunchtype off

After a restart it seemed to install and work.

//--Enable hypervisor

bcdedit /set hypervisorlaunchtype auto

Issues : #Docker

Error Permission denied /var/lib/dpkg/lock

Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

E: Could not get lock /var/lib/dpkg/lock-frontend

E: Could not get lock /var/lib/dpkg/lock – open (11 Resource temporarily unavailable)

E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

# Solution solved

Check which other process is running the apt command (package manager for handling software)

ps -A | grep apt

ps aux | grep apt

ps afx|grep dpkg

Get the process ID of the process holding the lock files

sudo lsof /var/lib/dpkg/lock-frontend

sudo lsof /var/lib/dpkg/lock

sudo lsof /var/lib/apt/lists/lock

sudo lsof /var/cache/apt/archives/lock

Replace the <process_id> with the number you got in the output of previous command.

sudo kill -9 <pid>

sudo kill -SIGKILL <pid>

sudo killall dpkg

sudo killall apt apt-get

Remove the lock files

sudo rm /var/lib/dpkg/lock

sudo rm /var/lib/dpkg/lock-frontend

sudo rm /var/lib/apt/lists/lock

sudo rm /var/cache/apt/archives/lock

Reconfigure the packages

sudo dpkg --configure -a

# Run your process you want, if isn't work follow next step

apt --fix-broken install

Issues : #Ubuntu #System


# Create a new group

sudo groupadd <new_group>

# Delete a Group

sudo groupdel <group_name>

# Display groups for a user by specifying the username

groups <user_name>

# View a list of groups

getent group

# Add an Existing User to an Existing Group

sudo adduser <user_name> <new_group>

sudo useradd –G <new_group> <user_name>

sudo usermod –a –G <group_name> <user_name>

# Add a User to Multiple Groups at Once

sudo usermod –a –G <new_group>,<new_group2>,<new_group3> <user_name>

# Change a users primary group

sudo usermod –g <new_group> <user_name>

# Remove a User from a Group

sudo gpasswd –d <user_name> <group_name>

# Display the groups a user belongs to, including user ID (uid) and group ID (gid)

id <user_name>


# Create a new user

sudo adduser <user_name>

# Give this user administrative power

sudo usermod -aG sudo <user_name>

# Switch to our new user

sudo su - <user_name>

# Double-check user

sudo whoami

# Change a password for user name

sudo passwd <user_name>

# Change a password for root user

sudo passwd root

# Change your own password


# Delete user

sudo deluser <user_name>

# Remove user's home folder

sudo deluser --remove-home <user_name>

# Sync folder from user1 to user2

sudo rsync -va /home/<user_name1>/ /home/<user_name2>

sudo rsync -va /home/truongxuanc/ /home/truongcx263

# Show all user accounts on the system

less /etc/passwd

awk -F: '{ print $1}' /etc/passwd

Check System OS

# Check ubuntu version

lsb_release -a

# Check additional updates run

apt list --upgradable

# Check which user running which service

ps -eo pid,ppid,%mem,%cpu,cmd --sort=-%mem

ps -eouser,uid,pid,ppid,pcpu,pmem,cmd --sort=-pcpu

ps -ef

# To find the 10 biggest folders in current directory:

du -h | sort -hr | head -n 10

# To find the 10 biggest files and folders in current directory:

du -ah | sort -hr | head -n 10


# using Telnet -- sudo apt-get install telnet

telnet <IP/DNS> <PORT>

# Ctrl + ] then type "q/quit" to exit

# using netcat -- sudo apt-get install netcat

nc -vz <IP/DNS> <PORT>

# using nmap command -- sudo apt-get install nmap

nmap -Pn <PORT> <IP/DNS>

Error == sudo: no tty present and no askpass program specified


# Add your <user-name> to the sudoer group

sudo adduser <user-name> sudo

# Set no password required user

sudo sh -c "echo '<user-name> ALL=NOPASSWD: ALL' >> /etc/sudoers"

Error == crontab : cronjob : Pam_unix (sudo:auth) : conversation failed


# Run cmd

sudo nano /etc/pam.d/sudo

# Added was auth sufficient line to /etc/pam.d/sudo file

auth sufficient

Error == crontab : cronjob : No MTA installed, discarding output)” error in the syslog


Linux uses mail for sending notifications to the user.

Most Linux distributions have a mail service including an MTA (Mail Transfer Agent) installed.

Ubuntu doesn't though.

You can install a mail service, postfix for example, to solve this problem.

sudo apt-get install postfix


Discard it at the crontab to prevent cron from trying to send an e-mail.

sudo crontab -e

-- At the top of the file, add


-- Or add >/dev/null 2>&1 to every job:

* * * * * yourCommand >/dev/null 2>&1

Error == chmod : FILE has “other” file permissions. Please remove all “other” file permissions.


# Run cmd

chmod 400 /filelocation/file

Error == chown : Permiss Denied


# Run cmd

sudo chown -R <user_name>:sudo /PATH

sudo chown -R <user_name>:<group_name> /PATH

Error == chmod : Failed to start node_exporter.service: Unit node_exporter.service is masked.


# Run cmd

sudo chmod 700 node_exporter.service

Explain : firewall rule { iptables ; ufw ; gufw ; fail2ban }

  • iptables is the main firewall. It talks to the kernel. It's more complicated.

  • ufw wants to make it "uncomplicated" ("ufw" stands for "uncomplicated firewall"). It talks to iptables. It's a command line tool.

  • The G in Gufw must stand for "graphical", which should provide a click-click interface for ufw. It talks to ufw. It's a GUI.

  • Fail2ban scans log files and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc.

See more: firewall | ufw | ufw syntax | UncomplicatedFirewall | Iptables | Gufw | fail2ban | Official Fail2ban

Explain : chmod command

Issues : #CardanoNode

Error: cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory).


# Run cmd

echo export CARDANO_NODE_SOCKET_PATH="$CNODE_HOME/sockets/node0.socket" >> $HOME/.bashrc

Error: Leaderlogs already calculated for epoch 242, skipping!


# Run cmd

./ leaderlog force

Issuses : Stake pool is not shown in Daedalus

Issuses : cnode not run when update new KES


# Run cmd

chmod 400 vrf.skey

Issuses : cnode not run when update new db


# Run cmd

sudo rm -rf $CNODE_HOME/db

sudo unzip ~/tmp/ -d $CNODE_HOME/

sudo rm -rf ~/tmp/

sudo chmod -R a+rwx $CNODE_HOME/db

Issuses : Check Block Producer/ Core is ready to create Block

# Check with gLiveView

cd $CNODE_HOME/scripts


## Important informations:

-- Cardano Node - (Core - Mainnet) - mean that the node runs as a BP

-- Processed TX - mean that the node is processing TX

-- Peers - show how many Relays your BP is connected (for more informations about peers press “p”)

-- KES informations - show the KEYS are still valid, the date when will gone expire

-- BLOCKS - THE MOST IMPORTANT information - show that the node is ready to create BLOCKS

Update : Getting configuration files

# Getting configuration files : IOHK source

wget -O config.json

wget -O byron-genesis.json

wget -O genesis.json

wget -O topology.json

# Getting configuration files : Cardano community source

wget -O config.json

wget -O dbsync.json

wget -O genesis.json

wget -O topology.json

wget -O byron-genesis.json

Update : Getting scripts files

#Update scripts

cd $CNODE_HOME/scripts


curl -s -o

chmod +x

#-- env

curl -s -o env


curl -s -o

chmod +x


curl -s -o

chmod +x


curl -s -o

chmod 750


curl -s -o

chmod 750

Explain : Density is an overall network metric and not metric for node performs.

[5 day/Epoch]: Each Epoch duration for 5 days

60 x 60 x 24 x 5 = 432,000 second/epoch

[1 block/20 seconds]: 1 Block is produced for every 20 second

Blockchain Density = 1/20 = 5%

432,000 x Density = 432,000 x 5% = 21,600 block/epoch

The density measures the actual block production rate.

Example: Density = 4.872%

4.872% / 5% = 97.44 % of blocks are actually produced

Explain : adapools - parameters

Pledge bar :: pledge versus global average pledge size

Pledge Leverage = real pledge / live_stake * 100