Tag: linux

Ruby OpenSSL::SSL::SSLError – SSL_connect returned=1 errno=0 unsafe legacy renegotiation disabled

So, all of a sudden, one of our servers, while trying to connect to another, started giving this cryptic error –

OpenSSL::SSL::SSLError - SSL_connect returned=1 errno=0 unsafe legacy renegotiation disabled

These kind of errors are usually dependent on some system updates. But the error seemed to be coming from the target server. After a bit of searching around, this article gave the most understandable information.

From that article –

This “unsafe legacy renegotiation disabled” error happens when connecting to outdated endpoints that do not support RFC 5746 secure renegotiation. Ideally, the endpoints causing these errors should be upgraded for security reasons. 

In the same article, they mention that it should be possible to remove this security check, but the solutions mentioned there didn’t work.

Continue reading

fzf – error when pressing Ctrl+R

I’ve become a big fan of fzf since I discovered it.

However, after a recent upgrade, when I pressed Ctrl+R, I got the following error –

unknown option: --scheme=history

After some searching, found the following solution.

Remove fzf from /usr/bin/ and relink it.

Run these two commands in order –

sudo rm /usr/bin/fzf
sudo ln -s ~/.fzf/bin/fzf /usr/bin/fzf

install fzf on Linux

fzf is a serious timesaver. To be able to quickly go through past commands and in a fuzzy manner, especially when you don’t recall the exact command is a Godsend!

To install fzf on Linux, we need to

a) clone the repository into the system

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf

b) run the command which will add the relevant shortcut keys

~/.fzf/install --all

There are a bunch of other stuff that can be done once fzf is installed. For example, to see instant file previews –

fzf --preview 'less {}'

And if there is bat also installed, then the previews can show syntax highlighting and line numbers also!

fzf --preview 'bat --color=always --style=numbers --line-range=:100 {}'

How to generate SSH Keys and avoid “Invalid privatekey” error

I’ve long been a user of DBeaver which works so well across different OSes, so recently I wanted to set up the cloud version called cloudbeaver.

In the course of doing that, I had to generate SSH keys to be able to access remote databases via SSH.

Generate an SSH keypair

The standard way of generating SSH keys is to run this command.

> ssh-keygen -t rsa

This by default creates id_rsa and id_rsa.pub under <home directory>/.ssh folder (both in Windows and Linux)

Continue reading

Hide commands from bash history temporarily

There’s been a number of times I’ve wanted to not include some commands that I type into bash from being added to bash_history

The most convenient is to start a subshell by typing in bash again. This ensures that the commands in the subshell don’t get added to the history.

There are additional ways of achieving this as well.

Continue reading

mesg: ttyname failed: Inappropriate ioctl for device

While running a cron job in Linux, I sometimes get this error and I had been struggling to solve this until I came across this post.

Although that particular post mentions the cause being Vagrant, mine was due to a cron job.

First the solution …

Modify .profile under home folder

Open ~/.profile

Replace the following line –

mesg n || true

with

tty -s && mesg n

The reason for this is given very well in the post linked above.

Continue reading

users and sudo in Linux

Every time I need to create, modify, grant sudo access to users in Linux, I have to search for it.

This is a list of the commands I’ve used in the past.

Will keep updating this so that I don’t have to load a search page every time!

All commands below are run as root user. If I’m not the root user, I need to prefix them with sudo!

Continue reading

Copyright © 2024 the möbius trip

Theme by Anders NorenUp ↑