My friend give me an android phone (Samsung Galaxy S4 I9505XXUHPK2) because he didn't want to use it any more. It was a perfectly working modern device with only one problem: it's screen was broken. It usually happens to big touch screen phone, that their screen get crashes somehow, but their other functionalities keep working fine. So i was happy, that i got a fully functionalling phone, until he describe that broken screen means it's totally broken: no touch detection and no display! But unless this small drawback, it seem to be all right: it automatically connented to a known wifi and it's alarm clock also turned on sometimes. But yet the only response from it was a status led in the top-left corner (witch helped to detect if it's currently booting); the backlight of the menu and the back button (witch was the only way to find out, if i just turned on or off the screen); and the vibration (witch was also indicated a boot start (, or a new mess
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
var script = document.createElement('script'); | |
script.onload = function () { | |
html2canvas(document.body, { | |
allowTaint: true, | |
//taintTest: false, | |
logging: true, | |
onrendered: function(canvas) { | |
var img = canvas.toDataURL("image/png"); // window.location.href = img.replace("image/png", "image/octet-stream"); | |
var link = document.createElement("a"); | |
link.download = "page.png"; |
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
func part1(digits: String){ | |
//print("solving \(digits): \n\t",terminator: "") | |
let chars = digits.characters.map { String($0) } | |
var sum = 0 | |
for i in stride(from: 0, to: chars.count, by: 1) { | |
if Int( chars[i] )! == Int( chars[ (i+1) % chars.count] )! { | |
//print( Int( chars[i] )! ) | |
sum = sum + Int( chars[i] )! | |
} | |
} |
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
# creating a virtual Ubuntu (14.04) on AWS EC2 (t2.micro) | |
# install MPTCP | |
sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 379CE192D401AB61 | |
sudo echo -e "\n\n# for MPTCP\ndeb https://dl.bintray.com/cpaasch/deb jessie main\n" >> /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install linux-mptcp | |
# reboot | |
sudo reboot | |
# verify |
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 | |
if(!isset($_SERVER['REMOTE_ADDR']) || $_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']){ | |
// for security, deny access outside of localhost (comment it out if you want to allow control from outside) | |
exit(); | |
} | |
//error_reporting(E_ALL); | |
//ini_set('display_errors', 1); | |
$adb_command = './adb'; |
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
// https://github.com/matthiasmullie/minify | |
/** | |
* Merge same values to a shorter formula: | |
* 4 to 3, e.g.: "padding: 1px 2px 3px 2px" -> "padding: 1px 2px 3px" | |
* 3 to 2, e.g.: "padding: 1px 2px 1px" -> "padding: 1px 2px" | |
* 2 to 1, e.g.: "padding: 1px 1px" -> "padding: 1px" | |
* (if all the 4 values are the same, it will be shorten to 3, then to 2, then to 1. ) | |
* Care about calc values too. |
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
#!/usr/bin/python | |
import urllib | |
import json | |
ips = set() # store only unique values | |
log = open('log.csv','r').read().split('\r\n') | |
for record in log: | |
if len(record)==0: # last one |
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
# https://github.com/lgandx/PoC/blob/master/SMBv3%20Tree%20Connect/Win10.py | |
# corrected for Python 3.4.3 | |
import sys, struct, socketserver | |
from collections import OrderedDict | |
from datetime import datetime | |
from calendar import timegm | |
class Packet(): | |
fields = OrderedDict([ |
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
#include <stdio.h> | |
int main(){ | |
int i,a=0; | |
for( i=0; i<3; i++){ | |
if(i%3) | |
if(i%2) | |
printf("%d\n", (a = a+=2) ); | |
else |
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 | |
// kill boolean | |
// dbcolumn keeped | |
if($_SERVER['REQUEST_METHOD']=='POST'){ | |
header('Content-Type: text/plain; charset=utf-8'); | |
$csv = $_POST['csv']; | |
$csv = trim($csv); // cut whitespaces |