Group Details Private

Donator

Member List

  • RE: Problem with Postfix // iRedmail configuration

    Hello again,

    I have found a temporary solution as per below. The email accounts that i want to use , only for internal purposes, added into a specific class (internal_only). All the other domain- account, can send to external emails. Don't forget to postmap interna_senders & internal domain.

    smtpd_sender_restrictions =

    check_sender_access hash:/etc/postfix/internal_senders

    reject_non_fqdn_sender

    reject_unlisted_sender

    permit_mynetworks

    permit_sasl_authenticated

    check_sender_access pcre:/etc/postfix/sender_access.pcre

    smtpd_restriction_classes = internal_only

    internal_only = check_recipient_access hash:/etc/postfix/internal_domain reject

    posted in General Discussion
  • Problem with Postfix // iRedmail configuration

    Hi guys,

    I have a Centos 7 which has an iRedmail web mail server in order the users to send local email each-other The Postfix has configured in order to send mail to internal users not external, as the below. My question is how to configure postfix to send email outside (External) from one specific domain. For example:

    I have create a domain at iRedmail test.com with multiple email addresses ([email protected],[email protected] etc).My question is how to allow this specific domain (@test.com) to send to external emails.

    vim /etc/postfix/main.cf
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_local_domain = $myhostname
    broken_sasl_auth_clients = yes
    smtpd_sasl_security_options = noanonymous


    smtpd_recipient_restrictions =
    permit_sasl_authenticated,
    permit_mynetworks,
    check_relay_domains


    myhostname = localhost
    mydomain = localdomain
    mydestination = $myhostname, localhost.$mydomain, localhost


    default_transport = error:outside mail is not deliverable

    posted in General Discussion
  • NodeMCU MQ135 air quality sensor tutorial

    Preparation

    Before we begin, you will have to obtain:

    Import Library

    Arduino > Sketch > Include Library > Add .ZIP library (Select the MQ135 Library zip file that you have downloaded from above)
    

    Connect the NodeMCU to MQ135 sensor

    Connect NodeMCU A0 to MQ135 AO
    Connect NodeMCU GND to MQ135 GND
    Connect NodeMCU 3.3V to MQ135 VCC
    

    Burnout

    It is necessary to "burnout" the sensor for first use to calibrate proper rzero value, to do so paste following code to your arduino window :

    #include "MQ135.h"
    const int ANALOGPIN=0;
    MQ135 gasSensor = MQ135(ANALOGPIN);
    void setup(){
      Serial.begin(115200);      // sets the serial port to 115200
    }
    void loop(){
      float rzero = gasSensor.getRZero();
      Serial.println(rzero);
      delay(1000);
    }
    
    • Upload the code to NodeMCU
    • Open the serial monitor : Tools > Serial Monitor

    Let it running for an hour or two until you get constant rzero value. Write down that RZERO value as you will need it for later use.

    If you made it up to here, you almost got to the end.

    ThingSpeak

    This is the platform that we are going to use to store our measures and display them in a nice graph that we can embed to any website or similar. (This tutorial might expand in future to a selfhosted variant of storing and displaying data)

    Measure Air Quality

    Adapt following code to reflect your RZERO value, API key, SSID and password.

    Note: RZERO is the value from the burnout section.

    #include <ESP8266WiFi.h>
    #include "MQ135.h"
    #define RZERO 76.63
    const int ANALOGPIN=0;
    MQ135 gasSensor = MQ135(ANALOGPIN);
    
    
    String apiKey = "WRITE-API-KEY"; // Enter your Write API key from ThingSpeak
    const char *ssid = "SSIDNAME"; // replace with your wifi ssid 
    const char *pass = "PASSWORDHERE"; // replace this field with your password
    const char* server = "api.thingspeak.com";
    WiFiClient client;
    void setup()
    {
    Serial.begin(115200);
    delay(10);
    Serial.println("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, pass);
    while (WiFi.status() != WL_CONNECTED)
    {
    delay(500);
    Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected");
    }
    void loop()
    {
      float ppm = gasSensor.getPPM();
      Serial.println(ppm);
      delay(1000);
    
    if (client.connect(server, 80)) 
    {
    String postStr = apiKey;
    postStr += "&field1=";
    postStr += String(ppm);
    postStr += "r\n";
    client.print("POST /update HTTP/1.1\n");
    client.print("Host: api.thingspeak.com\n");
    client.print("Connection: close\n");
    client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    client.print("Content-Length: ");
    client.print(postStr.length());
    client.print("\n\n");
    client.print(postStr);
    Serial.print("Gas Level: ");
    Serial.println(ppm);
    Serial.println("Data Send to Thingspeak");
    }
    client.stop();
    Serial.println("Waiting...");
    
    // thingspeak needs minimum 15 sec delay between updates.
    delay(1500);
    }
    

    That is it, from here you are sending values to ThingSpeak platform, you got yourself a nice graph, and you are monitoring air quality 🙂

    Here is the image of values to know when the air is bad :

    air quality

    posted in Tutorials
  • RE: Remote Live Backing up Custom Game Server With SQlite3 databases?

    @FriendlyGamer You can always adapt the script by changing .db to .sqlite, i will do it ASAP.

    Regarding the shared hosting/storage server, i am clueless what mechanism they are using as i do not know which panel they are using, have you checked their documentation ? You could raise a ticket with question to obtain necessary info... I just assume it is within options somewhere, some hostings generate public/private key pair for you to import to the server. Can you at least tell me which provider is that ? Maybe a link to their website?

    You can read your public key from the server with command cat ~/.ssh/id_rsa.pub

    By the way i have changed the script to reflect .sqlite extension. Since it is just a file, your db could be ending with .anything, so you can compare last commit and adapt it for future use 😉

    posted in #! Request Script #!
  • RE: Remote Live Backing up Custom Game Server With SQlite3 databases?

    @FriendlyGamer

    I have updated the script to get all names of DBs in the directory path and backup them to specified directory.

    Check the script location : https://git.shell5.dev/shell5dev/installation-scripts/tree/master/FriendlyGamer-gameserver-db-backup

    Regarding the remote storage, i suppose that you have to add your public key manually to the control panel and obtain parameters like server URL which you should input to the script in format [email protected]

    posted in #! Request Script #!
  • RE: Remote Live Backing up Custom Game Server With SQlite3 databases?

    @FriendlyGamer

    1. Sorry i haven't saw it was about multiple databases, was probably too tired 🙂 . How many databases are there ? Are they all in same directory?

    2. I haven't mentioned that to be able to use rsync, most elegant way would be to copy your public key to remote server by issuing from game server ssh-copy-id [email protected]. In case you haven't generated public/private key, you can do so by issuing ssh-keygen -T RSA. I will update the readme on gitlab.

    Also it might be a good idea to determine "remote storage", is it another linux server? If not, what is it and what protocols does it support ?

    posted in #! Request Script #!
  • RE: Remote Live Backing up Custom Game Server With SQlite3 databases?

    @FriendlyGamer

    Please make backups manually before testing/runing the script. I have tested the script on "fake" files that i have generated but make the backups manually to be 100% safe if anything goes wrong so that you can restore the server.

    Gitlab script directory: https://git.shell5.dev/shell5dev/installation-scripts/tree/master/FriendlyGamer-gameserver-db-backup
    Gitlab master repo: https://git.shell5.dev/shell5dev/installation-scripts
    Github mirror: https://github.com/shell5dev/Installation-Scripts

    If everything works ok, you can make a cronjob to run this script automatically for example weekly, every sunday at 1AM.

    Edit crontab
    
    #crontab -e 
    
    Insert the cron job:
    
    # 0 1 * * 0 /path/to/script/backup.sh
    
    

    Note, do not forget to add execution rights to the script chmod +x backup.sh and to change variables within script.

    posted in #! Request Script #!
  • RE: Remote Live Backing up Custom Game Server With SQlite3 databases?

    @FriendlyGamer

    I will get to it, in a day or two due to busy working week 🙂

    posted in #! Request Script #!