Skip to content

Instantly share code, notes, and snippets.

View koivunen's full-sized avatar
💭
🛠️

Koivunen koivunen

💭
🛠️
View GitHub Profile
@koivunen
koivunen / do_dirchown.php
Last active July 17, 2018 11:24
Chown files to www-data when you do not have access to do it yourself
<?php
$dest = "../public_html_chowned";
$source = "../public_html";
error_reporting(-1);
ini_set('display_errors', 'On');
ob_end_flush();
ob_implicit_flush();
@koivunen
koivunen / display-manager-killer.service
Last active July 28, 2017 08:20
Kill user session after X11 inactivity, prototype version
[Unit]
Description=KILL_DISPLAY_SESSION_ON_IDLE
After=display-manager.service
[Service]
Environment=DISPLAY=:0
WorkingDirectory=/home/display/
Type=simple
ExecStart=/usr/sbin/idlekillr display
@koivunen
koivunen / eduroam.sh
Last active July 28, 2017 08:20
Eduroam password updater
#!/bin/bash
read -p "EDUROAM EMAIL: " EMAIL
HASH=$(read -s -p "Password:" | iconv -t utf16le | openssl md4 -hex | awk '{print $2}')
cat << EOF | sed "s/EMAIL/$EMAIL/" | sed "s/HASH/$HASH/" | tee /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="eduroam"