Netcat tips and tricks

check if port is up nc -zvw3 [hostname or ip] [port] there will be a success output if the port is open else it will either give no output or say connection refused A more detailed examples nc -vz -w 5 127.0.0.0 21 8000-8101 23 w - timeout in seconds 8000-8101 check the ports from 8000 to 8101 (both inclusive) additionally check the ports 21 and 23

1 min · Yashodhan Ghadge

Pihole install and setup

Installation https://github.com/pi-hole/docker-pi-hole run docker compose script to use my setup please use this is repo https://gitlab.com/codexetreme/pihole_server to clone it do git clone https://gitlab.com/codexetreme/pihole_server pihole installation hiccups On ubuntu the pesky systemd will cause issues, so from the docs of pihole sudo systemctl disable systemd-resolved.service sudo systemctl stop systemd-resolved.service sudo nano /etc/NetworkManager/NetworkManager.conf Add dns=default under [main] so that the file contents look like what is shown below: [main] plugins=ifupdown,keyfile dns=default Visit the web gui goto 0....

1 min · Yashodhan Ghadge

Pycharm fixes

Fix pycharm’s Unresolved reference issue https://stackoverflow.com/questions/21236824/unresolved-reference-issue-in-pycharm

1 min · Yashodhan Ghadge

Rsync

Rsync Use it sync between local and remote environments rsync -azP source destination -a option The -a option is a combination flag. It stands for “archive” and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions. It is more commonly used than -r and is usually what you want to use. -n, -dry-run Always double-check your arguments before executing an rsync command. Rsync provides a method for doing this by passing the -n or –dry-run options....

1 min · Yashodhan Ghadge

SSH Tips and tricks

to allow a host to login add their public key to authorized_keys file in .ssh folder. to create it do touch authorized_keys and then do cat <KEYNAME>.pub >> authorized_keys to disable password auth goto /etc/ssh/sshd_config and then set PasswordAuthentication no

1 min · Yashodhan Ghadge

Sublime text linux install

Install sublime text wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - sudo apt-get install apt-transport-https echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list sudo apt-get update sudo apt-get install sublime-text

1 min · Yashodhan Ghadge

Tmux

install tmux sudo apt install tmux https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ tmux shortcuts <PREFIX> => Ctrl + a tmux list sessions tmux ls attach session (from the list displayed by the above command) tmux attach-session -t <session-name> detach from current session <PREFIX> d create new window <PREFIX> c rename current window <PREFIX> , goto cmd line <PREFIX> : tmux plugins tmux plugin manager https://github.com/tmux-plugins/tpm to install git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm Commands prefix + I => installs the listed plugins in the tmux config...

1 min · Yashodhan Ghadge

Zookeeper Install

create user and add a home directory sudo useradd zk -m set shell to bash sudo usermod –shell /bin/bash zk set a password for this user sudo passwd zk add zk to sudo group sudo usermod -aG sudo zk now for the security bit, disable ssh access to the zk user Open your sshd_config file: sudo vim /etc/ssh/sshd_config Locate the PermitRootLogin line and set the value to no to disable SSH access for the root user:...

4 min · Yashodhan Ghadge