Skip to content

Instantly share code, notes, and snippets.

View mtbiker-s's full-sized avatar

mtbiker-s mtbiker-s

View GitHub Profile
@mtbiker-s
mtbiker-s / WSL-ssh-server.md
Created June 22, 2020 06:10
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux running Ubuntu 18.04

How to automatically start ssh server on boot on Windows Subsystem for Linux


This works with Ubuntu 18.04LTS. I make no promises about other distributions, but direct anyone else to an older Gist which apparently works for 16.04LTS.

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Uninstall and reinstall the ssh server using the following commands:
    1. sudo apt remove openssh-server
    2. sudo apt install openssh-server
  2. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@mtbiker-s
mtbiker-s / encrypt-decrypt-tar.gz.sh
Created June 21, 2019 07:31
Bash functions for encrypting and decrypting tar.gz
# These functions can be added to your .bash_aliases or your .bashrc
# So that it can help you encrypt or decrypt .tar.gz files
# Takes 2 params
# $1 is name of file or dir you want to tar
# $2 is name tar file, does not need the tar.gz extension it will added it.
function encrypt-tar-gz(){
dataToEncrypt=$1
fileName=$2".tar.gz"
echo "Attempting to encrypt data to "$fileName
@mtbiker-s
mtbiker-s / print_progress.py
Created March 27, 2018 20:09 — forked from aubricus/License
Python Progress Bar
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
@mtbiker-s
mtbiker-s / gitProfileSwitch.sh
Created August 15, 2017 00:34
BASH Script to change your git profile from your work profile to your personal GH profile or vice versa.
#!/bin/bash
# That is for OSX
# For *nix use #!/usr/bin/bash
echo "Switching git user profile"
echo
echo "Curent git profile"
git config -l
echo "Please enter which profile to use 'work' or 'personal'"
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*