Longevity and stability of sshfs

Just worth noting

I had many arguments with other sysadmins and bosses over the stability and validity of sshfs as a shortcut to creating a bridge for transferring files for backup or adhoc moves

 

The following is the result of an rsync from one sshfs mount to another (from ESXi servers I only had ssh access to )  over a slow link surpassed my expectations, by far:

 

sent 1342341123955 bytes  received 91 bytes  3495447.89 bytes/sec 

total size is 1342177283599  speedup is 1.00

 

Yes 1.3TB VM image taken with GhettoVCB moved over the arch of about 4.4 days with no loss or corruption.

 

Amazing…

Just worth saying in Linux where there is a will there is a way. In Windows the same move was dying out and never recovering, we tried simple file copy using the vmware browser download, veem ( gave up the move for some wierd licensing reason) , robocopy  you name it.

Solution :

 

mount both servers to a vm over ssh using sshfs and rsync across. The process was slow for the following reasons:

  1. The lack of compression.
  2. Encryption on both tunnels across ( ssh )
  3. VMware expanding the image as it is pulled from the VMFS (as it does)
  4. Network badwidth is slow and shared with literally hundreds of machines
  5. Some other reasons like disk latency ( no cache on the controller) etc..

 

I am just saying sometime even relatively inelegant solutions can give surprising results in Linux environments.

Ode to stability and the fortune of having such amazing free tools to work with.

 

🙂

 

 

 

 

Using ngrok with React based websites

The problem :

When we have a react.js based site (hosted on port 8000) and ngrok it for development purposes we get

Invalid Host Header 

The fix is to override the header on reflection:

ngrok http 8000 -host-header="localhost:8000"

 

That’s it

😉 nJoy

Nginx setting to allow wss sockets to connect

General idea of the config

https + proxy pass + virtual host

Nginx as a proxy causes a failure of wss:// connections to the backend server.

add these parameters to the proxy section :

 

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $host;

Voila’  !!!

😉 nJoy

 

OS doesn’t find en_US.UTF-8

test :

perl -e exit

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LC_ALL = (unset),
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

 

Paste the following or add to server bash.rc :

export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8

nJoy 😉

Clear Linux Cache

1. Clear PageCache only.

# sync; echo 1 > /proc/sys/vm/drop_caches

2. Clear dentries and inodes.

# sync; echo 2 > /proc/sys/vm/drop_caches

3. Clear PageCache, dentries and inodes.

# sync; echo 3 > /proc/sys/vm/drop_caches 

nJoy 😉

Ubuntu Clean old kernel images

Be VERY CAREFUL with this.

 

sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

😉 nJoy

Install latest influxdb on Ubuntu


curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update && sudo apt-get install influxdb
sudo service influxdb start

nJoy 😉