Skip to content

Instantly share code, notes, and snippets.

@ypolosov
ypolosov / gist:05095cc92b83df689d9be6d2fd8dd8b3
Created March 23, 2018 08:58
hard git reset on a remote repo
git reset --hard <commit>
git push -f origin <branch>
git pull
@ypolosov
ypolosov / gist:ec058052a57f0c0b10b72ef8651aaeae
Last active February 8, 2018 09:25
how to know who uses a port
sudo netstat -nlp|grep ':27017'
or
kill $(lsof -t -i:27017)
#!/bin/bash
# Delete all containers
docker rm -f $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
@ypolosov
ypolosov / remove-all-dockers.sh
Created September 8, 2017 07:16
how to know who uses a port
sudo netstat -nlp|grep ':27017'
@ypolosov
ypolosov / cloudSettings
Last active August 15, 2019 10:06
remove all docker containers and images
{"lastUpload":"2019-08-15T10:06:33.780Z","extensionVersion":"v3.4.1"}
@ypolosov
ypolosov / gist:ebf52515487e477248a3b17eeac751e7
Created April 5, 2017 12:45 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@ypolosov
ypolosov / hello-world.js
Last active December 10, 2016 13:17
Hello world!
console.log('Hello world!');