Skip to content

Instantly share code, notes, and snippets.

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

Indrek Vändrik IndrekV

🏠
Working from home
View GitHub Profile
@IndrekV
IndrekV / Virtual Box Host Only Static IP.md
Last active November 27, 2018 10:37 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP (November 2018)

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox:

  • Select "Global Tools" in the top right side of the VirtualBox main window.
  • Go to the "Host Network" selectionstab
  • Add a Host-only Network
  • Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)
@IndrekV
IndrekV / repo-rinse.sh
Created January 8, 2019 05:56 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@IndrekV
IndrekV / ame
Created July 4, 2019 12:21 — forked from yoshinari-nomura/ame
Set your status in Slack with CLI
#!/bin/bash
################################################################
## Usage
usage() {
echo "ame [-c CONFIG_FILE] [-t TEAM] ICON TEXT"
echo " -c Set config file name."
echo " -t Set Slack team name."
echo "examples:"
@IndrekV
IndrekV / postgres-cheatsheet.md
Created July 15, 2020 05:51 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)