Skip to content

Commit

Permalink
vscode (#1): released tails-code v1.0; vscode-portable-setup.sh v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Oct 23, 2020
1 parent 25c2040 commit 4658754
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 14 deletions.
39 changes: 27 additions & 12 deletions bin/tails-code
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
#
# USAGE: tails-code
#
# DESCRIPTION: Execute all .sh files on the directory
# ~/bin/startup-scripts/
# if the path exists. Then will search for files on
# ~/bin/startup-scripts-examples/
# Tip: you can also copy the contents of this file to some file
# that is executed by default on your terminal, like the
# ~/.bash_profile
# DESCRIPTION: tails-code is an somewhat equivalent to `code` on Linux/Mac,
# but focused on running on Tails. This script assumes
# VSCode portable was installed based on the
# docs/docs/vscode-portable-setup.sh
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# BUGS: 1. tails-code (at least alone) will not persist VSCode
# customizations. You would need to copy/rsync back
# from Desktop to Persistance the data/ folder
# NOTES: ---
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>, based on Patrick Blook work
# COMPANY: Etica.AI
Expand All @@ -24,12 +23,28 @@
# CREATED: 2020-10-23 21:54 UTC
# REVISION: ---
#===============================================================================
echo "TODO: tails-code"


if [ -f "/home/amnesia/Desktop/VSCode-linux-x64/code" ];
if [ -f "/home/amnesia/Desktop/VSCode-linux-x64/code1" ];
then
echo "tails-code: code already loaded on RAM"
echo "tails-code: code already loaded on RAM. Executing now"
/home/amnesia/Desktop/VSCode-linux-x64/code --no-sandbox $1
exit 0
fi

if [ ! -d "/home/amnesia/Persistent/software/portable/VSCode-linux-x64" ];
then
echo "ERROR! The following path do not exist on disk"
echo " /home/amnesia/Persistent/software/portable/VSCode-linux-x64"
echo " Please read the docs/vscode-portable-setup.sh"
echo " This scrilt will not download for you (not yet)"
echo " Exiting..."
exit 1
fi

echo "tails-code: load to RAM (~/Desktop/VSCode-linux-x64/code)"
cp -r /home/amnesia/Persistent/software/portable/VSCode-linux-x64/ /home/amnesia/Desktop

echo "tails-code: executing from RAM (~/Desktop/VSCode-linux-x64/code)"
echo "tails-code: INFO! tails-code v1.0 (at least alone) will not persist VSCode customizations."
echo " You would need to copy/rsync back from Desktop to Persistance the data/ folder"
/home/amnesia/Desktop/VSCode-linux-x64/code --no-sandbox $1
60 changes: 58 additions & 2 deletions docs/vscode-portable-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>
# COMPANY: Etica.AI
# LICENSE: Public Domain
# VERSION: 1.1
# VERSION: 1.2
# CREATED: 2020-10-17 10:57 UTC
# REVISION: 2020-10-17 10:57 UTC v1.1 re-started. The vscode-portable-setup.sh v1.0
# was deleted by mistake (around ~30min of
# work lost). TailsOS don't have a trash
# feature and even VSCode warned
# 2020-10-23 23:13 UTC v1.2 Improved! Now we have tails-code helper
# This doc still need for initial installation
#===============================================================================
echo "Usage:"
echo " cat vscode-portable-setup.sh"
Expand Down Expand Up @@ -101,4 +103,58 @@ tar -vzxf /tmp/vscode.tar.gz
tails-code

# To Open some specific folder, like /home/amnesia/Persistent/git/myusername/my-project
# tails-code /home/amnesia/Persistent/git/myusername/my-project
# tails-code /home/amnesia/Persistent/git/myusername/my-project

#******************************************************************************#
# PERSISTENT USAGE #
# Alternative to persist installer of cryptomator. Uses previous steps #
#******************************************************************************#

##### B.1. Requisites __________________________________________________________
#### B.1.1. Read Tails official documentation about setup persistence ..........
xdg-open https://tails.boum.org/doc/first_steps/persistence/index.en.html

#### B.1.1 Persistence should be enabled and unlocked ..........................
# If these commands don't return error, you're ok to go
ls /home/amnesia/Persistent/
ls /live/persistence/TailsData_unlocked/

##### B.2. Directory structure _________________________________________________
# We will create a place to store the portable app with somewhat optionated
# directory structure

#### B.2.1 Base path for Persistent VSCode .....................................
# This optionated directory layout is based on this other file
# - docs/portable-software.sh

mkdir /home/amnesia/Persistent/software
mkdir /home/amnesia/Persistent/software/portable

##### B.3 Persist /home/amnesia/Desktop/cryptomator.AppImage ___________________
# Assuming that you already done the
# - A.1. Choose a place to download from
# - A.2. Download VSCode and move to /home/amnesia/Desktop/VSCode-linux-x64
# We will move this folder to a persistent place. The tails-code can
# load it back to Desktop
mv /home/amnesia/Desktop/VSCode-linux-x64 /home/amnesia/Persistent/software/portable


#### B.4. Run VSCode ___________________________________________________________

### A.4.1 Via terminal, to open the app (its an gui) with tails-code ...........
# If tails-code is added to your path, just run
tails-code

# To Open some specific folder, like /home/amnesia/Persistent/git/myusername/my-project
# tails-code /home/amnesia/Persistent/git/myusername/my-project

### A.4.2 Manual steps, without tails-code .....................................
# tails-code would copy from Persistence to RAM (Desktop). so you need do this
# by yourself
cp -r /home/amnesia/Persistent/software/portable/VSCode-linux-x64/ /home/amnesia/Desktop

# This is will work even if you don't configured aliases
/home/amnesia/Desktop/VSCode-linux-x64/code --no-sandbox

# To Open some specific folder, like /home/amnesia/Persistent/git/myusername/my-project
# /home/amnesia/Desktop/VSCode-linux-x64/code --no-sandbox /home/amnesia/Persistent/git/myusername/my-project

0 comments on commit 4658754

Please sign in to comment.