Skip to content

Instantly share code, notes, and snippets.

View ohartl's full-sized avatar

Oliver Hartl ohartl

View GitHub Profile
@ohartl
ohartl / check http status code with curl
Created March 31, 2015 19:53
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"
@ohartl
ohartl / php-fpm-checkconf
Created March 8, 2016 17:04
check all php fpm configs
#!/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 March 8, 2016 17:56
create user that is restricted to sftp only, is jailed (chroot) and can still access certain directories outside his jail.
#!/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 / knowledge.md
Last active June 8, 2018 17:28
Knowledge
@ohartl
ohartl / keybase.md
Created September 8, 2019 23:01
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: