I want to install Wine on Mint

  • Make a note of the Ubuntu release that the version of Mint is based on
    • <RELEASE> before “contrib” in the entry in /etc/apt/sources.list
    • sudo nano /etc/apt/sources.list
  • add the Wine repository on our distribution
  • sudo apt-get update
  • sudo apt-get install –install-recommends winehq-stable -y
    • To install development version
    • sudo apt-get install –install-recommends winehq-devel -y
  • wine –version
  • winecfg

Additional troubleshooting help at

Setup SSH Public Key authentication to login to a target

  • On your host machine, use ssh-keygen to generate an SSH key pair
    • ssh-keygen -t rsa
      • Follow the prompts
        • choose the <location> for the file
        • choose a <keyname> e.g. id_rsa_name_of_target
        • set a strong password to unlock the private key
        • default key-length is 2048-bits (don’t change if you do not understand what you are doing)
        • at the end of this process you will have a private/public keyfile <keyname> and a separate file with only the public key <keyname.pub>
      • N.B the private must never ever leave the host
      • Comprehensive information can be found at the link below information can be found at https://www.ssh.com/ssh/keygen/
  • Output the public key  in the format required by the target e.g. Open Media Vault v2.0 needs the public key to be output in RFC 4716 format
    • ssh-keygen -e -f </location/keyname>
  • Copy the public key to the target.
  • Use the host machine where the private key is stored to login to target server
    • ssh <user>@<IP address of target> -i <location>/<keyname>

Backgrounding tasks in Linux with nohup and screen

Notes made while following along lecture in the course “Running Kali on Raspberry Pi” by Dr. Polstra on Pentest Academy

nohup

  • nohup –help (Run command, ignoring hangup signals. Basic command line direction)
  • nohup ls / -lR &
    • Runs the ls /-lR command in the background (&)
    • nohup ensures that output is written to nonhup.out and that command runs even if connection to terminal is lost
  • ls
  • logout (to simulate a loss of connection)
  • ssh -X root@<ip-add>
  • nano nohup.out

Expermiment with a script

create loopy.sh

#!/bin/bash
while true
do
echo “Computing..”
sleep 2

  • nohup ./loopy.sh &
  • tail -f nohup.out
  • nohup ./loopy.sh > loopy.out &
  • tail -f loopy.out

screen

  • which screen
  • no output imples scream not installed
  • apt update
  • apt install screen
  • screen
  • ps
  • ps -ef [pipe] grep screen
  • [CTRL A] ? — shows commands available in screen
  • [Return] to end
  • [CTRL A C] for a new screen
  • top
  • [CTRL A N] for next screen
  • vi
  • [CTRL A N] to scroll between top and vi
  • [CTRL A P] for previous
  • [CTRL A D] to detach from a screen
  • screen -r (to go back to where you started)
  • [CTRL A H] or log of sessions
    • ls -l
      • hardcopy.0
      • cat hardcopy.0
  • [CTRL A M] – to setup alterts
    • echo “starting”; sleep 10; echo “done”
    • will flash alert on the screen when there is output
  • [CTRL A X] to lock a screen
  • [CTRL A K] to kill the window

Install Sublimetext on Mint using apt

https://www.sublimetext.com/docs/3/linux_repositories.html#aptInstall the GPG key:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

Ensure apt is set up to work with https sources:

sudo apt-get install apt-transport-https

Select the channel to use:

Stable
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
Dev
echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

Update apt sources and install Sublime Text

sudo apt-get update
sudo apt-get install sublime-text

DevSecOps Bootcamp Environment Setup

Summary of instructions from http://www.devsecops.org/ for personal reference

https://github.com/devsecops/bootcamp
https://github.com/devsecops/bootcamp/blob/master/Week-1/labs/LAB-3.md

Launching the Vagrant Virtual Machine

  • In Terminal, make a dso_repos directory and clone the bootcamp repository into it:
mkdir $HOME/dso_repos
cd $HOME/dso_repos
git clone git@github.com:devsecops/bootcamp.git
  • Change directory to the bootcamp directory and launch the virtual machine:
cd bootcamp
vagrant plugin install vagrant-vbguest
vagrant up
  • Depending on your hardware, this process may take 10 minutes to complete. Once complete, connect to the virtual machine:
vagrant ssh

If, after you SSH, you notice that

aws configure

has no output, you may need to run

vagrant provision

Launching the Vagrant Virtual Machine

  • In Git Bash, make a dso_repos directory and clone the bootcamp repository into it:
mkdir dso_repos
cd dso_repos
git clone git@github.com:devsecops/bootcamp.git
  • Change directory to the bootcamp directory, install a vagrant plugin, and launch the virtual machine:
cd bootcamp
vagrant plugin install vagrant-vbguest
vagrant up
  • Depending on your hardware, this process may take 10 minutes to complete. Once complete, connect to the virtual machine:
    vagrant ssh
  • To validate all packages were installed type:
    aws configure
    The expected output looks like this:

    AWS Access Key ID [None]:
    AWS Secret Access Key [None]:
    Default region name [None]:
    Default output format [None]:

DevSecOps Studio Cheatsheet

Most up to date instructions can be found at https://dso-studio.teachera.io/

Install Virtualbox

Vagrant

sudo apt-get install vagrant python2 python2-pip

Ansible

pip install ansible
# Download the code
$

# Download the ansible dependency roles
$ ansible-galaxy install -r requirements.yml -p provisioning/roles

# Setup the environment, takes an hour or less based on your internet speed.
$ vagrant up