Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicety for those using VSCode #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && apt upgrade -y

RUN apt update --fix-missing && apt install -y \
sudo \
build-essential \
curl \
git \
make \
python3 \
python-is-python3 \
wget

RUN apt update --fix-missing && apt install -y \
clang \
llvm \
lld \
gdb \
qemu-system


# Add custom user "dev" with sudo permissions
RUN useradd dev -u 1000 -m -s /bin/bash && \
echo "dev ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER dev


# Install GEF for sanity & its dependencies
RUN sudo apt install -y file && bash -c "$(wget https://gef.blah.cat/sh -O -)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use VS, and I am not responsible for this repo, but I know a curl | sh when I see one


# Terminal prompt customizations
COPY custom/gu /usr/local/bin/gu
COPY custom/.bashrc /home/dev/.bashrc
RUN sudo chown dev:dev /usr/local/bin/gu
RUN sudo chown dev:dev /home/dev/.bashrc

56 changes: 56 additions & 0 deletions .devcontainer/custom/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# customized PS1 prompt to indicate we are in a container
PS1="\W \e[01;31m$\e[m "

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# custom
alias l="ls -lah"
alias ..="cd .."

# git aliases
alias gs="git status"
alias gc="git commit -m "
alias ga="git add "
alias gp="git push"
alias gpl="git pull"
alias gl="git log --pretty=oneline"

# check the window size after each command and, if necessary
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"


# Alias definitions in bash_aliases
if [ -f ~/work/scripts/.bash_aliases ]; then
. ~/work/scripts/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "aos-dev",

"build": {
"dockerfile": "Dockerfile"
},

"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
]
}
},
"capAdd": ["SYS_PTRACE"],
"securityOpt": [ "seccomp=unconfined" ],

// If you need more ports forwarded, add them here
"forwardPorts": [
],

}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode
__pycache__
obj
.gdbrc*
*jos*
1 change: 0 additions & 1 deletion README

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Welcome to the OpenLSD framework.

# Usage with VSCode and Docker
VSCode ships an extension called [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) which allows you to open a repository inside of a Docker container that has all necessary development tools installed. This isolates your development environment from your host machine. Simply install the extension, then run the _"Dev Containers: Rebuild and Reopen inside Container"_ command from VSCode's command palette. It will take a while to build the container, however after that it will be cached and can be opened quickly.
100 changes: 0 additions & 100 deletions jos.out

This file was deleted.

100 changes: 0 additions & 100 deletions jos.out.mcorefork

This file was deleted.