Tagged: hacks

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

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

Setting up password-less ssh across all nodes in a cluster

Pre-requisites User account for which passwordless ssh will be setup, should be present on all nodes Password of the account should be same across all nodes pdsh and ssh-copy-id commands should be available Prepare 2 files file_of_hosts.txt – containing all...

0

Setting up tmux without root access

At times we want access to tmux and we are just stuck due to admin restrictions or root access. There are three important parts to setting up tmux, It is dependent on libevent Compiling and installing on non-system folders require customized...

0

iTerm2 shell integration scripts offline usage

At times we are working in an internet less environment. So, here are a few things we can do, Make the scripts available over a local http server Change scripts for any http://internet-address/ to http://local-address Making scripts available on local $...

0

Super charge bash with these bash_profile tips

Some tips and tricks to super charge bash Tip #01: Up down arrow auto complete ~/.inputrc #File: ~/.inputrc ## arrow up “\e[A”:history-search-backward ## arrow down “\e[B”:history-search-forward   Tip #2: Auto complete hostnames in ssh, scp. More details here. $ brew install...

0

Setup bulk password-less ssh

Following script will help in setting up password-less ssh in one shot to multiple machines, Usage sample: $ remote-keyless.sh <file_of_hosts.txt> [password] #!/usr/bin/expect -f # remote-keyless.sh, v0.1, 2016-05-03, [email protected] # v0.2, 2016-09-28, [email protected] – added to make it compatible with pdsh ;)...