Skip to content

Instantly share code, notes, and snippets.

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

sabinm677

🏠
Working from home
View GitHub Profile
@sabinm677
sabinm677 / ps1.md
Created June 2, 2021 12:23
Bash PS1

Ref: https://access.redhat.com/solutions/505983

Special prompt variable characters: \d The date, in "Weekday Month Date" format (e.g., "Tue May 26").

\h The hostname, up to the first . (e.g. deckard) \H The hostname. (e.g. deckard.SS64.com)

\j The number of jobs currently managed by the shell.

@sabinm677
sabinm677 / gist:981882634c22a806441e0a72db0ddea1
Created February 24, 2021 08:05
Copy ssh key to remote
cat .ssh/id_rsa.pub | ssh remote_user@remote_ip 'cat >> .ssh/authorized_keys'
@sabinm677
sabinm677 / cars.csv
Created September 24, 2020 06:33 — forked from noamross/cars.csv
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4
Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1
Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4
Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2
Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2
@sabinm677
sabinm677 / README.md
Last active August 19, 2020 13:07
Docker Commands
  • docker run --name redis-server -p 6379:6379 redis // -> new instance;

  • docker exec -it redis-server bash

  • docker container ls // list containers

  • docker ps // list docker containers

  • docker ps -a // list all docker processes

@sabinm677
sabinm677 / test.js
Created June 19, 2020 22:54
Angular Tricks
// Get List of invalid form controls
for(form in this.testForm.controls) {
if(this.testForm.controls[form].invalid)
console.log(form + " is invalid.")
}
@sabinm677
sabinm677 / new.sh
Created April 29, 2020 14:52
New Project Description
git config --local credential.github.com.useHttpPath true
git config --local user.email "[email protected]"
git config --local user.name "Sabin Maharjan"
touch .gitignore
# PHP
echo "vendor/" > .gitignore
# JS

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@sabinm677
sabinm677 / starttmux.sh
Created April 22, 2020 01:44 — forked from todgru/starttmux.sh
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
# Terminal Cheat Sheet
### Git Advanced
git subtree push --prefix docs origin gh-pages # push docs as subtree to gh-pages
git rm --cached <file>... # ridiculously complicated command to undo, in case you forgot .gitignore
### Delete Project