$clientIpAdress = isset($_SERVER['HTTP_CLIENT_IP'])?$_SERVER['HTTP_CLIENT_IP']:isset($_SERVER['HTTP_X_FORWARDED_FOR'])?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR'];
Do *not* use this on it’s own for security purposes!
Alle Technologiethemen sind hier unter einem Metathema gebündelt.
All technology topics bundled under one meta-topic.
$clientIpAdress = isset($_SERVER['HTTP_CLIENT_IP'])?$_SERVER['HTTP_CLIENT_IP']:isset($_SERVER['HTTP_X_FORWARDED_FOR'])?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR'];
Do *not* use this on it’s own for security purposes!
Mächtiges CSS und mächtiges HTML eröffnen neue Möglichkeiten – auch für Angreifer. Hier eine Liste an Sicherheitstchecklisten und HTML Security Ratgebern:
du -cksh [Verzeichnis]
du steht für “disk usage”, die Parameter für c -> Gesamtsumme anzeigen, k -> 1000 Byte Blöcke (statt 1024 Byte), s -> Summe, h -> human readable (menschenlesbar)
The all-out hipster among the PHP frameworks.
We had a neat Web Engineering Group Düsseldorf Meetup at the old Trivago location (they’re currently moving). Once again an awesome event with a very nice lineup of speakers. Enjoyed it a lot.
grep -rl "[SUCHBEGRIFF]" | xargs sed -i 's,[SUCHBEGRIFF],[ERSATZ],g'
A nice way to compare frameworks: HNPWA.
Sort ls output – Directories, then files, then links:
ls -la | grep "^d" && ls -la | grep "^-" && ls -la | grep "^l"
<?php $urlPathToFileInSameDirectory = (isset($_SERVER['HTTPS'])) ? "https" : "http" . str_replace('/index.php',"",str_replace(basename(__FILE__),"","://$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF]")).'/MyFileName.txt'; ?>
Put this in a bash script and execute it:
#!/bin/bash wget -X /PATH/TO/WP_ROOT/wp-content/uploads -r -nH -nc ftp://FTP_USER:FT_PPW@FTP_HOST//WP_ROOT
reg bld und tput-command-colors Text Text Text $(tput setaf 1) Text Text Text $(tput setaf 2) Text Text Text $(tput setaf 3) Text Text Text $(tput setaf 4) Text Text Text $(tput setaf 5) Text Text Text $(tput setaf 6) Text Text Text $(tput setaf 7) Bold $(tput bold) Underline $(tput sgr 0 1) Reset $(tput sgr0)
To prevent perpetual login redircet loops in local/development WordPress installations add this function to your wp-config.php (have it return the users ID you want to authenticate):
function wp_validate_auth_cookie($cookie='',$scheme='') { return 1; // admin user id }
csplit MEINE_SQL_DATEI.sql '/-- --------------------------------------------------------/' {9999} && rename 's/(xx.*)/$1.sql/' *
xx – Je nach Anzahl der Fragmentdateien stehen im Prefix mehr oder weniger Xe.