Skip to content

Instantly share code, notes, and snippets.

View Eduard-gan's full-sized avatar

Eduard Gan Eduard-gan

  • Self employed
  • Russian federation
View GitHub Profile
docker run -d --hostname mf_rabbit --name mf_rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3.7.15
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user your_user your_password
rabbitmqctl set_user_tags your_user administrator
rabbitmqctl set_permissions -p / your_user ".*" ".*" ".*"
@Eduard-gan
Eduard-gan / gist:71b900cc4ecca07bd87feb12ad7d1c5f
Last active April 14, 2021 06:30
Virtualfish setup on Debian
WARNING! VF can be installed in both python3 or python2.7 you should check that versions of python match in both commands (pip install and coammand in config.fish)
sudo pip3 install virtualfish
echo "eval (python3 -m virtualfish)" >> ~/.config/fish/config.fish
Copy output of "funced -e nano fish_prompt"
Paste to "nano ~/.config/fish/functions/fish_prompt.fish"
or just
# Docker - How to cleanup (unused) resources
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
## delete volumes
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@Eduard-gan
Eduard-gan / gist:be4c25e05d9c8721f1dac48e974df31f
Last active November 24, 2018 14:10
Change default storage path of dockerd
1) Make sure you're stopped the main daemon: sudo systemctl stop docker ; systemctl status docker
2) Create your new storage directory: sudo mkdir /storage
3) Move existing content to that diractory: sudo mv /var/lib/docker /storage
4) Configure daemon to use new directory: sudo nano /etc/docker/daemon.json
{
"data-root": "/storage/docker"
}
5) Start main daemon again: sudo systemctl start docker ; systemctl status docker
set OVPN_DATA "ovpn-data-dir"
docker volume create --name $OVPN_DATA
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_genconfig -u udp://xl.novk.ga
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn ovpn_initpki
docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn easyrsa build-client-full root nopass
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_getclient root > root.ovpn
@Eduard-gan
Eduard-gan / Dockerfile
Last active November 4, 2018 13:02
Delegated Socks proxy in Docker container
#
# Dockerfile for delegated
#
FROM debian
MAINTAINER kev <[email protected]>
ENV DG_VERSION 9_9_13
ENV DG_FILE linux2.6-dg${DG_VERSION}.tar.gz
ENV DG_DIR dg${DG_VERSION}
ENV DG_URL http://delegate.hpcc.jp/anonftp/DeleGate/bin/linux/latest/${DG_FILE}
# Filter Delegated log at /usr/share/delegated/log/53120
[Init]
maxlines = 50
[Definition]
datepattern = %%m/%%d %%H:%%M:%%S
failregex = .*?E-P: No permission: <HOST>.*?\(SocksV4 is not acceptable\)
# This will temporairly create /var/novk/ssl/.well-known/xxxxxx confirmation file and trigger
# external check of it's availiblty and contents from letsencrypt's authority servers.
# This directory simply should be served by some http server when container launches
# This container isn't designed to be persistent and it will exit and removed once command will finish.
# You may simply add it into your crontab
docker run -it --rm --name certbot \
-v /var/novk/ssl:/var/novk/ssl \
-v /etc/letsencrypt:/etc/letsencrypt \
@Eduard-gan
Eduard-gan / gist:d653389551f9cf0683fdb1ac67a00d8c
Created October 31, 2018 05:58
MariaDB: Chaeck and repair tables
mysqlcheck -h 127.0.0.1 -u root -p -r YOUR_DB_NAME
@Eduard-gan
Eduard-gan / gist:c8cfc481399bbc77b59ba59ae4bac7ba
Created October 31, 2018 05:53
MariaDB: Show all tables engines for database
SELECT TABLE_NAME,
ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'YOUR DB NAME';