Skip to content

Instantly share code, notes, and snippets.

View sebastiansommer's full-sized avatar

Sebastian Sommer sebastiansommer

View GitHub Profile
@sebastiansommer
sebastiansommer / create-users.bat
Created October 9, 2020 04:17
Create batch windows users and add to remote desktop group
set number=0
:start_loop
set /A number=%number%+1
if %number% GTR 50 goto end
net user user%number% foo /add /comment:"batch" /expires:never /fullname:"User %number%" /passwordchg:no
net localgroup "Remote Desktop Users" user%number% /add
goto start_loop
@sebastiansommer
sebastiansommer / ddev-mysql-open.sh
Created May 4, 2020 08:29
DDEV Open MYSQL from Command Line (for example to use TablePlus)
PORT="$(ddev describe | ggrep -Pio "(?<=port=)[0-9]*")"
open mysql://db:db@127.0.0.1:${PORT}/db
@sebastiansommer
sebastiansommer / install.sh
Last active November 19, 2019 06:45
Install Nginx + PHP 7.3 for Flow Application
amazon-linux-extras install nginx1
amazon-linux-extras install php7.3
mkdir -p /var/www/html
chown -R ec2-user:nginx /var/www/html
cat << EOF > /etc/yum.repos.d/MariaDB10.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
@sebastiansommer
sebastiansommer / flock_nagios.php
Last active September 3, 2018 11:02
Simple nagios script to integrate flock.
#!/usr/bin/php
<?php
/**
* Example call in nagios xi:
* /usr/local/bin/flock_nagios.php hostname="$HOSTNAME$" state="$HOSTSTATE$" message="$HOSTOUTPUT$" notificationType="$NOTIFICATIONTYPE$"
*/
$flockUrl = 'YOUR_FLOCK_URL';
$parameters = [];
@sebastiansommer
sebastiansommer / adbToggleAirplane.sh
Created May 1, 2018 09:50
Toggle airplane mode with adb and restart personal hotspot.
adb shell settings put global airplane_mode_on 1 && adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
sleep 15
adb shell settings put global airplane_mode_on 0 && adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
adb shell am start -n com.android.settings/.TetherSettings
adb shell input keyevent 20
adb shell input keyevent 66
#!/bin/bash
# AWS PHP 7
sudo yum update -y
sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd php70-mbstring.x86_64 git
sudo service httpd start
sudo service mysqld start
sudo chkconfig httpd on
sudo chkconfig mysqld on
sudo usermod -a -G apache ec2-user
@sebastiansommer
sebastiansommer / Image.html
Created June 16, 2014 09:49
Extends the image node type to use the original image
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace media=TYPO3\Media\ViewHelpers}
<figure{f:if(condition: imageClassName, then: ' class="{imageClassName}"')}>
<f:if condition="{image}">
<f:then>
<f:if condition="{link}">
<f:then>
<a href="{link}"><media:image asset="{image}" alt="{alternativeText}" title="{title}" maximumWidth="{maximumWidth}" maximumHeight="{maximumHeight}" allowCropping="{allowCropping
}" allowUpScaling="{allowUpScaling}" /></a>
</f:then>