Category Archives: How to

installing new linux vps

postupak za t4vps install

u putygenu kreirati ključ za server i ključ za usrera

pass za useraddd ser generira pomocu komande – mkpasswd

useradd -m -d /home/uno -s /bin/bash -p paHaoZf1LwtMY uno
usermod -aG sudo uno
mkdir /home/uno/.ssh
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkr85mET8mbnXQ8zxirtpFJJ5nsnCzocUAI3G0qOVKE27ypf2X03sjr3gv6kmWmQ+vIrUccWNRlcgXh662HIYVNrxe1VuBW6DORcaUMKt7r24EnQllp7HurR5KNMQPhb2jUZkB1MOHTBjgcOjpMGrw3Ve4zDzH5lWsiQHrLsg4Eia1lExdx5bzsMWDd3KDfcRRa3xSyEbFfuDAebRf8WfrKsnQsmN+Y5tBi2voVEcK+M3lgqyWfkQPhv6f5JOUK85matEaFSVbzSqDj9m3vunsr6s/nc/rmmL4nJ92pgqp4ZTNq6hXIgHL46GqA0741LiunF0Sc4BPaQ7cYDYsfpauw== uno
EOF

chown -R uno:uno /home/uno/.ssh
chmod 700 /home/uno/.ssh
chmod 600 /home/uno/.ssh/authorized_keys

sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

systemctl restart sshd

onda download uno binariesa – http://unobtanium.uno/download/unobtanium-linux-x86_64.tar.gz

tartar -zxvf unobtanium-linux-x86_64.tar.gz

mv unobtanium-linux-x86_64 uno

cd uno/bin

./unobtaniumd

ovo ce pokrenuti demona.

u crontab -e dodati

@reboot /home/uno/uno/bin/unobtaniumd

install jitsi

apt-get -y install ufw
ufw enable
ufw allow in ssh
ufw allow in 80/tcp
ufw allow in 443/tcp
ufw allow in 10000:20000/udp

apt-get -y install nginx

sudo apt-get update
sudo apt-get -y install software-properties-common
NE TREBA add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update

install certbot

sudo apt-get -y install certbot python-certbot-nginx
certbot –nginx

wget https://download.jitsi.org/jitsi-key.gpg.key
apt-key add jitsi-key.gpg.key
echo ‘deb https://download.jitsi.org stable/’ > /etc/apt/sources.list.d/jitsi-stable.list
apt-get update

install jitsi

apt -y install jitsi-meet

cd /usr/share/jitsi-meet
certbot –nginx

copy files with scp

na pcu odi u folder gdje je file

C:\Users\jure\Documents\passwordi>

scp pass.kdbx admin@192.168.0.13:/mnt/hdd/jure

kopiraj file u /home/admin/backups

na drugom pc-u

scp admin@192.168.0.13:/home/admin/backups/pass.kdbx .

na androidu. app “mobile SFTP”

bitcoin copy from current node

najprije na raspiblicu

ugasiti bitcoin node

sudo chown -r admin /mnt/hdd/bitcoin

onda na drugom racualu otici u bitcoin dir i opliti

scp -r admin@192.168.0.13:/home/bitcoin/chainstatate .

scp -r admin@192.168.0.13:/home/bitcoin/blocks.

scp -r admin@192.168.0.13:/home/bitcoin/indexes .

na raspiju

sudo chown -r bitcoin /mnt/hdd/bitcoin

restart raspiblitca

contact form code

u index.html ide forma

