bsdpro.se

random computer tech stuff

bsdpro.se

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • About
  • π

Category Archives: bash

Generate htpasswd for nginx with openssl

Posted on December 13, 2018 by shelter
Reply

There’s no need to have apache utils or tools to generate a Basic authentication password for nginx. Type the following in bash and replace user with the username you want:

printf "user:`openssl passwd -apr1`\n" >> /etc/nginx/.htpasswd

Posted in bash, nginx | Leave a reply

Set specific chmod for folders and files

Posted on December 4, 2018 by shelter
Reply

To change all the directories to 755 (drwxr-xr-x):

find /mnt/storage -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r–r–):

find /mnt/storage -type f -exec chmod 644 {} \;
Posted in bash | Leave a reply

Recent Posts

  • Fix OpenBSD guest CPU idle usage – KVM / Proxmox (qemu)
  • Resize a qcow2 disk image on Linux
  • Quick reference/Howto – Create a PR on Github
  • Import wireguard config to NetworkManager
  • FreeBSD – Upgrade PHP 7.4 to 8.0 in one line

Recent Comments

  • shelter on Dnsmasq – Conditional DNS Forwarding for Windows Active Directory Domains
  • Aleksandr on Dnsmasq – Conditional DNS Forwarding for Windows Active Directory Domains
  • full hd tek parça izle on Fix Remove-AppxProvisionedPackage error

Archives

  • July 2024
  • June 2024
  • September 2022
  • June 2021
  • December 2019
  • July 2019
  • December 2018
  • November 2018

Categories

  • bash
  • FreeBSD
  • gentoo
  • github
  • Linux
  • nginx
  • Notepad++
  • OpenBSD
  • OpenWRT
  • qemu
  • Windows 10

My account

  • Log in
Proudly powered by WordPress