redhat – Needs to set nodev option on DB directories in linux

I have created two directory for new build linux server & each directory is 200GB in size and will be used for DB . security team did scan they found vulnerability as ” No nodev option set to directory”. I tried with “”mount -o remount,nodev /mountpoint”” but nodev is not being added in /etc/fstab .

Is it good to add nodev option to DB folder and how I can do this ??

Will unmount the directory and append the line with nodev in /etc/fstab file and remount again will work.
I am new to linux and need help on this topic

thanks in advance

security – How to hide other user’s home directories on Linux

I run several systems with hundreds of home directories (a custom web hosting setup, where third parties can have control of certain accounts).

Currently any user could SSH in (or via a script) do “ls /home” and see all the accounts on the server. They can’t do anything with that information of course, “ls /home/user” would fail, however I’m wondering how “ls /home” could just show the current user’s folder.

I’ve seen a few exploit attempts in the past (clients with insecure code/bad passwords – another topic) where the attacker makes a folder in one account, and then makes an array of symlinks looking at other home folders and trying to guess for sensitive file locations and hoping permissions are weak somewhere. By hiding “ls /home” this would frustrate them and I don’t think they usually try too many other techniques.

Just an additional safety net, ideally without going down the path of chroot or jails. It’s mostly just to break automated scripts if someone did gain access.
The permissions are secure so users only have read/write access inside their own home folder.

Unique 100 EDU, 200 Social Networks profiles, 200 Wiki articles, 100 Article directories Backlinks for $5

Unique 100 EDU, 200 Social Networks profiles, 200 Wiki articles, 100 Article directories Backlinks

Unique 100 EDU, 200 Social Networks profiles, 200 Wiki articles, 100 Article directories BacklinksHello!

Welcome to my service:

Extraordinary 100 EDU, 200 Social Networks profiles, 200 Wiki articles, 100 Article indexes Backlinks…

Unique 100 EDU, 200 Social Networks profiles, 200 Wiki articles, 100 Article directories Backlinks for $5

HAT I NEED FROM YOU ?

  1. Your URL
  2. Your Keywords
  3. Article Topic ( optional )

I will do this assistance sincerely. Assuming you are not fulfilled, I will give cash back ensured yet I trust you are not unsatisfied. I in every case scarcely fill in according to your need. If it’s not too much trouble, request me now.

So, order now with full confidence…

.(tagsToTranslate)EDU(t)SOCIAL(t)WIKI(t)BACKLINKS(t)Article

c++ – How should I organize directories for main and test code?

I’m writing embedded software in C++, very few of them are in C but I’m going to rewrite them in C++ too.

For building my code I use cmake to generate a Makefile. For test framework I use googletest and I’m trying to find a way to effectively test every module I have. At least the testable ones.

I have some options on the table.
Create a folder test inside each module, where it will have a main.cpp and the CMakeLists.txt that will call the test framework.

 Libs
 |__ Module_A
 |  |__ test
 |__ Module_B
 |  |__ test
 |__ Module_C
 |  |__ test

Create a folder unit_tests where inside I will have every test for each of the modules.

 Libs
 |__ Module_A
 |__ Module_B
 |__ Module_C
 Unit_tests
 |__ test_Module_A
 |__ test_Module_B
 |__ test_module_c

Which one sounds better?

node.js – Node JS Creating Nested Directories

I want to write a function that creates nested directories based on an object structure with files inside. So far I have gotten to the point where I am able to create such directories but it works only for the first key of the object.

Code below:

const fs = require("fs");
const templates = require("./templates.js");

const appDirectory = process.cwd();

function run() {
  createDirectories(templates);
}

function createDirectories(obj, path = "") {
  for (const prop in obj) {
    if (typeof obj(prop) === "object" && obj(prop) !== null) {
      path += `/${prop}`
      if (!fs.existsSync(`${appDirectory}/${path}`)) {
        fs.mkdir(`${appDirectory}/${path}`, (err) => {
          if (err) { return console.log(err) }
          console.log(`Directory created: ${path}`);
        })
      }
      return createDirectories(obj(prop), path);
    } else {
      fs.writeFile(`${appDirectory}/${path}/${prop}`, obj(prop), (err) => {
        if (err) { return console.log(err) }
        console.log(`File created: ${prop} in ${path} directory`);
      })
      return prop;
    }
  }
}

run();

And the structure of the directories is inside an object

module.exports = {
  "directory1": {
    "innerDirectory1": {
      "file1.js": require("./file1.js")
    }
  },
  "directory2": {
    "innerDirectory2": {
      "file2.js": require("./file2.js")
    }
  },
  "directory3": {
    "innerDirectory3": {
      "file3.js": require("./file3.js")
    }
  }
}

From this code I got only one created directory of the object ( directory1/innerDirectory1/file1.js )

How to make spotlight search more effective at locating commonly used directories?

Spotlight Search – cmd + space – doesn’t seem to find the Applications folder, despite it being on of the most well-known and important folders on the macOS:

enter image description here

Same happens in a quick search for the Documents folder (bizarrely, it even brings up google searches for the term ‘documents folder’):

enter image description here

Is there a way to make Spotlight Search prioritise commonly used macOS
folders/programs/settings for quick access?

searching – Intelligent text search on large directories of notebooks?

I have a (deeply nested) directory containing 10s of thousands of wolfram files (mostly notebooks (nbs), but also scripts (.wls), packages (.m, .q
wl), my and wxf data) and many subfolders each with a few hundred notebooks on average. Each notebook contains 10-100 of pages. I want to search on text in the files and within relacant notebook cells types e.g. Code, Text, Title, SubTitle, Item, Program, ExternalLanguage, etc.

I’d like to have a live search interface to quickly search through the contents of all files and visually show the matches highlighted within their context.

Is there an existing project or best practices for doing this?

The TextSeach related wolfram symbols are old and seem slow/weak, can mma even do this? Mma is obviously needed to preview the content of matches within notebooks, but what other tools would be used to build such a live deep search?

python – Count *.plot files in certain directories on network filesystems

It’s generally a very bad idea to put credentials in a program. That’s
a bigger topic, and the best approach will vary depending on your situation.
But you should address this problem.

When naming things, let ordinary English usage guide you: plural for
collections (lists, tuples, dicts, etc) and singular for individual values. For
example, use files and file (or even just f if the context is clear), not
files and Files.

Let your code breathe by putting spaces around operators and related items
(equal signs, commas, etc). It helps with readability and often editability
(latter can depend on the editor). Search for PEP8 if you want more details on
recommended naming and layout practices (PEP8 is not gospel, but it is a good
starting point).

It’s often a good idea to group similar data into collections: for example,
a tuple/list/dict of shares rather than sharename, sharename2, sharename3.

When you see repetition in your code, get rid of it. It’s as simple as that.
Usually, you can do this by writing a function to generalize the behavior: for
example, a function taking a share and returning a count. In your specific,
case the grouping of the shares in a collection provides a more direct route:
kill the repetition via a loop over that collection. And since the logic inside
the loop is just counting, you can stick the whole thing in a single sum()
expression (this works because bool is a subclass of int).

shares = (
    "\\xxx.xxx.xxx.xxx\chia1",
    "\\xxx.xxx.xxx.xxx\chia2",
    "I:",
)

ext = '.plot'

totalfiles = sum(
    f.endswith(ext)
    for share in shares
    for _, _, files in os.walk(share)
    for f in files
)

You asked about making the script less hardcoded. The most natural
way to do that is via command-line arguments and the argparse module.
That’s a bigger topic, but the basic idea is that the share paths and the extension
(.plot) should be variable parameters with default values. Run the script
without arguments, and it will do the default thing. Run it with arguments
and/or options, and it will use different parameters. That’s the time-tested
way to go with scripts like this, and the internet is full of examples
illustrating how to set up argparse.

Finally, if you intend to write more scripts as you build
your Chia Empire,
just adopt the practice of putting all code inside of functions.
It might seem like an unnecessary hassle at first, but this
is another one of those time-tested ideas. The benefits are
numerous. Here’s the basic structure:

import sys

def main(args):
    # Program starts here.
    print(args)

if __name__ == '__main__':
    main(sys.argv(1:))

javascript – Images, CSS, and JS don’t work consistently when PHP included from error files which can occur in various directories

I use a single header and footer in my pages. I use the following code:

<?php include ("../includes/top-bar.inc"); ?>

It works fine for the most of the pages – however not for the server error pages (400, 404, etc…)
I assume the reason is that the error can be called from any directory so the path varies.
I also tried

<?php
  $path = $_SERVER('DOCUMENT_ROOT');  
  $path .= "/includes/top-bar.inc"; 
  include_once($path); 
?>

but it’s path dependent as well. So if I’m at example.com/directory1/ – it works, but if I’m at example.com/directory1/directory2/ it fails. Fails in that the css, js and images do not show.

How can I include those inc files into the server error pages to where they will work regardless of the page that triggers.
Or will I have to physically include the header/footer code for those pages.

Below is code from top-bar.inc

    <div class="blue-topper">

    <div class="row centered">

        <!-- Date -->
        <div class="large-6 columns date">

            Today is
            <?php 
            $path = $_SERVER('DOCUMENT_ROOT');
            $path .= "/includes/onlydate.php";
            include_once($path);
            ?>

        </div>

        <!-- Social -->
        <div class="large-6 columns social-icons">

            <a href="/skeds.php"><i class="fas fa-clock"></i> Program Schedules&nbsp;&nbsp;</a>
            <a href="https://www.facebook.com/ktbbeasttexas"><i class="fab fa-facebook-f"></i></a>&nbsp;
            <a href="https://twitter.com/KTBBRadio"><i class="fab fa-twitter"></i></a>&nbsp;
            <a href="https://www.youtube.com/user/ktbbam600/"><i class="fab fa-youtube"></i></a>&nbsp;
            <a href="/liveaudio/" class="listenbutton"><i class="fas fa-volume-up"></i>&nbsp;Listen Live!</a>

        </div>

    </div>

</div>

<!-- @@@@@@@@@@@@@@@@@@@@@@@@@@  END Blue Bar Topper  @@@@@@@@@@@@@@@@@@@@@@@ -->


<!-- @@@@@@@@@@@@@@@@@@@@@@@@@@  Header  @@@@@@@@@@@@@@@@@@@@@@@ -->

