Skip to content

Instantly share code, notes, and snippets.

View wojciechowskimar's full-sized avatar

Marcin Wojciechowski wojciechowskimar

View GitHub Profile
## DOCKER COMPOSE
## Run
docker-compose up # Run compose file
docker-compose up -d # Run compose file in background
## Restart
docker-compose restart
### Only build
docker build -t friendlyhello . # Create image using this directory's Dockerfile
docker build -t <tag_name> . # Docker build
docker run --name <container_name> <image_name> # Run a container
docker run -p 4000:80 friendlyhello # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
docker run --rm -it --name <container_name> -d -p <DockerHostPort:ContainerPort> -v </path/in/host:/path/in/container> <image_name> bash # Run a container with some arguments
docker container ls # List all running containers
docker container ls -a # List all containers, even those not running
docker container stop <hash> # Gracefully stop the specified container

How To Use OpenSSL s_client To Check and Verify SSL/TLS Of HTTPS Webserver?

OpenSSL provides different features and tools for SSL/TLS related operations. s_lient is a tool used to connect, check, list HTTPS, TLS/SSL related information. Simply we can check remote TLS/SSL connection with s_client . In these tutorials, we will look at different use cases of s_client .

Check TLS/SSL Of Website

The basic and most popular use case for s_client is just connecting remote TLS/SSL website. We will provide the web site with the HTTPS port number. In this example we will connect to the poftut.com .

$ openssl s_client -connect poftut.com:443
@wojciechowskimar
wojciechowskimar / homebrew_install_virtualbox.sh
Created January 2, 2019 11:38
The following Homebrew commands can be used to install VirtualBox on macOS. Oracle Virtual Box is an application and hence brew cask commands are used.
#!/bin/bash
brew update # Fetch latest version of homebrew and formula.
brew tap caskroom/cask # Tap the Caskroom/Cask repository from Github using HTTPS.
brew search virtualbox # Searches all known Casks for a partial or exact match.
brew cask info virtualbox # Displays information about the given Cask
brew cask install virtualbox # Install the given cask.

Save a file you edited in vim without the needed permissions

w !sudo tee %

Global

  • :help keyword - open help for keyword
  • :saveas file - save file as
  • :close - close current pane
  • K - open man page for word under the cursor
@wojciechowskimar
wojciechowskimar / How to Auto Start a Guest VM in Oracle VM or XEN.md
Created August 24, 2018 08:51
How to Auto Start a Guest VM in Oracle VM/XEN

How to Auto Start a Guest VM in Oracle VM XEN.md

1. Log into 'Oracle VM Manager' CLI

ssh -l admin <Oracle VM Manager IP> -p 1000

2. Find the guest VM 'Config File Mounted Path'

show vm name=
@wojciechowskimar
wojciechowskimar / How to configure static IP on CentOS 7.md
Created August 24, 2018 08:45
How to configure static IP on CentOS 7

Get a list of NIC names using

ifconfig -a                                   # If you have net-tools instaled
Or
ip -a

Configure network card

vi /etc/sysconfig/network-scripts/ifcfg-en0xx # [Replace 'en0xx' with your Network Card e.g. en0]