View AjaxAuthenticationListener.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Bundle\MyBundle\EventListener; | |
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\Security\Core\Exception\AccessDeniedException; | |
use Symfony\Component\Security\Core\Exception\AuthenticationException; | |
class AjaxAuthenticationListener | |
{ |
View Symmetric Encryption and Decryption of large Files with OpenSSL.md
PHP lacks a build-in function to encrypt and decrypt large files.
openssl_encrypt
can be used to encrypt strings, but loading a huge
file into memory is a bad idea.
So we have to write a userland function doing that. This example uses the symmetric AES-128-CBC algorithm to encrypt smaller chunks of a large file and writes them into another file.
Encrypt Files
View pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ## Description | |
# This pre-commit git hook makes sure that a local username is defined if there is any remote repository on github. | |
# This is helpful if you are working with multiple remote hosts and use different usernames. If you forget to configure | |
# the local username you may end up sending a wrong username to your github remote. | |
# | |
# ## Usage | |
# This is script is only useful if you make it available as a hook template. To achieve this, follow these steps: | |
# |
View datensicherung.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo. | |
echo Hallo, | |
echo die Datensicherung wird gestartet. Datensicherung wird unter E: gesichert. | |
echo. | |
robocopy "C:\Users\Heinrich\Desktop" "E:\Datensicherung\Desktop" /MIR /NP | |
robocopy "C:\Firma" "E:\Datensicherung\Firma" /MIR /NP | |
robocopy "C:\Privat" "E:\Datensicherung\Privat" /MIR /NP |
View README.md
Apache mit FastCGI und PHP-FPM
Bei Debian sollte '''nicht''' das fastcgi sondern das proxy_fcgi Modul verwendet werden. Dafür wird die Konfiguration standardmäßig bereitgestellt.
Zunächst müssen die passenden Pakete installiert werden:
sudo apt install php-fpm
Die Konfigurationsdateien finden sich unter
View ssl-cert-generator.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# References this great tutorial for creating an own CA and certificates based on it: | |
# https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/ | |
# | |
# It is assumed that the CA cert is located at /etc/ssl/certs/root.pem and the CA key | |
# at /etc/ssl/private/root.key | |
# | |
if [ "$#" -ne 1 ] | |
then |
View leopc39_cac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
idle |