Skip to content

Instantly share code, notes, and snippets.

View surendharreddy's full-sized avatar

Surendhar Reddy surendharreddy

View GitHub Profile
unbind-key C-b
set-option -g prefix C-f
# Refresh with source file
bind-key R source-file ~/.tmux.conf
# Use zsh as default shell
set-option -g default-shell /bin/zsh
# Enable mouse support
@surendharreddy
surendharreddy / findme.sh
Created January 12, 2021 09:34
Get my internal and external IP
findme () {
echo "Internal IP: $(ifconfig en0 inet | grep inet | awk '{print $2}')"
echo "External IP: $(dig @resolver4.opendns.com myip.opendns.com +short)"
}
findme
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
async function execute(count = 0) {
for (let i = 1; i < count; i++) {
// Run logic here
await delay(i * 1000);
}
}
execute(10);
@surendharreddy
surendharreddy / install-python.md
Created April 25, 2021 04:12
Install Python on macOS using pyenv

Install Python on Mac using pyenv

1. Install dependencies using homebrew

brew install pyenv
brew install zlib
brew install sqlite
@surendharreddy
surendharreddy / wifi-ubuntu.md
Created April 25, 2021 04:23
Connecting to WiFi on Ubuntu without GUI

Connecting to WiFi on Ubuntu without GUI

Navigate to /etc/netplan/50-cloud-init.yaml

network:
    ethernets:
         eth0:
             dhcp4: true
 match:
@surendharreddy
surendharreddy / dns.sh
Created January 19, 2024 04:36
DNS things
alias dnsa='function _dnsA(){ echo "$(dig +short A $1)"; };_dnsA' # Find A records for a domain
alias dnsc='function _dnsCNAME(){ echo "$(dig +short CNAME $1)"; };_dnsCNAME' # Find CNAME records for a domain
alias digr='function _digRedirect(){ echo "$(curl -Ls -o /dev/null -w %{url_effective} $1)"; };_digRedirect' # Find redirect URL for a domain
alias ip='ipconfig getifaddr en0' # Get local IP address
alias ipe='dig @resolver4.opendns.com myip.opendns.com +short' # Get external IP address