Category: Linux

0

WSL2 configuration

X11 forwarding on WSL2 More info here ~/.bashrc export DISPLAY=$(awk ‘/nameserver / {print $2; exit}’ /etc/resolv.conf 2>/dev/null):0 export LIBGL_ALWAYS_INDIRECT=1   Windows links for linux apps in WSL Adds linux GUI application menu to a windows toolbar https://github.com/cascadium/wsl-windows-toolbar-launcher Related posts: Access...

0

Connecting to remote server using a jump server (SSH tunneling)

Problem statement There are 3 hosts, Host-user – one that you are on Host-jump – one that has connectivity to database server Host-database – database server Host-user wants to connect to Host-database using Host-jump. Solution Setup ssh tunnel with local...

0

Cluster filesystem utilization alerts

This is a quick and raw method to setup alerts when the filesystem fill above threshold. Pre-requisites Monitored filesystems should be consistent, meaning available across all nodes passwordless ssh should be setup between the nodes. Node where the alert script...

0

Check version of installed python packages

Below bash command will let you find the version of packages for your python interpreter. Make sure you are running the correct version of python enterpreter. Update: 2020-05-14 for i in pandas numpy sqlalchemy logging logging.handlers datetime sys re os...

0

Download m3u8 URL video to local

Follow below steps to download video from a webpage Step 1: Finding m3u8 URL from webpage Open Chrome Developer tools and click the Network tab Navigate to the page with the video and get it to start playing Filter the...

0

Automate ports connectivity check using telnet and timeout

Check ports connectivity using automation with telnet and timeout commands. Timeout will help us not get blocked for a long time. Adjust the timeout value on case to case basis, # vi ~/check_my_server_hostname.sh timeout 2 bash -c “echo ‘exit’ |...

0

Create many files with random content

Source: https://unix.stackexchange.com/questions/199863/create-many-files-with-random-content   For example, Name size file1.01 2K file2.02 3K file3.03 5K etc.   Strategy – 1 #! /bin/bash for n in {1..1000}; do dd if=/dev/urandom of=file$( printf %03d “$n” ).bin bs=1 count=$(( RANDOM + 1024 )) done  ...

0

Download youtube playlist

Setup sudo apt-get install ffmpeg brew install youtube-dl Command youtube-dl –extract-audio –audio-format mp3 -o “%(title)s.%(ext)s” <url to playlist>   References https://askubuntu.com/questions/564567/how-to-download-playlist-from-youtube-dl Related posts: Compiling in $HOME Installing perl modules in non standard directory Bulk add remote host fingerprint in ~/.ssh/known_hosts...

0

Merge multiple consecutive lines

At times there is a need to merge multiple consecutive lines to one. paste command makes it very easy to merge lines. Syntax: paste -d’,’ – – < input_file See the example below, robin@Home-XPS:~$ echo -e ‘1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12’ 1 2 3...