Skip to content

Instantly share code, notes, and snippets.

View bgadrian's full-sized avatar
✍️
available for OSS Go packages

B.G.Adrian bgadrian

✍️
available for OSS Go packages
View GitHub Profile
@bgadrian
bgadrian / mongo-localserver.sh
Last active October 25, 2020 14:34
Mongo and mongo-express local dev setup, for meteor
#!/usr/bin/env bash
docker stop mongo-server
docker rm mongo-server
#start meteor with env variable MONGO_URL=mongodb://localhost:27017/yourDatabase
#meteor /db/ path is in .meteor/local/db/
docker run --name mongo-server -it -d \
-v /var/www/mongoData:/data/db \
--net="host" \
@bgadrian
bgadrian / mongo-express.meteor.run.sh
Last active April 6, 2017 10:11
Keep a mongo-express (similar to phpmyadmin) running to manage Meteor MongoDB
#!/usr/bin/env bash
docker stop mongo-express
docker rm mongo-express
#accesible from a host, if is a VM :0.0.0.0
#auto restarts - it will reattach at every meteor server restart
#requires Docker
#address will be localhost:8081 or http://your.VM.ip:8081/db/meteor/
@bgadrian
bgadrian / cleanup.sh
Last active December 21, 2017 15:20
Cleanup Web Ubuntu machine
#docker
#docker rmi $(docker images -q -f dangling=true)\
docker system prune #it will remove any stopped containers, unused volumes and networks, and dangling images.
#Remove all images
#docker rmi $(docker images -q)
#Remove all containers
#docker rm $(docker ps -aq)
#node npm meteor
npm cache clean
@bgadrian
bgadrian / Dockerfile
Created March 7, 2017 11:30
Static website when your servers are offline, with docker
FROM nginx:1.11.10
COPY nginx.conf /etc/nginx/conf.d/default.conf
#your static website source is in /maintenace/src/, copy it inside the container
COPY src/. /usr/share/nginx/html
@bgadrian
bgadrian / Win10startupFolder.txt
Last active March 3, 2017 13:33
Windows 10 access startup folder
win+R (Run)
type shell:startup
@bgadrian
bgadrian / cleanup.sh
Last active March 8, 2017 16:15
Cleanup docker - HDD space
#tangled images
docker rmi $(docker images -q -f dangling=true)
@bgadrian
bgadrian / fix_git_corrupted_objects.sh
Created February 1, 2017 16:19
Git corrupted data, lose objects, errors.
#Unfortunately you will lose any unpushed commits and stashed changes, however your working copy should remain intact.
cp -r . ../backupDontForget
rm -fr .git
git init
git remote add origin [your-git-remote-url]
git fetch
git reset --mixed origin/master
git branch --set-upstream-to=origin/master master
#commit and push
@bgadrian
bgadrian / bring_hunks.sh
Created September 19, 2016 08:41
copy file updates from a commit
git diff HEAD..e37dbcc0d9 PathtoFile.cs | git apply --whitespace=fix --ignore-space-change --ignore-whitespace -v
zip -r testcat.zip ~/MyFolder -i '*XXX*.jpg' '*YYY*.png'
ssh-add
VBoxHeadless --startvm "box-dev-debian"&
sleep 5
mkdir -p /Volumes/dev-box
sudo mount -t nfs -o resvport,rw 192.168.56.101:/var/www /Volumes/dev-box