This file contains 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 | |
/** | |
* Reference/source: http://stackoverflow.com/a/1464155/933782 | |
* | |
* I want a short alphanumeric hash that’s unique and who’s sequence is difficult to deduce. | |
* I could run it out to md5 and trim the first n chars but that’s not going to be very unique. | |
* Storing a truncated checksum in a unique field means that the frequency of collisions will increase | |
* geometrically as the number of unique keys for a base 62 encoded integer approaches 62^n. | |
* I’d rather do it right than code myself a timebomb. So I came up with this. | |
* |
This file contains 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 | |
#uses mtn (movie thumbnailer) https://sourceforge.net/projects/moviethumbnail/ | |
#requires tahoma font to be installed https://github.com/caarlos0/msfonts/blob/master/fonts/tahomabd.ttf | |
clientid='3e7a4deb7ac67da' | |
img=$(mktemp -d) | |
mtn -f "/usr/share/fonts/truetype/msttcorefonts/tahomabd.ttf" -c 1 -r 8 -D 6 -b 0.80 -B 240 -O $img -o'.jpg' "$1" | |
for f in $img/* |
This file contains 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
using Android.App; | |
using Android.Widget; | |
using Android.OS; | |
using Android.Content; | |
using System.Text; | |
using System; | |
namespace AndroidDataReceiver | |
{ | |
[Activity(Label = "AndroidDataReceiver", MainLauncher = true, LaunchMode = Android.Content.PM.LaunchMode.SingleTop )] |
This file contains 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 | |
//example class: | |
class myObject | |
{ | |
public $property1; | |
public $property2; | |
public $property3; |
This file contains 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
/*! CSS Used from: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css */ | |
body{margin:0;} | |
footer{display:block;} | |
audio{display:inline-block;vertical-align:baseline;} | |
audio:not([controls]){display:none;height:0;} | |
a{background-color:transparent;} | |
a:active,a:hover{outline:0;} | |
h1{margin:.67em 0;font-size:2em;} | |
img{border:0;} | |
button,input,select{margin:0;font:inherit;color:inherit;} |
This file contains 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/sh | |
apt-get update && apt-get upgrade | |
systemctl stop apache2 | |
apt-get remove --purge apache2 | |
apt-get install -y nginx | |
systemctl start nginx | |
systemctl enable nginx | |
systemctl status nginx | |
apt-get install -y php-fpm php-mysql | |
apt-get install -y mysql-server |
This file contains 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
# =================== YOUR DATA ======================== | |
SERVER_NAME="some-server-name" | |
SERVER_IP="111.111.11.11" | |
USER="someuser" | |
SUDO_PASSWORD="secret-password-one" | |
MYSQL_ROOT_PASSWORD="secret-password-two" |
This file contains 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
# =================== YOUR DATA ======================== | |
SERVER_NAME="some-server-name" | |
SERVER_IP="111.111.11.11" | |
USER="someuser" | |
SUDO_PASSWORD="secret-password-one" | |
MYSQL_ROOT_PASSWORD="secret-password-two" |
This file contains 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
echo testing | |
pause |
This file contains 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 | |
//get default gatwway | |
exec("route -n | awk '{print $2}' | grep -v '0.0.0.0' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'",$gw); | |
//nmap scan to get all devices with open port 8008 whis is what chromecast listens on | |
exec("nmap ".$gw[0]."/24 -p 8008 -oG - | grep 8008/open | awk '{print $2}'",$chromecasts); | |
$out=array(); | |
//loop through and get the setup info page data | |
foreach($chromecasts as $chromecast) { | |
$url='http://'.trim($chromecast).':8008/setup/eureka_info'; | |
$curl_handle=curl_init(); |
OlderNewer