This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Automatically finds your php version, installs, and enables the blackfire extension on your current php. | |
source ~/.phpbrew/bashrc | |
EXTENSION_URL="https://packages.blackfire.io/binaries/blackfire-php/1.27.0/blackfire-php-linux_amd64-php-VERSION.so" | |
PHP_VERSION=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') | |
EXT_DIR=$(phpbrew path ext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BLUETOOTH_DIR=/var/lib/bluetooth | |
for CONTROLLER_DIR in ${BLUETOOTH_DIR}/*; do | |
CONTROLLER_MAC=$(basename ${CONTROLLER_DIR}) | |
if [ -d "${CONTROLLER_DIR}" ] && [[ $CONTROLLER_MAC =~ ^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$ ]] ; then | |
for DEVICE_DIR in ${CONTROLLER_DIR}/*; do | |
DEVICE_MAC=$(basename ${DEVICE_DIR}) | |
if [ -d "${DEVICE_DIR}" ] && [[ $DEVICE_MAC =~ ^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$ ]] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// place this code inside a php file and call it f.e. "download.php" | |
$path = $_SERVER['DOCUMENT_ROOT']."/path2file/"; // change the path to fit your websites document structure | |
$fullPath = $path.$_GET['download_file']; | |
if ($fd = fopen ($fullPath, "r")) { | |
$fsize = filesize($fullPath); | |
$path_parts = pathinfo($fullPath); | |
$ext = strtolower($path_parts["extension"]); |
NewerOlder