Menginstall node-red di Raspberry pi


Cara mudah menginstall node-red di Raspberry

  1. Pastikan internet lancar
  2. Jalankan perintah dibawah ini
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Tunggu sampai selesai kalau sukses maka node-red sudah terinstall

 

 

Membuat docker hub di lokal server


Buat Folder yang nantinya akan menampung semua setingan docker kita, disini saya akan memberikan nama docker-registry

didalam docker-registry saya akan membuat dua folder lagi yaitu folder certs dan data, certs sendiri akan menampung sertifikat opensll dan data akan menampung image dari docker yang kita push ke lokal server kita

langkah pertama buat sertifikat openssl dengan cara dibawah ini didalam folder certs

openssl req -newkey rsa:4096 -nodes -sha256 -keyout ca.key -x509 -days 365 -out ca.crt

kemudian buat file docker-compose.yml dan isi seperti dibawah ini

version: '3'

services:
  registry:
    image: registry:2
    restart: always
    ports:
    - "5000:5000"
    environment:
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
      REGISTRY_HTTP_TLS_CERTIFICATE: /opt/certs/ca.crt
      REGISTRY_HTTP_TLS_KEY: /opt/certs/ca.key
    volumes:
      - ./data:/data
      - ./certs:/opt/certs

Setelah selesai jalankan docker-compose up maka server lokal docker hub kita akan jalan di 0.0.0.0:5000, kemudian untuk mengetes apakah server docker ini sudah bisa digunakan kita bisa test dengan cara pull docker dari docker hub kemudian coba push ke server docker kita dengan cara seperti dibawah ini

dockur pull nginx

setelah itu coba tag ke localhost:5000 dengan cara

docker tag nginx localhost:5000/nginx-edit

setelah itu coba push ke localhost:5000 dengan cara

docker push localhost:5000/nginx-edit

kalau berhasil maka bisa kita lihat didalam data 
kalau docker yang sudah kita push masuk kesitu

Sekian tutorial kali ini selamat mencoba

Salam Ngoprek …

resize virtualbox image di Ubuntu


Tips singkat meresize .vdi di virtualbox.

Caranya mudah masuk aja ke /home/usernamekamu/Virtualbox VMs/nama folder image

VBoxManage modifyhd namaimage.vdi --resize 30000 
(30000 adalah besar image sesuai keinginan kita didalam MB)

Selesai

 

Setelah selesai kamu bisa gunakan gparted untuk meresize partisi sesuai keinginan kita

 

Cara mudah menghubungkan exhange dengan thunderbird di ubuntu


Pasti kalian punya email kan nah buat kalian yang kerja di kantoran pasti kebanyakan kantornya pakai email microsoft exchange sebagai email server, nah kali ini saya ingin sharing cara mudah menghubungkan exchange dengan thunderbird di ubuntu.

Pertama tama buka thunderbird (biasanya sudah terinstall pada saat menginstall ubuntu) kemudian buka add ons biasanya ada di bagian kanan atas lalu klik add ons > extension> dan cari plugin namanya exquilla setelah itu install setelah selesai biasanya thunderbird minta reload.

Setelah reload masuk ke addons tadi lalu cari exquilla plugin kemudian klik lalu masukkan setting email disitu apabila setting berhasil maka secara otomatis thunderbird sudah terhubung ke outlook

Happy Coding

Salam ngoprek

 

Configure wlan in lenovo ideapad s530 in Ubuntu


New laptop woohoo but there is one problem wlan not detected in lenovo ideapad s530 in ubuntu, but no problem internet have all solution 😀

First you must have usb to lan connector, im using gigabit usb3 to rj45

 

 

 

 

 

 

 

 

and then

sudo apt update
sudo apt upgrade -y


sudo apt install git dkms build-essential
git clone -b 4.18 https://github.com/jeremyb31/ideapad-laptop.git
sudo dkms add ./ideapad-laptop
sudo dkms install ideapad-laptop/1.0
echo "options ideapad_laptop override_has_hw_rfkill_switch=0" | sudo tee /etc/modprobe.d/ideapad_laptop.conf

after that reboot and voila wlan detected

Happy coding

Salam ngoprek

 

Payload decoder adeunis field tester


