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 | |
$file = $argv[1]; | |
$ffmpeg = './ffmpeg'; | |
if(empty($file)){ | |
die('no file provide'); | |
} | |
$length = shell_exec("$ffmpeg -i $file 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//"); |
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
for dir in ams-backend ams-frontend ams-pop ams-crm-android qrscan | |
do | |
cd /root/git_sync/$dir | |
sudo git fetch --all | |
for a in $(git branch -a | grep remotes|grep gerrit | sed 's/remotes\/gerrit\///'); do git push -f origin gerrit/$a:refs/heads/$a; done | |
done |
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/php | |
<?php | |
echo "\nRunning php linter...\n"; | |
$params = explode(' ', file_get_contents('php://stdin')); | |
$ref = trim($params[1]); | |
$diff = array(); | |
$return = 0; |
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 | |
$files = scandir('.'); | |
shuffle($files); | |
$i = 1; | |
foreach($files as $file){ | |
if(preg_match('/^\./', $file)){ | |
continue; | |
} | |
if(!preg_match('/(mp3|wav)$/', $file)){ | |
continue; |
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
eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlLCJzcGFjZVNoaXAiOnRydWV9fSwic3RvcmVzIjp7IuacqOWktCI6ODMyOTgsIuiCiSI6OTkwNTAsIuavm+eariI6Mzk0Miwi6K+x6aW1IjoyNDIsIueJmem9vyI6MTgwMTUsIuearumdqSI6MzQwNCwi6IWM6IKJIjo0NDU5LCLps57niYciOjU2MDAwLCLluIPljLkiOjkwLCLmiqTouqvnrKYiOjIsIue9l+ebmCI6MSwi5rC06KKLIjoxMDAsIumqqOaeqiI6Miwi54Gr54KsIjo5OSwi5peF6KGM5YyFIjoxLCLnmq7nlLIiOjEsIuWtkOW8uSI6OTk5OTk0OSwi5Yy755aX6I2v5YmCIjo5OTg4LCLpk4EiOjE1Mzk5LCLnhaQiOjIxNDQsIumSoiI6MjIxNjMwLCLmsLTmobYiOjEwMCwi6LSn6L2mIjoxMCwi6ZOB55SyIjoxLCLpk4HliZEiOjEsIuWkp+i0p+i9piI6MTAwMCwi6ZO+55CDIjowLCLpkqLnlLIiOjEsIumSouWJkSI6MSwi5aSW5pif5ZCI6YeRIjoxNTk2NCwi5rC0566xIjoxMDAwLCLmraXmnqoiOjMwMSwi6ZWt5bCE5p6qIjoxMDAwLCLnh4PmlpnnlLXmsaAiOjk1MCwi5omL6Zu3Ijo5OTgyLCLnoavno7oiOjk1MH0sImNoYXJhY3RlciI6eyJwdW5jaGVzIjoxMjQsInN0YXJ2ZWQiOjMsInBlcmtzIjp7IumZjem+meWNgeWFq+aOjCI6dHJ1ZSwi6YCa6IeC5ouzIjp0cnVlLCLlh4zms6Llvq7mraUiOnRydWV9LCJkZWh5ZHJhdGVkIjoyfSwiaW5jb21lIjp7ImdhdGhlcmVyIjp7ImRlbGF5IjoxMCwic3RvcmVzIjp7 |
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/env python2 | |
""" | |
Author: takeshix <[email protected]> | |
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]). | |
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
""" | |
import sys,struct,socket | |
from argparse import ArgumentParser |
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 | |
$data = array(); | |
for($i = 0; $i <= 50; $i++){ | |
if(0 == $i){ | |
$data[] = mt_rand(1,20); | |
}else{ | |
$data[] = max(0, mt_rand($data[$i-1] - 1, $data[$i-1] +1)); | |
} |
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 | |
$db_conf = array( | |
array( | |
'host' => '1', | |
'port' => '', | |
'db' => '1', | |
'user' => '1', | |
'pwd' => '1', | |
), | |
array( |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'haml' | |
require 'erb' | |
require 'erubis' | |
notes = [] | |
20.times { notes << {:title => "标题标题", :content => "内容,内容"} } | |
obj = { |
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 | |
// https://github.com/fuchaoqun/colaphp/blob/2.0/Cola/Ext/GoogleAuthenticator.php | |
class Cola_Ext_GoogleAuthenticator | |
{ | |
public static $ttl = 30; | |
public static $limit = 6; | |
// Lookup needed for Base32 encoding | |
private static $map = array( |
NewerOlder