apache2 – htaccess: Directory Listing and Basic Auth?

I would like to combine Directory Listing and Basic Auth for a single directory, only having access to the .htaccess file (not any server-wide apache configurations).

So far, my `.htaccess can have either the Directory Listing enabled:

Options +Indexes
IndexOptions FancyIndexing SuppressDescription IconHeight=50 HTMLTable SuppressLastModified
IndexIgnore ..
ServerSignature Off

or the Basic Auth:

Authtype Basic
AuthName "Personal Directory"
AuthUserFile .htpasswd
Require valid-user

Any way to have both at the same time?

Directory to place files on windows

on linux when we have a foothold and we want to transfer files to the victim we usually transfer it to /tmp beacuse it is writable and always there.
what directory should we transfer our files if we compromise a windows machine which is usually writable and always there ?

linux – How to delete all files except some specific file (for many folders in a directory)? via bash script

So I have a Master folder that contains about 800 sub-folders (eg. 1,2,3…) which contains many files but I want to delete everything else except the file that ends with *tsv.
Is there a way to do this via a bash script?

Master Folder

Folder #1

  • sample.txt
  • sample2.txt
  • test.tsv
  • sample.tsv

Folder #2

  • sample.txt
  • sample2.txt
  • test.tsv
  • sample.tsv

and so on..

Thank you in advance.

python – FileNotFoundError: [Errno 2] No such file or directory: ‘combos.txt’

=)

Tengo un problema que no consigo sacar… Estoy trabajando en un subprocesos de un programa más grande (una opción de un menú, pero para hacerlo más organizado, pensé en utilizar subprocesos.) El caso, este módulo cada vez que trata de poner el archivo de texto, me dice que no existe, cuando se encuentra dentro de la misma ruta que dicho módulo! Se que python trabaja con rutas absolutas si no recuerdo mal, pero en este caso, estaria bien que el usuario no tuviese que escribir toda la ruta.. Dejo el código por si es de ayuda:

    #IMPORTS
import os
import platform
import time

if platform.system() == "Windows":
    clear = lambda: os.system('cls')
    clear()

print("You selected module five -> Lowercase first character in passwordn")
time.sleep(1)

combo = input("Open your file: ") #USUARIO PONE NOMBRE DE ARCHIVO QUE SE ENCUENTRA EN LA MISMA RUTA QUE DICHO MÓDULO
if combo == "combos.txt": #EL USUARIO ESCRIBIRÁ EL NOMBRE DEL ARCHIVO, QUE DEBERÁ LLAMARSE IGUAL QUE EL ARCHIVO QUE DEBE SER EDITADPO "combos.txt"
    try:
        verify = open(combo, "r")
        print("File was loaded succesfully!")
    except:
        print("--Something went wrong while trying to load your file--")
    with open(combo):
        prueba = verify.lower()
        verify.write(prueba)
        verify.close()
        print(prueba)
else:
    print("This is not the correct file. Please check another time.")

Dicho módulo también tiene otro problema más abajo, para los más observadores, puede que se hayan dado cuenta de que quizás el funcionamiento del lower no funciona correctamente. He probado distintas opciones en un archivo aparte pero no funciona. Por no alargar más el post, tengo dos problemas que me no consigo solucionar:

  1. El archivo “combos.txt” me dice que no existe cuando se encuentra en la misma carpeta que dicho subproceso o módulo.
  2. Cuando trata de editar el archivo no logra editarlo haciendo en minúsculas el contenido de dicho archivo (combos.txt).

Espero haberme explicado con claridad! =)
Cualquier duda o comentario siempre es bien recibido! =)

Intentaré estar atento a las respuestas 😉

magento2 – css file : failed to open stream: No such file or directory

in my case i have added a less file to compile a css file in my Base Module , but after I run this command “bin/magento setup:static-content:deploy -f” an error was occured like belllwo

  (MagentoFrameworkExceptionFileSystemException)                                                                                                               
  Cannot read contents from file "/var/www/html/myproject/pub/static/frontend/Magento/blank/en_US/Mymodule_Base/style.css" Warning!file_get_contents(  
  /var/www/html/myproject/pub/static/frontend/Magento/blank/en_US/Mymodule_Base/style.css): failed to open stream: No such file or directory  

Ps : i have already grant all privileges with chmod 777 ans also with chown

can anyone help me please to run the command correctly

Node js and express js shwoing listing directory whenever I run server locally at port

Whenever I try to open my server locally using node and express everytime its shwoing me listing directory files. But the course from where I studied is displaying the frontend html site created. I have attached the code and expected output vs output I am getting. Please help.
My code

Expected output

My output

permalinks – How to add a sub directory to WordPress single posts without affecting other post types?

If we look at the register_post_type documentation, in the rewrite option, there is a sub-option that controls this:

'with_front' => bool Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true

So something like this:

    ...
    'rewrite' => ( 'with_front' => false ),
    ...

More information on register_post_type rewrite options

redhat – Problem installing Oracle 19c to symlinked directory from RPM

I’ve created destination directory and linked it to default install path:

$mkdir /u01/oracle
$ln -s /u01/oracle /opt

Then I’ve changed the owner:

$sudo chown -R oracle:oinstall /opt/oracle

But when I tried to install RPM I got an error:

$sudo rpm -i ./oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: ./oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

(SEVERE) The install cannot proceed because ORACLE_BASE directory (/opt/oracle)
is not owned by "oracle" user. You must change the ownership of ORACLE_BASE
directory to "oracle" user and retry the installation.

error: %prein(oracle-database-ee-19c-1.0-1.x86_64) scriptlet failed, exit status 1
error: oracle-database-ee-19c-1.0-1.x86_64: install failed

How to properly fix this problem?

Get Paid to Post Businesses to New Directory – $10 for 25

I am looking for someone to post actual businesses to a new cannabis business directory. This would require Googling businesses and entering the details of the business to the directory including business name, description, address, hours and 1 image.

I will pay $10 for every 25 satisfactory listings submitted. This will only be available to the first 5 or so members to respond.

Please post here or PM for the directory URL. I will post here when the opportunity is closed. Thanks!

macos – Wrong working directory, if bash script is opened via double-click

I wrote a bash script in order to directly start eclipse from different workplace locations. Each workplace contains the script, after running it, eclipse is started with the respective workspace set.

#!/bin/bash

# relative path
#ECLIPSE_DIR='../../'
ECLIPSE_DIR='/Users/mike/Development/java/'
ECLIPSE="${ECLIPSE_DIR}eclipse/eclipse.app"

AUTHOR='mike'

# current directory is workspace
WORKSPACE=`pwd`
echo "WORKSPACE = $WORKSPACE"

# start eclipse from current directory
#open -n $ECLIPSE --args -data $WORKSPACE -vmargs -Duser.name='$AUTHOR'

The script is working, when I run it from the terminal. But when I double-click it, it uses the home directory as working directory and thus starts eclipse not from the directory that contains the script.

Apparently scripts are executed from ~/., which is the cause for my trouble. What can I do to fix this? Or how can I change my script to get the desired behavior?