jueves, 14 de noviembre de 2024

Some SSL config

 FreePBX  Centos

/etc/httpd/conf.d/ssl.conf

</VirtualHost>


<VirtualHost *:443>

    ServerName devpbx.expitest.com

    DocumentRoot /var/www/html


    SSLEngine on

    SSLCertificateFile /etc/asterisk/keys/devpbx.expitest.com/fullchain.pem

    SSLCertificateKeyFile /etc/asterisk/keys/devpbx.expitest.com/private.pem


    # Optional for security improvements

    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLProtocol all -SSLv2 -SSLv3

    SSLHonorCipherOrder on


    # Additional settings if needed (e.g., log files, directory options)

</VirtualHost>


[general]

enabled=yes

enablestatic=no


bindaddr=0.0.0.0

bindport=8088


sessionlimit=10000

session_inactivity=30000

session_keep_alive=15000

tlsenable=yes


tlsbindaddr=0.0.0.0:8089


tlscertfile=/etc/asterisk/keys/devpbx.expitest.com/fullchain.pem

tlsprivatekey=/etc/asterisk/keys/devpbx.expitest.com/private.pem





lunes, 11 de noviembre de 2024

Creating an snpashot of docker container

1 Create and modify the container:

 docker run -it ubuntu /bin/bash

# Make changes (e.g., install curl)

apt update && apt install curl -y

exit


2 Commit the container to an image:
docker commit <container_id> my_custom_ubuntu:v1

3 Save the image to a tarball:
docker save -o my_custom_ubuntu.tar my_custom_ubuntu:v1

4 Transfer the tarball to the new server:

scp my_custom_ubuntu.tar user@new_server:/path/to/destination/


5 Load the image on the new server:

docker load -i /path/to/destination/my_custom_ubuntu.tar

6  Start a new container from the image:
docker run -it my_custom_ubuntu:v1 /bin/bash

domingo, 10 de noviembre de 2024

miércoles, 6 de noviembre de 2024

git book

 https://git-scm.com/book/en/v2


https://www.atlassian.com/git

martes, 1 de octubre de 2024

adding a pass to folder


Step 1: Enable .htaccess Usage


<Directory /var/www/html>

    Options Indexes FollowSymLinks

    AllowOverride All

    Require all granted

</Directory>


2) sudo systemctl restart apache2


3) Install utils for pass file

 sudo apt-get install apache2-utils


4) Create pass file


  sudo htpasswd -c /etc/.htpasswd yourusername

5) Create a  .htaccess on the folder

cd /var/www/html/recordings

nano .htaccess

Add the following lines to the file:

AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/.htpasswd
Require valid-user

Test and  additional considerations


sudo chmod 644 /etc/.htpasswd
sudo chmod 644 /var/www/html/recordings/.htaccess

viernes, 13 de septiembre de 2024

removing files

 To delete all .wav files in the subdirectories of a specific directory, such as /var/spool/asterisk/monitor/2024/07, you can use a combination of the find command with rm in a Unix-like operating system. Here’s how you can do it safely and efficiently:

Deleting .wav Files in Subdirectories

  1. Open a Terminal:

    Make sure you have the necessary permissions to delete files in the target directory. You might need sudo if the directory requires elevated permissions.

  2. Use the find Command:

    The find command is a powerful utility for searching and performing actions on files. To find and delete all .wav files in subdirectories, use the following command:

    bash
  3. find /var/spool/asterisk/monitor/2024/07 -type f -name '*.wav' -exec rm {} +
  • Explanation:

    • find /var/spool/asterisk/monitor/2024/07: Starts the search from the specified directory.
    • -type f: Searches for files (not directories).
    • -name '*.wav': Matches files with the .wav extension.
    • -exec rm {} +: Executes the rm command on the matched files. The {} is a placeholder for the filenames found, and + means that rm will be called with as many filenames as possible at once.
  • Verify the Files to be Deleted (Optional):

    Before actually deleting the files, you might want to list them to confirm what will be removed. Use the following command to list all .wav files in subdirectories:

    find /var/spool/asterisk/monitor/2024/07 -type f -name '*.wav'
  • Additional Tips

    • Dry Run: To perform a dry run and see what would be deleted without actually removing the files, you can use:

      bash
    • find /var/spool/asterisk/monitor/2024/07 -type f -name '*.wav' -print

  • miércoles, 4 de septiembre de 2024