Skip to main content

11 posts tagged with "ubuntu"

View All Tags

· One min read
Hreniuc Cristian-Alexandru

Add in ~/.fonts.conf the following contents:

<?xml version="1.0" ?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
</match>
</fontconfig>

This will help you with your eyes.

Source

· 2 min read
Hreniuc Cristian-Alexandru

Source: https://askubuntu.com/a/1264577

In sleep mode, the content of ram is kept as it is, and the computer works on a very low power mode, so as to keep the ram content intact (as ram will lose the data if power supply is cut to it). But in hibernation, the ram content is stored in the swap space, so power can be completely cut off. Hence it is recommended to have swap size as large as the ram size.

· 2 min read
Hreniuc Cristian-Alexandru

Install the c++ compiler and the other things:

sudo apt-get install build-essential curl

Note: You should also check this post: Preparing C++ Dev infrastructure

Tmux and tmuxinator:

sudo apt-get install tmux tmuxinator

Others:

sudo apt-get install liblz4-tool

# To uncompress a lz4
lz4 -dc --no-sparse archive.tar.lz4 | tar xf -

sudo apt-get install vim
sudo apt-get install sqlitebrowser

MariaDB

sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo mariadb

GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDENTIFIED BY 'root';
FLUSH ALL PRIVILEGES;

Docker:

Source

sudo apt-get update

sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null


sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

sudo usermod -aG docker $USER

Kubernetes utils:

Source

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl

sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

sudo apt-get update
sudo apt-get install -y kubectl

From snap:

  • spotify
  • vscode(you can download it from ms website directly)
  • dbeaver

· 3 min read
Hreniuc Cristian-Alexandru

Some things were taken from this post, be sure to check it out.

Prepare pretty printers for GDB

The first thing you should always do is to get the pretty printers and use them to print the variables in gdb. To do this you will need to find the install path of thec gcc that was used to build the executable that has generated a coredump, and inside that path there should be some pretty printers. Usually, this path can be found here(on ubuntu): /usr/share/gcc-10/python/.

In my case it was in /opt/gcc/9.2.0/share/gcc-9.2.0/python/, because the gcc that I was using was built from sources.

That folder contains a folder called: libstdcxx which contains some python scripts that are used to print the variables nicer.

If you are investigating a coredump on a different server, you can copy that folder to the server using scp: scp -r /usr/share/gcc-10/python/ user@server:/path/to/server/.

Activate the pretty printers from the gdb config file

Pretty printers, added this in ~/.gdbinit:

python
import sys
# gcc-9
sys.path.insert(0, '/usr/share/gcc/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end

# Will print the whoile object
set pagination off
set print array on

# It will format the output
set print pretty on

· One min read
Hreniuc Cristian-Alexandru

I've changed in /etc/apt/sources.list from:

deb-src http://ro.archive.ubuntu.com/ubuntu/ eoan universe

to :

deb mirror://mirrors.ubuntu.com/mirrors.txt eoan universe

If this happens, it means that the best solution is to upgrade your version to a LTS.

· One min read
Hreniuc Cristian-Alexandru

Install nodejs in a specific path:

echo 'export PATH=$HOME/programs/bin:$PATH' >> ~/.bashrc
# the `programs` dir should exist, the `bin` will be
# created if it doesn't exist, when you will be running `./configure`
source ~/.bashrc
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=$HOME/programs # your prefix
make install# --j8
# The `make install` step takes a lot, you should do it on multiple threads using --j option

Install npm on specific path:

wget https://registry.npmjs.org/npm/-/npm-5.8.0.tgz # specify what version you want 
tar xzf npm-5.8.0.tgz
cd package/
node bin/npm-cli.js install -gf --prefix=~/programs/ ../npm-5.8.0.tgz
# use the prefix where node was installed

Test them both:

node -v
#
npm -v

· One min read
Hreniuc Cristian-Alexandru

The xml config file isn’t closed correctly and the parsing of the parameters doesn’t work. There is a method around it:

  • Edit the file: /home/user/.config/bless/preferences.xml

    <preferences>
    <pref name="ByteBuffer.TempDir">/tmp</pref> <!-- add this -->
    ...
    <pref name="Default.Layout.File"/>
    </preferences> <!-- Add this -->

    And make that file readonly, this way it won't get modified each time you restart bless.

Note: You won't be able to modify the preferences from the bless editor, you will have to edit the config file by yourself.

Another method is to rebuild Bless, applying a patch: https://bugs.launchpad.net/ubuntu/+source/bless/+bug/1622951