Skip to main content

45 posts tagged with "linux"

View All Tags

· One min read
Hreniuc Cristian-Alexandru

I recently installed Debian 10 and liquorix(latest kernel) when I booted a blank screen apeared.

Swithing back to the old kernel worked, but the resolution of my monitor was poor. I tried to see what is the issue and ran :

dmesg

In that output I noticed this line:

drm:amdgpu_pci_probe [amdgpu]] *ERROR* amdgpu requires firmware installed

I searched on google a fix and got to this post.

The fix was simple, I added contrib non-free after main on every line from /etc/apt/sources.list. Then I ran:

apt-get update && apt-get upgrade

And then I installed firmware-linux:

apt-get install firmware-linux

And then I rebooted the PC.

· One min read
Hreniuc Cristian-Alexandru

Install ucspi-tcp:

apt-get install ucspi-tcp

This pacakge contains this list of tools

Create tcp server from bash using tcpserver command from ucspi-tcp:

# script.sh content
#!/bin/bash
# read MESSAGE
echo "message: $MESSAGE"
sleep 2
echo " message 2"
sleep 3
echo " message 3"
sleep 2
# ---- end ------- #

# Run tcpserver:
tcpserver -v -H -R IP PORT script.sh

# Open a connection:
echo "" | nc IP PORT

This tcp server can open multiple connections in parallel. Verry usefull when you want to have a mock tcpserver.

Fixed issues:

  1. The read command doesn't work if I add it in the script(I had a client written in C++). But it did work when my client was nc....

The fix was to add \n at the end of the string that I was sending from that client. To reproduce this, you can run a client like this: echo -n "sa" | nc IP PORT and the script should contain a read instruction. You will notice that the server will stop at that read instruction.

· One min read
Hreniuc Cristian-Alexandru

Merge multiple pdfs into one on linux:

Source

Use poppler-utils or poppler package, which comes with multiple tools. The one we are going to use is pdfunite.

Example:

pdfunite 1.pdf 2.pdf 3.pdf 4.pdf 5.pdf 6.pdf out.pdf

Note: Do not forget to add the last parameter which is the output file. If you don't give it, it will override the last input file that you give.


Using pdftk:

pdftk.pdf 2.pdf 3.pdf 4.pdf 5.pdf 6.pdf  cat output out.pdf

Rotate 180:

pdftk pdf1.pdf cat 1-endsouth output rotated_pdf1.pdf

Source: here

· One min read
Hreniuc Cristian-Alexandru

A tutorial can be found here.


First you need to install/build the latest version of doxygen, here you have a tutorial.

yum install flex bison

wget http://doxygen.nl/files/doxygen-1.8.15.src.tar.gz
tar -xf doxygen-1.8.15.src.tar.gz
mkdir -v build &&
cd build &&

cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-Wno-dev .. &&

make -j16

make install

Notice: You will also need to install flex and bison, before building the doxygen binary.

Generate the documentation:

git clone git://github.com/mosra/m.css
cd m.css/documentation

# You may need sudo here
pip3 install jinja2 Pygments --user

Create a Doxyfile-mcss alongside your doxygen.cfg file with this content:

@INCLUDE                = doxygen.cfg
GENERATE_HTML = NO
GENERATE_XML = YES
XML_PROGRAMLISTING = NO

Generate the documentation:

./doxygen.py path/to/your/Doxyfile-mcss

Then go in the output folder(the one set in the doxygen.cfg) and open index.html.

Note: Check the unsuported features here. Ex: Class hierarchy graphs are ignored..

· One min read
Hreniuc Cristian-Alexandru
# What does --device /dev/vboxdrv:/dev/vboxdrv do?
# Does it write to the host system?

docker run --rm=true --name="container_name" \
--privileged=true --device /dev/vboxdrv:/dev/vboxdrv \
-e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix \
-it \
mpfmedical/virtualbo
# In container:
$ virtualbox

· One min read
Hreniuc Cristian-Alexandru

This will add a keybinding (Alt+Shift) to switch the keyboard layout between us are ro.

Run:

echo 'Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbLayout" "us, ro(std)"
Option "XkbOptions" "grp:alt_shift_toggle, grp_led:scroll"
EndSection' >> /etc/X11/xorg.conf.d/10-keyboard.conf

Reboot or restart xserver.

Works on every distribution. First check if /etc/X11/xorg.conf.d/10-keyboard.conf does exits, if it exists write to another file: eg: /etc/X11/xorg.conf.d/20-keyboard.conf.

On Debian with lxde, the path for xorg.conf.d is /usr/share/X11/xorg.conf.d.

Press Alt+Shift to switch between us and ro.

If you want other key, for ex: win : Option "XkbOptions" "grp:win_shift_toggle, grp_led:scroll".

· One min read
Hreniuc Cristian-Alexandru

Add this to ~/.basrc:

# Display date of the command
export HISTTIMEFORMAT="%d/%m/%y %T "

# Size(nr of lines) of the history loaded in memory?
export HISTFILESIZE=10000000
# Size(nr of lines) of the history saved in file?
export HISTFILESIZE=10000000
# Path to history file.
export HISTFILE=/home/chreniuc/data/configs/.bash_history