Skip to content

Instantly share code, notes, and snippets.

View shubhamoy's full-sized avatar
🎯
Focusing

Shubhamoy shubhamoy

🎯
Focusing
View GitHub Profile
@costasko
costasko / reversesshfs.sh
Created September 7, 2021 11:35
Podman MacOS filesystem reverse sshfs
ssh -R 65022:localhost:22 core@localhost -t -i ~/.ssh/podman-machine-default -p 57587 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "mkdir -p /var/home/core/hmount/ && sshfs $USER@localhost:/Users/$USER /var/home/core/hmount/ -p 65022"
@ninjatrench
ninjatrench / cloudflare_only.sh
Created January 25, 2018 17:29
Script (For Linux Servers) to Prevent Real IP address Leak Protected Behind CloudFlare
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[-] This script must be run as root [-]"
exit 1
fi
echo "[+] Reseting Initiated [+]"
ufw disable
echo "[?] Current Status [?]"
ufw status numbered verbose
@wzulfikar
wzulfikar / docker-ps-vertical
Last active March 14, 2024 13:36
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
// usage:
docker ps --format="$FORMAT"
@eguven
eguven / brew-list.sh
Last active February 7, 2024 06:16
List all packages installed using Homebrew and their sizes
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
@AvinashKrSharma
AvinashKrSharma / vimrc for how to get started with vim
Last active July 13, 2017 13:06
Initial vimrc helpful to get started with vim
" This will install Vundle
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/vundle
let iCanHazVundle=0
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';