Skip to content

Instantly share code, notes, and snippets.

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

Anton Pegov antonpegov

🏠
Working from home
View GitHub Profile
@antonpegov
antonpegov / kill-docker-daemons.sh
Created December 9, 2019 11:40
Kill all "ghost" docker daemons before starting new one
rm /var/run/docker.pid
ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sudo sh
# final check:
ps -aux | grep [d]ocker
@antonpegov
antonpegov / start-runner.sh
Last active December 10, 2019 18:22
Connect gitlab-runner running in docker container to gitlab running in different container
docker pull gitlab/gitlab-runner
#Argument 1 is runner name
docker run -d --name $1 \
-v /var/run/docker.sock:/var/run/docker.sock \ # this line not saved in config file (next line)
-v /srv/$1/config:/etc/gitlab-runner \ # so I had to manually add volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
-v /chace \
gitlab/gitlab-runner
@antonpegov
antonpegov / backup.sh
Last active December 8, 2019 11:17
Backup of gitlab instance running in docker container
TODAY=`date '+%Y%m%d'`
mkdir backup
docker stop gitlab
docker commit gitlab local/gitlab-container-$TODAY
docker save local/gitlab-container-$TODAY > ./backup/gitlab-container-$TODAY.tar
docker run --rm --volumes-from gitlab -v $(pwd)/backup:/backup ubuntu tar cvf /backup/gitlab-volume-etc-$TODAY.tar /etc/gitlab
docker run --rm --volumes-from gitlab -v $(pwd)/backup:/backup ubuntu tar cvf /backup/gitlab-volume-log-$TODAY.tar /var/log/gitlab
docker run --rm --volumes-from gitlab -v $(pwd)/backup:/backup ubuntu tar cvf /backup/gitlab-volume-opt-$TODAY.tar /var/opt/gitlab
@antonpegov
antonpegov / gist:c03dc8301d2956fc88e68c3115dcc42d
Created October 17, 2019 08:42
Kind of 'ng-let' in Angular2+
<div *ngFor="let user of [user$ | async]">
<span>{{ user?.name }}</span>
</div>
@antonpegov
antonpegov / gist:c1d141c6332508d7faf3b910597ee387
Created August 1, 2019 12:57
Disable Linux file permissions bug for git repository on windows
git config core.filemode false
@antonpegov
antonpegov / karms.conf.js
Created June 24, 2019 14:44
Test debug setup for VSCode
...
autoWatch: true,
browsers: ['ChromeDebugging'],
singleRun: false,
customLaunchers: {
ChromeDebugging: {
base: 'Chrome',
flags: [ '--remote-debugging-port=9333' ]
}
},
@antonpegov
antonpegov / gist:5ebc28ddb11a0a8d51a860a155b7bd3a
Last active March 15, 2019 14:50
Cool new Angular stuff
// libs:
NGX-UI https://github.com/swimlane/ngx-ui
NGX-CHARTS https://github.com/swimlane/ngx-charts
NG-CHARTS https://github.com/valor-software/ng2-charts
NGX-DATATABLE https://github.com/swimlane/ngx-datatable
// tools:
STORYBOOK https://storybook.js.org/
@antonpegov
antonpegov / gist:9b47dc517e2f96d6d9f671fefbb227f3
Created October 4, 2018 14:52
Solving CORS problem with http-proxy
const url = require('url');
// .. your proxyHttp conf
const allowedOrigins = ['www.mydomain.com', 'mydomain.com'];
proxyHttp.on('proxyRes', (proxyRes, req, res) => {
let allowedOrigin = false;
if (req.headers.origin) {
const originHostName = url.parse(req.headers.origin).hostname;
@antonpegov
antonpegov / setting-up-babel-nodemon.md
Created October 4, 2018 14:48 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@antonpegov
antonpegov / gist:b434c5a4c62ca72e321222cd3dd7a8fc
Created July 30, 2018 10:00
Magic remote project merge with local git feature branch
git pull origin master --allow-unrelated-histories