Skip to content

Instantly share code, notes, and snippets.

View nsollazzo's full-sized avatar
🔐
Don't Trust, Verify

Nicholas Sollazzo nsollazzo

🔐
Don't Trust, Verify
View GitHub Profile
# colored grep
alias grey-grep="GREP_COLOR='1;30' grep -E --color=always --line-buffered"
alias red-grep="GREP_COLOR='1;31' grep -E --color=always --line-buffered"
alias green-grep="GREP_COLOR='1;32' grep -E --color=always --line-buffered"
alias yellow-grep="GREP_COLOR='1;33' grep -E --color=always --line-buffered"
alias cyan-grep="GREP_COLOR='1;36' grep -E --color=always --line-buffered"
# colored log
alias logger='cyan-grep "\[.*\]|$" | yellow-grep "WARN|$" | red-grep "ERROR.*|FATAL.*|##|$" | green-grep "INFO|$"'
@nsollazzo
nsollazzo / teamviewer_install.sh
Last active September 2, 2018 14:14
TeamViewer on Ubuntu 18.04 Bionic Beaver Linux
#!/usr/bin/env bash
#TeamViewer on Ubuntu 18.04 Bionic Beaver Linux
sudo apt install gdebi-core
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
sudo gdebi teamviewer_amd64.deb
rm teamviewer_amd64.deb
@nsollazzo
nsollazzo / docker_install.sh
Created September 2, 2018 14:15
Install docker CE on Ubuntu & derivatives
#!/usr/bin/env bash
# Install docker CE on Ubuntu & derivatives
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
@nsollazzo
nsollazzo / zsh_fix_upgrade.sh
Created October 26, 2018 10:56
fix to upgrade oh_my_zsh
#!/bin/sh
# Fix to the problem:
# [Oh My Zsh] Would you like to check for updates?
# Type Y to update oh-my-zsh: Y
# Upgrading Oh My Zsh
# Cannot pull with rebase: You have unstaged changes.
# Please commit or stash them.
# There was an error updating. Try again later?
cd "$ZSH" && git stash && upgrade_oh_my_zsh
@nsollazzo
nsollazzo / stop_all.sh
Last active May 15, 2019 13:01
Stop and remove all docker container
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
Verifying my Blockstack ID is secured with the address 1MVA4QXRCfoM3QHQqLZWFaLeusKvqPj1m3 https://explorer.blockstack.org/address/1MVA4QXRCfoM3QHQqLZWFaLeusKvqPj1m3
@nsollazzo
nsollazzo / docker_upgrade.sh
Created January 18, 2019 20:51
Upgrade docker-compose
#!/bin/sh
sudo apt-get remove docker-compose
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
DESTINATION=/usr/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
sudo chmod +x $DESTINATION
@nsollazzo
nsollazzo / clone-user.sh
Created May 15, 2019 13:01
linux user clone
#!/bin/bash
SRC=$1
DEST=$2
SRC_GROUPS=$(id -Gn ${SRC} | sed "s/${SRC} //g" | sed "s/ ${SRC}//g" | sed "s/ /,/g")
SRC_SHELL=$(awk -F : -v name=${SRC} '(name == $1) { print $7 }' /etc/passwd)
useradd --groups ${SRC_GROUPS} --shell ${SRC_SHELL} --create-home ${DEST}
passwd ${DEST}
@nsollazzo
nsollazzo / docker-install.sh
Last active May 15, 2019 13:04
Install Docker and docker-compose on Linux
#!/usr/bin/env bash
# Install docker CE on Ubuntu & derivatives
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
@nsollazzo
nsollazzo / keybase.md
Created May 26, 2019 19:15
keybase verification

Keybase proof

I hereby claim:

  • I am nsollazzo on github.
  • I am nsollazzo (https://keybase.io/nsollazzo) on keybase.
  • I have a public key ASDWbK2ylTWkkfZ5akd7mmwqCdHxAHb16ZOJoZ2gqLNMfwo

To claim this, I am signing this object: