Skip to content

Instantly share code, notes, and snippets.

View szabacsik's full-sized avatar
🖖

András Szabácsik szabacsik

🖖
View GitHub Profile
@szabacsik
szabacsik / date.sh
Created May 26, 2018 08:01
bash date
TZ="UTC" date +'%Y%m%d.%H%M%S%3N'
TZ="Europe/Budapest" date +'%Y.%m.%d. %H:%M:%S.%3N'
@szabacsik
szabacsik / xdebug.ini
Last active July 7, 2018 07:36
xdebug configuration file
zend_extension="/usr/lib/php/20170718/xdebug.so"
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_autostart=1
xdebug.idekey = PHPSTORM
xdebug.default_enable = 0
xdebug.profiler_enable = 1
;remember to change this to your local ip address
xdebug.remote_host=10.0.75.1
@szabacsik
szabacsik / aide.conf
Last active August 14, 2018 11:36
Runtime configuration for aide ( Advanced Intrusion Detection Environment ) file integrity scanner
@@define AIDEDIR /path/to/aide
database=file:@@{AIDEDIR}/aide.db
database_out=file:@@{AIDEDIR}/aide.db.out
database_new=file:@@{AIDEDIR}/aide.dd.new
gzip_dbout=yes
database_attrs=E
grouped=yes
summarize_changes=yes
verbose=6
report_url=file:@@{AIDEDIR}/logs/aide.log
@szabacsik
szabacsik / bitbucket-pipelines.yml
Last active August 13, 2018 16:11
Simple build configurations to notify an api endpoint when a new commit pushed
image: php:7.2.7
pipelines:
default:
- step:
script:
- apt-get update && apt-get install -y --no-install-recommends jq
- export TOKEN=...
- export API=https://.../
- export TZ="Europe/Budapest"
- export TIME=$(date +'%Y.%m.%d. %H:%M:%S.%3N %Z')
@szabacsik
szabacsik / rsync.md
Last active December 20, 2019 08:18
Rsync example

Copies new and modified files from the source to the target
Ignores file's size and time of last modification and detects changes by checksum
%1 /path/to/source/
%2 /path/to/target/

rsync -rclpogImvh --stats %1 %2
rsync -rclImvh --no-perms --no-owner --no-group --stats --chown=user:group --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r "/path/to/source" "/path/to/target" 2>> error.log 1>> output.log
@szabacsik
szabacsik / git.md
Last active August 5, 2021 13:14
Useful git commands

useful git commands

Create a new empty branch for 'new-branch-name'

git checkout --orphan new-branch-name
git rm --cached -r .
git rm --cached -r -f .
@szabacsik
szabacsik / random_string.php
Created August 22, 2018 20:14
Variable length random string
function randomString ( $minimum_length = 3, $maximum_length = 30 )
{
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$length = rand ( $minimum_length, $maximum_length );
$string = '';
for ( $i = 0; $i < $length; $i++ )
{
$string .= $characters [ rand ( 0, strlen ( $characters ) - 1 ) ];
}
return $string;
@szabacsik
szabacsik / index.html
Last active September 30, 2018 11:16
DEMO Clock App
<!doctype html>
<html lang="en">
<head>
<title>DEMO Clock App</title>
<meta charset="utf-8">
<meta name="description" content="DEMO Clock App">
<meta name="author" content="András Szabácsik">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Bowlby+One+SC" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
@szabacsik
szabacsik / ssl-params.conf
Created October 8, 2018 12:28
Apache configuration snippet to define some SSL settings
# https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-debian-9
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder On
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
SSLCompression off
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
SSLSessionTickets Off
@szabacsik
szabacsik / apache.conf
Created October 8, 2018 13:16
Apache TLS/SSL/HTTPS Configuration File
# https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-debian-9
LogLevel debug
ErrorLog /proc/self/fd/2
CustomLog /proc/self/fd/1 combined
<VirtualHost *:80>
Redirect permanent "/" "https:/localhost"
</VirtualHost>