Skip to content

Instantly share code, notes, and snippets.

View silvae86's full-sized avatar

João Rocha da Silva silvae86

View GitHub Profile
@silvae86
silvae86 / Setup MongoDB on localhost as Replica Set
Created February 22, 2021 16:29 — forked from davisford/Setup MongoDB on localhost as Replica Set
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@silvae86
silvae86 / setup.md
Created April 10, 2020 00:41 — forked from Yatoom/setup.md
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@silvae86
silvae86 / GIF-Screencast-OSX.md
Created January 28, 2020 19:08 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@silvae86
silvae86 / remove-all-from-docker.sh
Created January 28, 2019 17:08 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@silvae86
silvae86 / .dockerignore
Created June 29, 2018 15:44 — forked from evelyne24/.dockerignore
Docker-ize Connfa
Dockerfile
.git
.git*
@silvae86
silvae86 / track_remote_repo.sh
Last active March 8, 2018 16:19
Creating a new repository tracking another
#!/bin/bash
#credit https://stackoverflow.com/questions/24815952/git-pull-from-another-repository
#initialize repository
mkdir dendro-install-uporto
cd dendro-install-uporto
git init
git remote add origin https://github.com/feup-infolab/dendro-install-uporto.git
echo "# dendro-install-uporto" >> README.md
git add .
@silvae86
silvae86 / osx-10.9-setup.md
Created January 27, 2018 15:37 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@silvae86
silvae86 / script.md
Created December 11, 2017 17:09
Start VMs Automatically in Ubuntu 16.04 Server
sudo vim /etc/systemd/system/[email protected]
Requires=systemd-modules-load.service
After=systemd-modules-load.service

[Install]
[Unit]
@silvae86
silvae86 / gist:fa1ebc2f51876a16ff269921d7d96bb4
Created November 22, 2017 13:49 — forked from reidransom/gist:6042016
Auto-starting VirtualBox VMs on OS X

Auto-starting VirtualBox VMs on OS X

After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.

Link to original article.

Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.

sudo cp \

/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \

@silvae86
silvae86 / gist:bc2aef529b0cc7da827aee05225c9f26
Created November 13, 2017 17:26
Solving Spawn ENOMEM Error in Ubuntu + NodeJS
#credits https://stackoverflow.com/questions/26193654/node-js-catch-enomem-error-thrown-after-spawn
sudo fallocate -l 4G /swapfile #Create a 4 gigabyte swapfile
sudo chmod 600 /swapfile #Secure the swapfile by restricting access to root
sudo mkswap /swapfile #Mark the file as a swap space
sudo swapon /swapfile #Enable the swap
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab #Persist swapfile over reboots (thanks for the tip, bman!)