SSH Tunneling on Linux and Mac

Do you need to tunnel to another machine frequently?

Would you like an App to save time and make it more user friendly?

Well, good news!

There’s a solution for Linux and Apple machines.

For Linux you can try Gnome SSH Manager.

From their website:

gSTM is a front-end for managing SSH-tunneled port redirects. It stores tunnel configurations in a simple XML format. The tunnels (local, remote and dynamic) can be managed and individually started/stopped through one simple interface.

https://sourceforge.net/projects/gstm/

 

Another option for Linux is IOSSHy.

From their website:

IOSSHy provides an easy to use desktop tool to quickly create and destroy SSH tunnels and launch commands based on a preconfigured setup.

Password are stored in the keyring provided by the operating system (ES: gnome’s keyring, kde’s kwallet, osx keychain, etc…)

https://www.linux-apps.com/content/show.php/IOSSHy?content=119689

 

For MacOS (OSX) it’s called Tunnel Manager.

From their website:

SSH Tunnel Manager is a macOS application to manage your SSH tunnels. If you don’t know what that is, quite honestly, maybe you don’t need SSH Tunnel Manager, but if you appreciate the power of connecting together two networks using the SSH protocol, then STM is for you.

https://www.tynsoe.org/v2/stm/

 

Did you know: SSH Tunneling is also commonly referred to as LocalForwarding, RemoteForwarding, Local Port Forwarding, Remote Port Forwarding.

 

Debian Unattended Security Updates

Follow these instructions and set your email to receive notifications.

https://wiki.debian.org/UnattendedUpgrades

apt-get install unattended-upgrades apt-listchanges

nano /etc/apt/apt.conf.d/50unattended-upgrades

Set your email to receive notificaitons:
Unattended
-Upgrade::Mail "your@email.com";

To activate unattended-upgrades, you need to ensure that the apt configuration stub /etc/apt/apt.conf.d/20auto-upgrades contains at least the following lines:

  • nano /etc/apt/apt.conf.d/20auto-upgrades
    APT::Periodic::Update-Package-Lists "1";
    APT::Periodic::Unattended-Upgrade "1";
    dpkg-reconfigure -plow unattended-upgrades

 

Alternatively, you can also create the apt configuration file /etc/apt/apt.conf.d/02periodic to activate unattended-upgrades:

  • nano /etc/apt/apt.conf.d/02periodic
    
    

     

    Below is an example /etc/apt/apt.conf.d/02periodic:

    • // Control parameters for cron jobs by /etc/cron.daily/apt-compat //
      
      
      // Enable the update/upgrade script (0=disable)
      APT::Periodic::Enable "1";
      
      
      // Do "apt-get update" automatically every n-days (0=disable)
      APT::Periodic::Update-Package-Lists "1";
      
      
      // Do "apt-get upgrade --download-only" every n-days (0=disable)
      APT::Periodic::Download-Upgradeable-Packages "1";
      
      
      // Run the "unattended-upgrade" security upgrade script
      // every n-days (0=disabled)
      // Requires the package "unattended-upgrades" and will write
      // a log in /var/log/unattended-upgrades
      APT::Periodic::Unattended-Upgrade "1";
      
      
      // Do "apt-get autoclean" every n-days (0=disable)
      APT::Periodic::AutocleanInterval "21";
      
      
      // Send report mail to root
      //     0:  no report             (or null string)
      //     1:  progress report       (actually any string)
      //     2:  + command outputs     (remove -qq, remove 2>/dev/null, add -d)
      //     3:  + trace on
      APT::Periodic::Verbose "2";
      
      Unattended-Upgrade::Mail "your@email.com";
      
      

       

Using unattended-upgrades on Debian and Ubuntu

Solve Proxmox CloudLinux Kernel Care GPG Error

apt-key adv --keyserver subkeys.pgp.net --recv-key E58FE9B3FE3B0470525159BD6DC3D600CDEF74BB
 apt-get install dirmngr

 

UPDATE: 

This issue may be caused by a buggy package installation script causing incorrect repositories to be added to the software sources repository list. If after troubleshooting the issue remains unresolved contact your vendors by opening a support ticket with the error details.

 

Other error message:

gpg: failed to start the dirmngr ‘/usr/bin/dirmngr’: No such file or directory

 

References:

https://unix.stackexchange.com/questions/401547/gpg-keyserver-receive-failed-no-dirmngr

https://serverfault.com/questions/337278/debian-how-can-i-securely-get-debian-archive-keyring-so-that-i-can-do-an-apt-g

Proxmox disable swap unless totally out of RAM

The defautl vm.swappiness value for Proxmox 5.2.x is 60

 

Run this command in Shell in order to reduce swappiness to an absolute necessity when the system is out of RAM.

 sysctl -w vm.swappiness=0

 

https://forum.proxmox.com/threads/disable-swap-on-host.25623/

https://forum.proxmox.com/threads/proxmox-is-using-swap-with-lot-of-ram-available.41994/

Other performance tips

Proxmox OpenVZ SWAP and Performance

 

The public key is not available: NO_PUBKEY 68818C72E52529D4

After adding a mongodb you may experience an error about the GPG PUB KEY like teh following.

W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68818C72E52529D4
E: The repository ‘http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release’ is not signed.

You can fix this issue by adding the PUB KEY for MongoDB’s repository.

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68818C72E52529D4

Try update again

apt update

Meteor Remote MongoDB

I don’t like to use big repeating command and I was searching for a solution where I will be setting a variable embedded with something so every time I start my meteor app; the MONGO_URL will set to environment automatically. So this what I did:

In the package.json file I replaced the start parameter as below:

"scripts": {
    "start": "MONGO_URL=mongodb://username:password@host_url:portnumber/dbname meteor run"
  },

 

Credits: https://stackoverflow.com/questions/38713003/how-to-connect-to-external-mongodb-instance-in-meteor

Fix: Error: Cannot find module ‘@babel/runtime/helpers/builtin/objectSpread’

Another common error:

Error: Cannot find module ‘@babel/runtime/helpers/builtin/interopRequireDefault’

How to fix:

This has been traced in the forums as an incompatibility with the latest version of @babel/runtime. Change the corresponding line in the package.json file

  "dependencies": {
    "@babel/runtime": "7.0.0-beta.55",

and then do

meteor npm install

Credits:

https://stackoverflow.com/questions/51684918/meteor-error-cannot-find-module-babel-runtime-helpers-builtin-interoprequired

 

 

Proxmox XFCE4 Setup with Ubuntu + VNC Server

Configure your instance using this guide to install the necessary packages and setup VNC to start on reboot.

Tip: You will want to connect via SSH tunnel to your VNC server. That is the safest way to do it.

Specify the resolution using this format

vncserver :1 -geometry 1600x1200

 

Credit: https://stackoverflow.com/questions/15816/changing-the-resolution-of-a-vnc-session-in-linux#1083668