Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Hartl ohartl

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ohartl on github.
  • I am ohartl (https://keybase.io/ohartl) on keybase.
  • I have a public key whose fingerprint is CF9F B900 B968 E77D 9DB4 E182 BC0F 18F7 EAB1 1EC9

To claim this, I am signing this object:

View knowledge.md
@ohartl
ohartl / php-fpm-checkconf
Created Mar 8, 2016
check all php fpm configs
View php-fpm-checkconf
#!/bin/sh
# for php 7.0
[ -x /usr/sbin/php-fpm7.0 ] && /usr/sbin/php-fpm7.0 -t || echo "php 7.0 not found"
# for php 5.*
[ -x /usr/sbin/php5-fpm ] && /usr/sbin/php5-fpm -t || echo "php 5.* not found"
@ohartl
ohartl / create-jailed-sftp-user
Last active Mar 8, 2016
create user that is restricted to sftp only, is jailed (chroot) and can still access certain directories outside his jail.
View create-jailed-sftp-user
#!/bin/sh
# add group
groupadd sftp-fileshare
# add user
mkdir /home/sftp-fileshare-user1
chown root:root /home/sftp-fileshare-user1
chmod 0755 /home/sftp-fileshare-user1
useradd --home /home/sftp-fileshare-user1 --shell /bin/false sftp-fileshare-user1
@ohartl
ohartl / check http status code with curl
Created Mar 31, 2015
check http status code with curl
View check http status code with curl
#!/bin/bash
http_status=`curl -s -I https://de.php.net/distributions/php-5.6.7.tar.gz | grep HTTP/1.1 | awk {'print $2'}`
echo $http_status
if [ $http_status -eq 200 ]; then
echo "this is HTTP Status 200"
else
echo "not 200"