Skip to content

Instantly share code, notes, and snippets.

View zganger's full-sized avatar

Zack Ganger zganger

View GitHub Profile
@zganger
zganger / docker_cli.md
Last active January 8, 2023 15:12
Helpful Docker CLI commands (1.13.x+ syntax)

Some helpful commands for Docker CLI

With release 1.13, Docker has greatly simplified interacting with the various assets docker containers use to run. These components include containers, networks, volumes, and images.

  • List all images: docker image ls -a

  • List all containers: docker container ls -a

  • Stop all containers: docker container stop $(docker container ls -aq)

  • Remove all stopped containers: docker container rm -v $(docker container ls -aq)

  • Pull new images: docker pull : (default version is :latest)

@zganger
zganger / elastic-ec2.md
Created March 16, 2017 18:03 — forked from okulik/elastic-ec2.md
ElasticSearch installation, EC2 instance provisioning, logstash configuration etc.

Provisioning EC2 instance for ElasticSearch

EC2 instance type

Use c3.xlarge instance or c3.2xlarge instance to store ElasticSearch server. We need a fair bit of RAM and computing power, as well as 2 SSD disks for storage. We need to choose exising IAM role or create a new one so that ElasticSearch can seamlessly discover other cluster nodes hosted on EC2. Also, don't forget to add both SSDs to the list of devices (/dev/sdb and /dev/sdc).

Linux system modification

Increase number of open file handles

First we need to increase system-wide file descriptor limits. To make it work temporary (will reset on the next reboot) execute from bash:

@zganger
zganger / Jetbrains_localdb.md
Last active April 18, 2017 18:26
Using JetBrains tools with SQL Server LocalDB

How to set up a connection to LocalDb using JetBrains IDEs

Microsoft does not provide suport for LocalDb using the Microsoft driver. Use jTds.

  • Add a Sql Server (jTds) or LocalDb driver
  • Select LocalDb next to URL type
  • Find LocalDb executable at C:\Program Files\Microsoft Sql Server\<version>\Tools\Binn\SqlLocalDB.exe
  • Enter the name of the database
  • Select the instance your db runs on
  • Use windows domain auth (You don't need to set it up this way, but it is the easiest to do so)
@zganger
zganger / git_guide.md
Last active March 28, 2019 15:45
A simple guide to using git with a fast-forward rebase workflow

Using Git with a fast-forward rebase workflow

General workflow:

  • To clone a repo: move to the desired diretory and git clone git@<host>:<organization>/<repository>.git
  • To view your current branch and changes: git status
  • To view commit history on current branch: git log
  • To get lastest code: git pull origin <branch_name> while in your repostory directory
  • To view all local branches: git branch
  • To create a branch: git checkout -b <branch_name> while in your repostory directory
  • To stage for commit: add changes using git add <file_name> <file_name_2> or git add -a :/ to take all changes
  • To commit: git commit -m '<add commit comment here>'
@zganger
zganger / pyenv_virtualenv.md
Created February 4, 2020 15:34
Use pyenv with a virtualenv

Using pyenv with virtual environments

Installation:

  • On Mac: brew install pyenv-virtualenv
  • On Linux:
    sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
    libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
    curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
    
@zganger
zganger / pyenv_virtualenv.md
Created February 4, 2020 15:34
Use pyenv with a virtualenv

Using pyenv with virtual environments

Installation:

  • On Mac: brew install pyenv-virtualenv
  • On Linux:
    sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
    libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
    curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash