Skip to content

Instantly share code, notes, and snippets.

View bluetoothfx's full-sized avatar

Syed Refat Al Abrar bluetoothfx

View GitHub Profile
@bluetoothfx
bluetoothfx / PI hole with docker yml file
Created April 4, 2020 15:15
PI hole with docker yml file example
version: "3"
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
ports:
@bluetoothfx
bluetoothfx / Pi-hole & OpenVPN
Last active April 4, 2020 10:08
pi hole & open vpn setup with docker
# Clone repo
> git clone https://github.com/mr-bolle/docker-openvpn-pihole.git
# Run installer
> cd docker-openvpn-pihole && bash openvpn-install.sh
Hint:
# This repo can't generate password protected client profile.
To create password protected client profile please use following code.
@bluetoothfx
bluetoothfx / open vpn with docker
Last active March 29, 2020 09:40
vpn install in ubuntu server
Some example to setup own vpn server for safety on open wireless.
Server must be KVM based or others. Not OpenVZ. OpenVZ has some difficulties.
Check your server via
> hostnamectl status
# With docker - compose (Tested & running)
https://github.com/kylemanna/docker-openvpn/blob/master/docs/docker-compose.md
# With docker
https://github.com/kylemanna/docker-openvpn
@bluetoothfx
bluetoothfx / ubuntu user management
Created March 28, 2020 07:38
sample of ubuntu user mangement
To list all local users you can use:
> cut -d: -f1 /etc/passwd
## Some more useful user-management commands (also limited to local users):
# To add a new user you can use:
> sudo adduser new_username
or:
> sudo useradd new_username
@bluetoothfx
bluetoothfx / redis docker-compose with external configuration
Last active April 5, 2020 13:16
an example for docker-compose.yml file with redis
Example docker redis yml file
---------------------START------------------------
version: '3'
services:
redis:
image: redis:latest
container_name: redis1
ports:
- 6379:6379
volumes:
@bluetoothfx
bluetoothfx / tmux_basics
Last active March 26, 2020 09:14
basic tmux commands
tmux:
What is tmux?
Tmux is a terminal multiplexer an alternative to GNU Screen. In other words, it means that you can start a Tmux session and then open multiple windows inside that session. Each window occupies the entire screen and can be split into rectangular panes.
With Tmux you can easily switch between multiple programs in one terminal, detach them and reattach them to a different terminal.
Tmux sessions are persistent, which means that programs running in Tmux will continue to run even if you get disconnected.
All commands in Tmux start with a prefix, which by default is ctrl+b.
Need a linux hosted VM (ex. Ubuntu)
STEP 01. Add Following yml file (which is created by default - Git action template)
*******************************File Start*************************************
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
@bluetoothfx
bluetoothfx / docker-compose
Last active March 28, 2020 15:55
simple docker compose commands
#To check docker compose version
> docker-compose -v
#To create docker file
> touch docker-compose.yml
#Docker compose file validity
> docker-compose config
#Start docker compose
Login psql from terminal
> sudo -i -u postgres psql
List of DB
> \l
List available tables
> \dt
Describe a table
@bluetoothfx
bluetoothfx / redis.learn
Last active May 29, 2023 07:04
Start a Redis database using Docker
# To get & run redis on docker (6379 is default port)
> docker run -d -p 6379:6379 --name redis1 redis
# Run redis on docker & guaranteed backup (-create /home/redisDB directory 1st in your host machine)
> docker run -v /home/redisDB:/data -d -p 6379:6379 --name redis1 redis redis-server --appendonly yes
# to check if redis is functioning in docker (status checking)
> docker ps
# to view redis logs
> docker logs redis1
# start a new interactive session (-it) inside the running container
> docker exec -it redis1 sh