Skip to content

Instantly share code, notes, and snippets.

View sbmaggarwal's full-sized avatar
🏠
Working from home

Shubham Aggarwal sbmaggarwal

🏠
Working from home
  • New Delhi
  • 12:21 (UTC +05:30)
View GitHub Profile
@sbmaggarwal
sbmaggarwal / automated-linux-vm-setup.sh
Created July 31, 2025 06:05
Fully automated Linux VM setup script to install essential tools including Git, Docker, Java 17, Python, Node.js, RDP access, and more. Ideal for developer workstations or cloud VM bootstrapping with minimal prompts.
#!/bin/bash
set -e
echo "🛠️ Starting Linux VM setup..."
# Function to prompt user with Y/n question
prompt_yes_no() {
local prompt_message="$1"
local default_answer="${2:-Y}"
@sbmaggarwal
sbmaggarwal / gist:40dc46310a875a59a14136bf4c5d6e28
Last active September 22, 2024 03:21
Format a USB drive on MacOS

Format a USB drive on MacOS:

sudo diskutil eraseDisk exFAT sandisk128 /dev/disk9

Add secure erase if needed (4 being most secure AND slowest):

sudo diskutil secureErase 4 eraseDisk exFAT sandisk128 /dev/disk9
version: "3.9"
services:
elasticsearch:
image: elasticsearch:8.2.3
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1g -Xmx1g
- xpack.security.enabled=false
volumes:
- es_data:/Users/Core/Docker/Elasticsearch/data
@sbmaggarwal
sbmaggarwal / .zshrc
Created January 29, 2022 07:59
Personal iTerm 2 zshrc file
# Path to your oh-my-zsh installation.
export ZSH="/Users/home/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(asdf colored-man-pages docker brew sudo git)
source $ZSH/oh-my-zsh.sh
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home"
@sbmaggarwal
sbmaggarwal / presto_install.sh
Created September 25, 2018 05:29
PrestoDB v0.198 installation script for Ubuntu
# Install Java 8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# Install Python 2.7
sudo apt-get install python
# Install UUID utility to create unique UUID for each node
apt install uuid
@sbmaggarwal
sbmaggarwal / in_query_elasticsearch.json
Created July 8, 2017 08:44
IN query for Elasticsearch combined with containing query
{
"query": {
"bool": {
"must": [
{
"query_string": {
"fields": [ "name", "rollno" ],
"query": "*John*"
}
},
@sbmaggarwal
sbmaggarwal / ic_login.xml
Created December 25, 2016 12:02
A drawable showing an image made using only XML coordinates.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="296.999"
android:viewportWidth="296.999">
<path
android:fillColor="#FFFFFF"
android:pathData="M146.6,0c-31.53,0 -61.65,9.76 -87.11,28.23c-4.38,3.18 -5.57,9.19 -2.73,13.79l23.33,37.85c1.51,2.45 3.97,4.16 6.79,4.72c2.82,0.56 5.75,-0.08 8.08,-1.77c13.9,-10.08 30.34,-15.41 47.56,-15.41c44.72,0 81.1,36.38 81.1,81.1c0,44.72 -36.38,81.1 -81.1,81.1c-17.22,0 -33.66,-5.33 -47.56,-15.41c-2.33,-1.69 -5.26,-2.33 -8.08,-1.77c-2.82,0.56 -5.28,2.27 -6.79,4.72l-23.33,37.85c-2.84,4.6 -1.65,10.61 2.73,13.79c25.46,18.47 55.58,28.23 87.11,28.23c81.88,0 148.5,-66.62 148.5,-148.5S228.49,0 146.6,0zM146.6,276.33c-23.92,0 -46.91,-6.53 -67.02,-18.97l12.58,-20.41c15.29,8.74 32.5,13.32 50.36,13.32c56.12,0 101.77,-45.65 101.77,-101.77c0,-56.12 -45.65,-101.77 -101.77,-101.77c-17.87,0 -35.08,4.58 -50.36,13.32L79.58,39.64c20.12,-12.44 43.1,-18.97 67.02,-18.97c70.48,0 127.83,
Write to me on [email protected] for any Geeky discussion.