Skip to content

Instantly share code, notes, and snippets.

View alexisrolland's full-sized avatar
:octocat:

Alexis ROLLAND alexisrolland

:octocat:
View GitHub Profile
@alexisrolland
alexisrolland / Update Ubuntu apt mirrors for China
Created December 24, 2020 02:12
Commands used to update the file /etc/apt/sources.list which contains the list of mirrors to download packages with apt command. Commands below were tested in a Docker container built with image ubuntu:18.04.
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" > /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-p
@alexisrolland
alexisrolland / Update apk mirrors for China
Last active November 8, 2023 06:27
Commands used to update the file /etc/apk/repositories which contains the list of mirrors to download packages with apk command. Commands below were tested in a Docker container built with alpine image.
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
apk update
@alexisrolland
alexisrolland / Install Kerberos in Docker
Last active March 15, 2024 06:12
Example of commands to install and use Kerberos in Docker
# Install Kerberos in Linux based Docker image
$ export DEBIAN_FRONTEND=noninteractive
$ apt-get install -y krb5-user libpam-krb5
$ kinit <account>@<COMPANY>.ORG
$ klist
# Create keytab file
$ ktutil
$ addent -password -p <account>@<COMPANY>.ORG -k 1 -e arcfour-hmac
$ write_kt <account>.keytab
@alexisrolland
alexisrolland / Useful Docker commands
Created February 8, 2020 15:35
Some useful examples of Docker commands which I'm tired to type over and over again...
# Connect to running container in interactive mode in a shell prompt
$ docker exec -it container_name sh
# Same as above with auto-remove and Docker network
$ docker run -it --rm --network network_name container_name sh
# Same as above with mounted volume (Windows Pro)
$ docker run -it --rm --network network_name -v "C:\host_path:/guest_path" container_name sh
# Same as above with mounted volume (Windows Home)
@alexisrolland
alexisrolland / Update pip mirrors for China
Last active December 24, 2020 02:09
Commands used to update pip mirrors to use one located in China. Commands below were tested in a Docker container built with image python:3.6.6-slim-stretch.
# Found on https://mirrors.ustc.edu.cn/help/pypi.html
pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple pip -U
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple
@alexisrolland
alexisrolland / Update Debian apt mirrors for China
Last active March 28, 2023 10:43
Commands used to update the file /etc/apt/sources.list which contains the list of mirrors to download packages with apt command. Commands below were tested in a Docker container built with image python:3.6.6-slim-stretch.
echo "deb http://ftp.cn.debian.org/debian/ stretch main" > /etc/apt/sources.list
echo "deb http://ftp.cn.debian.org/debian/ stretch-updates main" >> /etc/apt/sources.list
apt-get update