Fork me on GitHub

ssh proxy jump

Context

2 machines:

  • one public, available on internet: bastion-server
  • one private, not available on internet: private-server

The public machine is allow to connect the private with ssh protocol.

Setup ssh config

The trick is to make use ProxyJump directive in .ssh/config:

Host bastion-server
    User pi
    Hostname bastion-server.com
    Port 22

Host private-server
    User ben 
    Hostname private-server.com
    ProxyJump bastion-server

NB: public ssh keys must be added to these 2 servers with ssh-copy-id command for instance.

Usage

We can now execute remote commands on the private server jumping from the bastion server.

ssh private-server hostname

You can use that to add your computer @IP to the private server. This can be useful when working with a mobile phone as access point:

IP=$(curl -s ifconfig.me) && DATE=$(date +%Y-%m-%d_%T) && echo "adding $IP to ufw at $DATE" && ssh private-server sudo ufw allow from $IP comment ben-sosh-$DATE && ssh private-server sudo ufw status numbered

Source

https://www.syloe.com/rebonds-ssh/

symfonycasts course notes - The Delightful World of Vue

About

This is raw notes from the great symfony cast course "The Delightful World of Vue". Content have been fully copied/pasted from the official public resource.

Notes

...

21 - Where should a Piece of Data Live?

https://symfonycasts.com/screencast/vue/data-location#play- Earlier, I said that you should never, ever change the value of a prop. Props are meant to be read but not modified

What is the purpose of the special mounted() function in Vue?

https://symfonycasts.com/screencast/vue/ajax/activity/376

That's right. It's a special event callback that you can define in your components to do stuff just after a component is mounted in the DOM.

https://symfonycasts.com/screencast/vue/loading/activity/380

28 - Loading Component

https://symfonycasts.com/screencast/vue/loading

created will execute as soon as the component is instantiated. Even though the DOM structure still isn't mounted, you can still perform any other operations that deal with reactive data!

mounted, on the other hand, will be executed once the component has been mounted in the DOM. This is useful for any edge case when you need to manipulate the DOM directly!

39 - Hoisting Data Up

https://symfonycasts.com/screencast/vue/hoist-data#play

This is a fairly common situation: you start by putting your data in one component, then later you need to move it higher so that more parts of your app can use it. We did this once earlier: we moved the collapsed boolean data from Sidebar up to Products so that we could use it in more places.

47 - Watchers: The Good, The Bad & The Useful!

https://symfonycasts.com/screencast/vue/watcher#play

watcher! Very simply: a watcher is a function that's called by Vue whenever a specific prop or data changes.

NFS setup

Source.

In this article, there are 2 linux machines: desktop & laptop.

The desktop machine can be accessed via @IP or using desktop.local alias.

Host

 Install

sudo apt install nfs-kernel-server

Configure clients access to host share in /etc/exports :

/home  192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)

restart service:

 service nfs-kernel-server restart

Client

Install

sudo apt install nfs-common

Create a directory

sudo mkdir -p /mnt/nfs_share_desktop
sudo chown $USER: /mnt/nfs_share_desktop/

Mount

sudo mount desktop.local:/home/ben/ /mnt/nfs_share_desktop/

or via /etc/fstab:

desktop.local:/home               /mnt/nfs_share_desktop      nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

finally:

sudo mount -a