<!-- Features Section -->
    <div class="row">
         <div class="mailcont">

      <div class="col-lg-12 mailform">
        <h3>Send us a Message:</h3>
        <form name="sentMessage" id="contactForm" novalidate>
          <div class="control-group form-group">
            <div class="controls">
              <label>Full Name:</label>
              <input type="text" class="form-control" id="name" required data-validation-required-message="Please enter your name.">
              <p class="help-block"></p>
            </div>
          </div>
          <div class="control-group form-group">
            <div class="controls">
              <label>Phone Number:</label>
              <input type="tel" class="form-control" id="phone" required data-validation-required-message="Please enter your phone number.">
            </div>
          </div>
          <div class="control-group form-group">
            <div class="controls">
              <label>Email Address:</label>
              <input type="email" class="form-control" id="email" required data-validation-required-message="Please enter your email address.">
            </div>
          </div>
          <div class="control-group form-group">
            <div class="controls">
              <label>Message:</label>
              <textarea rows="10" cols="100" class="form-control" id="message" required data-validation-required-message="Please enter your message" maxlength="999" style="resize:none"></textarea>
            </div>
          </div>
          <div id="success"></div>
          <!-- For success/fail messages -->
          <button type="submit" class="btn btn-primary" id="sendMessageButton">Send Message</button>
        </form>

na dno

<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js"></script>

js/contact_me.js

$(function() {

  $("#contactForm input,#contactForm textarea").jqBootstrapValidation({
    preventSubmit: true,
    submitError: function($form, event, errors) {
      // additional error messages or events
    },
    submitSuccess: function($form, event) {
      event.preventDefault(); // prevent default submit behaviour
      // get values from FORM
      var name = $("input#name").val();
      var email = $("input#email").val();
      var phone = $("input#phone").val();
      var message = $("textarea#message").val();
      var firstName = name; // For Success/Failure Message
      // Check for white space in name for Success/Fail message
      if (firstName.indexOf(' ') >= 0) {
        firstName = name.split(' ').slice(0, -1).join(' ');
      }
      $this = $("#sendMessageButton");
      $this.prop("disabled", true); // Disable submit button until AJAX call is complete to prevent duplicate messages
      $.ajax({
        url: "././mail/contact_me.php",
        type: "POST",
        data: {
          name: name,
          phone: phone,
          email: email,
          message: message
        },
        cache: false,
        success: function() {
          // Success message
          $('#success').html("<div class='alert alert-success'>");
          $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
            .append("</button>");
          $('#success > .alert-success')
            .append("<strong>Your message has been sent. </strong>");
          $('#success > .alert-success')
            .append('</div>');
          //clear all fields
          $('#contactForm').trigger("reset");
        },
        error: function() {
          // Fail message
          $('#success').html("<div class='alert alert-danger'>");
          $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
            .append("</button>");
          $('#success > .alert-danger').append($("<strong>").text("Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!"));
          $('#success > .alert-danger').append('</div>');
          //clear all fields
          $('#contactForm').trigger("reset");
        },
        complete: function() {
          setTimeout(function() {
            $this.prop("disabled", false); // Re-enable submit button when AJAX call is complete
          }, 1000);
        }
      });
    },
    filter: function() {
      return $(this).is(":visible");
    },
  });

  $("a[data-toggle=\"tab\"]").click(function(e) {
    e.preventDefault();
    $(this).tab("show");
  });
});

/*When clicking on Full hide fail/success boxes */
$('#name').focus(function() {
  $('#success').html('');
});

a na serveru u /mail/contact_me.php ide

<?php
// Check for empty fields
if(empty($_POST['name'])      ||
   empty($_POST['email'])     ||
   empty($_POST['phone'])     ||
   empty($_POST['message'])   ||
   !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
   {
   echo "No arguments Provided!";
   return false;
   }

$name = strip_tags(htmlspecialchars($_POST['name']));
$email_address = strip_tags(htmlspecialchars($_POST['email']));
$phone = strip_tags(htmlspecialchars($_POST['phone']));
$message = strip_tags(htmlspecialchars($_POST['message']));

// Create the email and send the message
$to = 'yourname@yourdomain.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
$email_subject = "Upit s Weba od  $name";
$email_body = "Stigao novi upit sa stranice.\n\n"."Detalji:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
$headers = "From: no-reply@yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>