Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile
@holms
holms / gist:cf04b4b316e722aea7c801daffa3bcc1
Created April 20, 2018 10:22
Remove folder from git history
git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo node_modules/ >> .gitignore
git add .gitignore
git commit -m 'Removing node_modules from git history'
git gc
git push origin master --force
@holms
holms / gist:1f4e55f61a32931e55ac5fc1e8bd623b
Created April 13, 2018 06:08
Bluetooth on raspberry pi
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:15:83:15:A3:10 Discovering: yes
[CHG] Device 7C:1E:52:0B:0D:97 LegacyPairing: yes
@holms
holms / gist:5e8b8774473241a4852e9d69df800441
Created April 13, 2018 06:07
Hook on one terminal input to another
script -f /dev/tty1
@holms
holms / gist:d740b2ae366cd3cd322fb44e100c2d34
Last active April 9, 2018 05:23
docker-compose run hostname doesn't work

I've been searching for this all over the internet too. All you need is to add name for your container and it will be available for othre containers:

docker-compose run --name mycontainer mycontainer <whatever-command-here>

This was exact reason why depedencies couldn't connect to app container.

FROM gocd/gocd-server:v17.9.0
RUN mkdir -p /godata/plugins/external
ARG PLUGIN_AUTH=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.4/github-oauth-login-2.4.jar
ARG PLUGIN_YAML=https://github.com/tomzo/gocd-yaml-config-plugin/releases/download/0.4.0/yaml-config-plugin-0.4.0.jar
ARG PLUGIN_GITHUB_PR=https://github.com/ashwanthkumar/gocd-build-github-pull-requests/releases/download/v1.3.4/github-pr-poller-1.3.4.jar
ARG PLUGIN_GITHUB_STATUS=https://github.com/gocd-contrib/gocd-build-status-notifier/releases/download/1.2/github-pr-status-1.2.jar
RUN apk update && \
apk add --update curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /godata/plugins/external
created directory: '/godata/artifacts'
'/go-working-dir/artifacts' -> '/godata/artifacts'
created directory: '/godata/config'
'/go-working-dir/config' -> '/godata/config'
created directory: '/godata/db'
'/go-working-dir/db' -> '/godata/db'
created directory: '/godata/logs'
'/go-working-dir/logs' -> '/godata/logs'
'/go-working-dir/plugins' -> '/godata/plugins'
created directory: '/godata/addons'
@holms
holms / gist:cbe571e18a569f82a95aec40b15f7c0b
Created August 7, 2017 10:06
Dockerfile use requirements.dev.txt if $DEV is set
RUN if [ "$DEV" = "True" ]; then pip install -r requirements.dev.txt; fi
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCi9uMCmfxFE/BoOQV2OLEx4QKzDzX4JtvUjmjIRTbC/kCr/qmwMYJHVUXZ6ciCTN3tdzdljmmQfFD9d1Lu/ZDdUDU/FJ+yEbKgsf6Ct1Bw6UcaC4iyYV89S8iQfnSLXzeDJcla19BYawvgZfW9jsxgyzAoyKKyVWGM1uMllJ6aprtaM7zetw6mBEomrtLB6Ez17nC9Ipna+EUcogENxGv5H0G6h4ipfQL2EZeetINk9mg9I1xsMdMAaEg/mSRhT9neFkxovOko/hND2aNx+VtARUZ0aTjou03JKZ2elpASOMIyb38n+J94pzQ7WOc3zY0qdqEHAM+e6YPb1MOKaYZp holms@Romans-MacBook-Pro.local
URxvt.transparent: true
URxvt.xftAntialias: false
URxvt*font: xft:Helvetica Neue:pixelsize=10:antialias=false:hinting=false
URxvt*boldFont: xft:Helvetica Neue:pixelsize=10:antialias=false:hinting=false
URxvt*saveLines: 9999
URxvt*background: #000000
URxvt*foreground: #dcdccc
URxvt*scrollBar: False
URxvt*depth: 32
URxvt.loginShell: true
Romans-MacBook-Air:holms-docker holms$ docker-machine ssh do-master01 docker swarm join --token $(docker-machine ssh do-primary docker swarm join-token manager -q) --advertise-addr=$(docker-machine ip do-master01) $(docker-machine ip do-primary):2377
Get https://api.digitalocean.com/v2/droplets/47109671: x509: certificate signed by unknown authority
Error response from daemon: invalid join token
exit status 1
Romans-MacBook-Air:holms-docker holms$ docker-machine ssh do-master01 docker swarm join --token $(docker-machine ssh do-primary docker swarm join-token manager -q) --advertise-addr=$(docker-machine ip do-master01) $(docker-machine ip do-primary):2377
This node joined a swarm as a manager.