Skip to content

Instantly share code, notes, and snippets.

View Thavarshan's full-sized avatar
🦖
Adventure!

Jerome Thayananthajothy Thavarshan

🦖
Adventure!
View GitHub Profile
@Thavarshan
Thavarshan / myip.sh
Created February 12, 2025 03:55
This function fetches your public IP using https://api.ipify.org, displays it, and copies it to the clipboard if possible. It supports macOS (pbcopy), Linux with xclip, and Linux with xsel. 🚀
myip() {
local ip=$(curl -s https://api.ipify.org) # Fetch IPv4 address
echo "Your public IP (IPv4) is: $ip"
# Copy to clipboard based on OS
if command -v pbcopy &>/dev/null; then
echo -n "$ip" | pbcopy # macOS
echo "Copied to clipboard!"
elif command -v xclip &>/dev/null; then
echo -n "$ip" | xclip -selection clipboard # Linux with xclip
@Thavarshan
Thavarshan / sublime-text-3-setup.md
Last active July 26, 2021 09:57 — forked from ijy/sublime-text-3-setup.md
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following: