macos – mv returns “Not a directory” when in a script, but runs properly from the console

I have this line in a script:

mv -f Tasting/bin/release/net5.0/osx-x64/ /Users/thomas/Downloads

and it returns:

mv: rename Tasting/bin/release/net5.0/osx-x64/ to /Users/thomas/Downloads/ Not a directory

but if I run the same line from the shell, it executes properly. Why is that?

php – How to restrict particular page and directory for browser using .htaccess file in wordpress?

Hello I have face issues in WordPress that some directory page and some pages of WordPress code is opening in browser.

Below links are opening in browser

etc etc

And lost of links are which I don’t want to open in browser.

So is there any way that I can direct these links on HomePage Or 404 Page with .htaccess file or any other way.

I have also tried below code and some pages are blocked for browser. but still few links are still open.

Options -Indexes

So, is there any way to restrict particular page and particular directory with .htaccess.

If I have to write a single code for restrict single file or directory it will be fine.

Thanks in Advance.

How retrieve or recreate a delete file from the /etc/ssh directory

In Mac El Capitan in the /etc/ssh directory exists the following content:

moduli          ssh_host_dsa_key      ssh_host_key  
ssh_config    ssh_host_ed25519_key        sshd_config
ssh_config~orig ssh_host_ecdsa_key    ssh_host_rsa_key        sshd_config~previous

I can see practically two categories:

  1. public/private keys
  2. configuration files

If any of those files for any of these categories is deleted by mistake.

How that file can be re-generated? Is possible?, How? it according of each category (1 or 2)

directory index – Best form for URLs: file-name.html or /file-name/

Running a Nibbler analysis on a static website I just built, I got the following feedback:

Avoid use of file extensions wherever possible. File extensions appear at the end of web addresses, and have several negative effects. They make the address harder to remember or type (particularly for non-technical users), and can reveal the underlying technology of the website making it very slightly more vulnerable to hackers. They also tie the implementation of the website to a specific technology, which can make subsequent migration of URLs difficult.

The above message is a result of having a flat directory structure and linking directly to the individual web pages (whatever.html). So is it really that much better to put every html file on a website in its own personal subdirectory (giving every webpage the file name index.html and relying on the directory name to identify the file) vs simply linking directly to the individual html files? I did some searching but didn’t really find anything useful. This discussion had some info but didn’t answer my question.

I’m curious to know what folks think of the two different approaches. Thanks.

mysql – When Companies Record web traffic, Do they record to a database or record to a directory?

Apache (if that is what they are using) writes a log file (“access.log”). That can be periodically copied to another server, and then parsed.

The results can then be stored in a huge database for later studying to determine the activity for each user, aggregate activity, the activity of each page, etc.

Be sure that companies, like those, at least of thousands of servers whose sole job is to parse, store, and analyze the log files.

The data is not necessarily stored in the parsed format for storing into RDBMSs or stored in a file depends on the architects and programmers involved. It is very likely to be a custom dataset with custom code to massage it.

The data would live on a SAN or multiple SANs. It would be petabytes in size, even if frequently pruned.

Why do you ask?

tools – How to create a directory template in Unity?

How to create a directory from a template with multiple files in it which are also created from templates?

Right now, I am particularly interested in creating an Assembly directory which uses a user-entered variable ASSEMBLY_NAME, take the project name variable from the settings and would create the following simple file hierarchy:


where the ${PROJECT_NAME}.${ASSEMBLY_NAME}.asmdef file would contain:


… but I would also be glad to learn any way to create whatever complex templated hierarchies, like creating a class and a companion test script together at once, create a directory with a “readme” file in it, etc.

I know this is somehow possible, because there is a default Unity UI function which does exactly the same, but for test assemblies only, so it adds extra code in the assembly definition file which I don’t need.

enter image description here

I cannot find anything on this topic apart from answers on how to create/edit a single file templates, e.g.:

active directory – Trying to reproduce petitpotam exploit, got “KDC_ERROR_CLIENT_NOT_TRUSTED (62)” error

I’m following this article to reproduce the EFS bug:

My environment:

  1. Windows 2016 AD (Hostname: W2016$)
  2. Windows 2016 SRV01 (Running AD CS service)
  3. Windows 2016 SRV02 (Attack machine)

I’ve successfully generated the certificate with ntlmrelayx

(*) Skipping user W2016$ since attack was already performed
(*) Base64 certificate of user W2016$:

Then I logged in to SRV02 with a low privilege user. When I pass the ticket in kekeo, it results in KDC_ERROR_CLIENT_NOT_TRUSTED error:

# tgt::ask /pfx:xxx /user:W2016$ / /ptt

Realm        : (corp)
User         : W2016$ (W2016$)
CName        : W2016$   (KRB_NT_PRINCIPAL (1))
SName        : krbtgt/    (KRB_NT_SRV_INST (2))
Need PAC     : Yes
Auth mode    : RSA
(kdc) name: (auto)
(kdc) addr: (auto)

Does anyone know what’s wrong here?

python – PyTest – assets a temporary directory in a unit test

What is the approach when unit testing a function that creates some directory and fills it with content?

For the unit test itself, I can imagine we shall have an artificial directory that will be deleted once the unit test is finished.

I have tried the @pytest.fixture(scope="session"). However, this was not exactly it.

active directory – Deploying Windows Server AD DS as IaaS (VM) in Azure?

I’m currently seeking some advice and guidance whether deploying additional Windows Server 2019 VM in Azure to run Active Directory Domain Controller / Global Catalog in separate AD sites called ‘Azure’ is really have any benefits or not?

At the moment my AD domain is just single forest AD, spread across multiple geographical locations throughout Asia Pacific.

Azure AD Connect runs Password Hash Sync to Azure AD, since we are still using Hybrid Exchange 2016-Office 365.

What are the benefits and the caveats when deploying one more AD DS as IaaS in Azure to serve the AD Sites called ‘Azure’ that is for the IP Subnet of the VNET I peered from Azure to OnPremise?

bash – ds4mac – directory switcher for macOS/Linux: the installer script

In this post, I present the bash script for installing the ds4mac:

#!/usr/bin/env bash

script_magic="alias ds='source ~/.ds/ds_script'"

echo "Installing ds..."

grep "$script_magic" ~/.bashrc 

if ( $? != 0 ); then
    echo "$script_magic" >> ~/.bashrc   
    echo "~/.bashrc updated!"
    echo "~/.bashrc is already updated."

# Create files:
echo "Creating files..."
mkdir -p ~/.ds
echo "Created the .ds directory."
make > /dev/null
cp ds_engine ~/.ds/ds_engine
echo "Built the ds_engine."
touch $tag_file

add_tag_to_file () {
    grep $1 $tag_file > /dev/null
    if ( $? != 0 ); then
        echo $1 $2 >> $tag_file
        echo Setting the tag $1 to directory $2 done.

# Populate the default 
echo "Populating the tag file with default tags..."

add_tag_to_file "docs" "~/Documents"
add_tag_to_file "down" "~/Downloads"
add_tag_to_file "root" "/"
add_tag_to_file "home" "~"
add_tag_to_file "ds"   "~/.ds"

echo "Done populating the tag file with default tags."
echo "Copying the script..."

cp ds_script ~/.ds/ds_script

echo "Done! ds will be available for use in your next shell session. :-)"

(The entire project is here.)

See also

  1. The main script
  2. The tag engine

Critique request

Please, tell me anything that comes to mind. ^^