function Decode( fPort, bytes )
{

// Functions
function parseCoordinate( raw_value, coordinate )

{

// This function parses a coordinate payload part into

// dmm and ddd

var raw_itude = raw_value;

var temp = "";


// Degree section

var itude_string = ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;


itude_string += ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;


coordinate.degrees += itude_string;

itude_string += "°";


// Minute section

temp = ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;


temp += ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;

itude_string += temp;

itude_string += ".";

coordinate.minutes += temp;


// Decimal section

temp = ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;


temp += ( (raw_itude >> 28) & 0xF ).toString( );

raw_itude <<= 4;


itude_string += temp;

coordinate.minutes += ".";

coordinate.minutes += temp;

return itude_string;

}

function parseLatitude( raw_latitude, coordinate )

{

var latitude = parseCoordinate( raw_latitude, coordinate );

latitude += ((raw_latitude & 0xF0) >> 4).toString( );

coordinate.minutes += ((raw_latitude & 0xF0) >> 4).toString( );


return latitude;

}

function parseLongitude( raw_longitude, coordinate )

{

var longitude = ( ((raw_longitude >> 28) & 0xF ) ).toString( );

coordinate.degrees = longitude;

longitude += parseCoordinate( raw_longitude << 4, coordinate );


return longitude;

}

function addField( field_no, payload )

{

switch( field_no )

{

// Presence of temperature information

case 0:

payload.temperature = bytes[bytes_pos_] & 0x7F;

// Temperature is negative

if( (bytes[bytes_pos_] & 0x80) > 0 )

{

payload.temperature -= 128;

}

bytes_pos_++;

break;

// Transmission triggered by the accelerometer

case 1:

payload.trigger = "accelerometer";

break;

// Transmission triggered by pressing pushbutton 1

case 2:

payload.trigger = "pushbutton";

break;

// Presence of GPS information

case 3:

// GPS Latitude

// An object is needed to handle and parse coordinates into ddd notation

var coordinate = {};

coordinate.degrees = "";

coordinate.minutes = "";


var raw_value = 0;

raw_value |= bytes[bytes_pos_++] << 24;

raw_value |= bytes[bytes_pos_++] << 16;

raw_value |= bytes[bytes_pos_++] << 8;

raw_value |= bytes[bytes_pos_++];


payload.lati_hemisphere = (raw_value & 1) == 1 ? "South" : "North";

payload.latitude_dmm = payload.lati_hemisphere.charAt( 0 ) + " ";

payload.latitude_dmm += parseLatitude( raw_value, coordinate );

payload.latitude = ( parseFloat( coordinate.degrees ) + parseFloat( coordinate.minutes ) / 60 ) * ( (raw_value & 1) == 1 ? -1.0 : 1.0);


// GPS Longitude

coordinate.degrees = "";

coordinate.minutes = "";

raw_value = 0;

raw_value |= bytes[bytes_pos_++] << 24;

raw_value |= bytes[bytes_pos_++] << 16;

raw_value |= bytes[bytes_pos_++] << 8;

raw_value |= bytes[bytes_pos_++];


payload.long_hemisphere = (raw_value & 1) == 1 ? "West" : "East";

payload.longitude_dmm = payload.long_hemisphere.charAt( 0 ) + " ";

payload.longitude_dmm += parseLongitude( raw_value, coordinate );

payload.longitude = ( parseFloat( coordinate.degrees ) + parseFloat( coordinate.minutes ) / 60 ) * ( (raw_value & 1) == 1 ? -1.0 : 1.0);


// GPS Quality

raw_value = bytes[bytes_pos_++];


switch( (raw_value & 0xF0) >> 4 )

{

case 1:

payload.gps_quality = "Good";

break;

case 2:

payload.gps_quality = "Average";

break;

case 3:

payload.gps_quality = "Poor";

break;

default:

payload.gps_quality = (raw_value >> 4) & 0xF;

break;

}

payload.hdop = (raw_value >> 4) & 0xF;


// Number of satellites

payload.sats = raw_value & 0xF;


break;

// Presence of Uplink frame counter

case 4:

payload.ul_counter = bytes[bytes_pos_++];

break;

// Presence of Downlink frame counter

case 5:

payload.dl_counter = bytes[bytes_pos_++];

break;

// Presence of battery level information

case 6:

payload.battery_level = bytes[bytes_pos_++] << 8;

payload.battery_level |= bytes[bytes_pos_++];

break;

// Presence of RSSI and SNR information

case 7:

// RSSI

payload.rssi_dl = bytes[bytes_pos_++];

payload.rssi_dl *= -1;


// SNR

payload.snr_dl = bytes[bytes_pos_] & 0x7F;

if( (bytes[bytes_pos_] & 0x80) > 0 )

{

payload.snr_dl -= 128;

}

bytes_pos_++;

break;

default:

// Do nothing

break;

}

}


// Declaration & initialization

var status_ = bytes[0];

var bytes_len_ = bytes.length;

var bytes_pos_ = 1;

var i = 0;

var payload = {};


// Get raw payload

var temp_hex_str = ""

payload.payload = "";

for( var j = 0; j < bytes_len_; j++ )

{

temp_hex_str = bytes[j].toString( 16 ).toUpperCase( );

if( temp_hex_str.length == 1 )

{

temp_hex_str = "0" + temp_hex_str;

}

payload.payload += temp_hex_str;

}


// Get payload values

do

{

// Check status, whether a field is set

if( (status_ & 0x80) > 0 )

{

addField( i, payload );

}

i++;

}

while( ((status_ <<= 1) & 0xFF) > 0 );


return payload;

}

node-red lost connection


I got this problem when i make virtual host in nginx with node-red, node-red give me some error lost-connection to server , and the problem is web socket not forwarded in nginx, and the solution is here

Add some line of code like below

server {
    listen 443 ssl;
    server_name domainname.com www.domainname.com;
    ssl on;

    ssl_certificate     /etc/ssl/public.crt.pem;
    ssl_certificate_key /etc/ssl/private.key.pem;

    location / {
        proxy_pass https://domainname:1880;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Restart your nginx and it works

Happy Coding …

Salam ngoprek …