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 ๐Ÿ˜‰

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 ๐Ÿ˜‰

 

Cool chkconfig replacement for Ubuntu

Hi,

 

Ubuntu does not carry chkconfig any more ..

besides the standard

update-rc.d apache2 defaults

or

update-rc.d apache2 remove

There is a cool tool called : sysv-rc-conf.

This tool can be installed using :

sudo apt-get install sysv-rc-conf

On its own the command opens a cool ncurses interface like this :

 

 

 

 

 

 

 

 

 

It can Also be used in scripts as :

sysv-rc-conf atd <on or off> and --levels;

man sysv-rc-conf

Will give you some love..

nJoy ๐Ÿ˜‰

 

 

converting webm to mp3s ffmpeg

for FILE in *.webm; do
    echo -e "Processing file '\e[32m$FILE\e[0m'";
    ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3";
done;

nJoy ๐Ÿ˜‰