<div class="header">

    <div class="row">

        <!-- Logo -->
        <div class="large-3 columns">

            <a href="https://www.ktbb.com" title="KTBB 97.5FM News Weather Talk"><img src="https://www.ktbb.com/images/logo.png" alt="ktbb logo"></a>

        </div>

        <!-- Weather magnet -->
        <div class="large-3 columns hide-for-medium-down centered">

            <iframe class="magnet" src="https://templates.customweather.com/host/KTBB/wx_tile_03.jsp?city=31235&bgcolor=FFFFFF&metric=false" scrolling="no"></iframe>

        </div>

        <div class="large-6 columns menu-bar">

            <nav class="top-bar" data-topbar>
                <ul class="title-area">
                    <li class="name"> </li>
                    <li class="toggle-topbar menu-icon"><a href="#">Menu <i class="fa fa-bars extra-space-hamburger"></i></a></li>
                </ul>

                <section class="top-bar-section">
                    <!-- Right Nav Section -->
                    <ul class="left">

                        <li class="has-dropdown">
                            <a href="/news/">News</a>
                            <ul class="dropdown">
                                <li><a href="/news/local.php">Local News</a></li>
                                <li><a href="/news/state.php">State News</a></li>
                                <li><a href="/news/us.php">National News</a></li>
                                <li><a href="/news/world.php">World News</a></li>
                                <li><a href="/news/business.php">Business News</a></li>
                                <li><a href="/news/political.php">Political News</a></li>
                                <li><a href="/news/health.php">Health News</a></li>
                                <li><a href="/news/showbiz.php">Show Biz News</a></li>
                                <li><a href="/news/sports.php">Sports News</a></li>
                            </ul>
                        </li>

                        <li class="has-dropdown">
                            <a href="/weather/">Weather</a>
                            <ul class="dropdown">
                                <li><a href="/weather/">Forecast</a></li>
                                <li><a href="https://www.ktbb.com/weather/doppler.php">Doppler Radar</a></li>
                                <li><a href="https://www.ktbb.com/weather/satellite.php">Satellite Radar</a></li>
                                <li><a href="https://www.ktbb.com/weather/current.php">Current Radar</a></li>
                                <li><a href="https://www.ktbb.com/weather/forecast.php">Forecast Radar</a></li>
                                <li><a href="https://www.ktbb.com/weather/future.php">Future Radar</a></li>
                            </ul>
                        </li>

                        <li class="has-dropdown">
                            <a href="/sports/">Sports</a>
                            <ul class="dropdown">
                                <li><a href="https://tylerpaper.com/sports/highschool/">High School Scores</a></li>
                                <li><a href="/news/sports.php">Headlines</a></li>
                                <li><a href="/sportssked.php">Broadcast Schedule</a></li>
                                <li><a href="/scholasticallstars/index.php">Scholastic All Stars</a></li>
                                <li><a href="/rangerbustrips/index.php">Rangers Bus Trips</a></li>
                            </ul>
                        </li>

                        <li><a href="/mediakit/">Media Kit</a></li>

                        <li><a href="/advertisers/">Advertisers</a></li>

                        <li class="has-dropdown">
                            <a href="#">More</a>
                            <ul class="dropdown">
                                <li><a href="https://www.youtellmetexas.com">You Tell Me Texas</a></li>
                                <li><a href="https://www.ktbb.com/worldtour/">World Tour</a></li>
                                <li><a href="https://www.ktbb.com/personalities.php">Our Personalities</a></li>
                                <li><a href="https://www.ktbb.com/audio/">Podcasts</a></li>
                                <li><a href="https://www.ktbb.com/apps/">Streaming Apps</a></li>
                                <li><a href="https://www.ktbb.com/alexa.php">Alexa</a></li>
                                <li><a href="https://www.ktbb.com/infocus/">In Focus</a></li>
                                <li><a href="https://www.ktbb.com/specialcoverage/">Special Coverage</a></li>
                                <li><a href="https://www.ktbb.com/govcontacts.php">Government Contacts</a></li>
                            </ul>
                        </li>

                    </ul>

                </section>
            </nav>

        </div>

    </div>

</div>

<!-- @@@@@@@@@@@@@@@@@@@@@@@@@@  END Header  @@@@@@@@@@@@@@@@@@@@@@@ -->

hids – Use OSSEC to monitor changes to directories in real time

I configured an OSSEC server on Ubuntu 20.04 to monitor changes on client machines (also Ubuntu 20.04).

My configuration aims to monitor in real time changes that occur in the default system folders and in the Apache server folder (new files, modified files and file deletion), notifying me in real time by email.

Even with the /var/www folder defined in ossec.conf (on client machines), when creating a file on it, I don’t receive notifications, even restarting the server to test if it will send the notification.
I am only notified when I restart the machine (or after the standard 22 hours of scan) that there have been changes in ossec.conf, but nothing related to /var/www/

What can I have done wrong in my configuration?

Configuration of Client Machines (/var/ossec/etc/ossec.conf)

<ossec_config>

  ...

  <syscheck>
    <!-- Frequency that syscheck is executed - default to every 22 hours -->
    <frequency>79200</frequency>

    <!-- Directories to check  (perform all possible verifications) -->
    <directories report_changes="yes" realtime="yes" check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
    <directories report_changes="yes" realtime="yes" check_all="yes">/bin,/sbin,/boot</directories>
    <directories report_changes="yes" realtime="yes" check_all="yes">/var/www</directories>

  ...
</ossec_config>

Server Configuration (/var/ossec/rules/local_rules.xml)

<rule id="554" level="7" overwrite="yes">
    <category>ossec</category>
    <decoded_as>syscheck_new_entry</decoded_as>
    <description>File added to the system.</description>
    <group>syscheck,</group>
</rule>