Skip to content

Instantly share code, notes, and snippets.

View kuznero's full-sized avatar

Roman Kuznetsov kuznero

View GitHub Profile
@kuznero
kuznero / docker-insatll-on-centos7.md
Last active March 10, 2016 15:26
Installing docker on CentOS 7

Installing docker on CentOS 7

Download and install docker-engine

sudo yum install ...

Configure it to run in docker group

@kuznero
kuznero / faenza.md
Last active July 26, 2016 10:58
KDE Faenza icons set
@kuznero
kuznero / ssh-keyring
Created July 5, 2015 18:24
SSH key ring on KDE @ CentOS
[1.] Install ksshaskpass
$ sudo yum install ksshaskpass
[2.] Create auto starting [askpass.sh] script at [~/.kde/Autostart]
#!/bin/sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
ssh-add < /dev/null
@kuznero
kuznero / sql-server-single-user-mode.md
Last active March 10, 2016 15:20
Single User mode routine in Microsoft SQL Server

Single User mode routine in Microsoft SQL Server

USE master;
GO
ALTER DATABASE <DatabaseName>
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
BEGIN TRY
  ALTER DATABASE <DatabaseName>
 SET ALLOW_SNAPSHOT_ISOLATION ON;
@kuznero
kuznero / aptitude-proxy.md
Last active September 26, 2016 08:08
Proxy configuration for aptitude

Proxy configuration for aptitude

sudo apt-key adv
  --keyserver-options http-proxy=http://127.0.0.1:3128
  --keyserver hkp://something.com:80
  --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

In case if CNTLM is unable to help, try to fallback to direct proxy url with credentials.

@kuznero
kuznero / docker-behind-proxy.md
Last active July 6, 2018 17:01
Work with Docker behind proxy

Work with Docker behind proxy

Docker on Linux OS

Following instructions are from official docuementation:

sudo mkdir /etc/systemd/system/docker.service.d
@kuznero
kuznero / docker-clean.md
Last active April 1, 2023 12:28
Cleanup docker images and containers after failed builds

Cleanup docker images and containers after failed builds

Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.

#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@kuznero
kuznero / docker-sync-submodules.md
Last active March 10, 2016 15:18
Synchronizing Git Submodules Modifying URLs

Synchronizing Git Submodules Modifying URLs

Sometimes it is not possible to access submodules as they were registered. Solution is here:

#!/bin/bash

NUMARGS=$#
SCRIPT=`basename ${BASH_SOURCE[0]}`
GREEN='\033[1;32m'
@kuznero
kuznero / build-mono-docker.md
Last active March 10, 2016 15:16
How to build .Net projects with Docker

How to build .Net projects with Docker

Certain folder structure is assumed

FAKE build script (build.fsx)

// include Fake libs
#r "./packages/FAKE/tools/FakeLib.dll"
@kuznero
kuznero / Ctrl-C-Console-App.md
Last active May 18, 2021 18:13
Console application that exit on Ctrl-C (ready for Docker)

Console application that exit on Ctrl-C (ready for Docker)

Console.ReadLine or Console.ReadKey do not work as expected under Docker container environment. Thus, typical way to solve this would be to properly handle Ctrl-C key combination.

C# snippet

using System;
using System.Threading;