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 | |
W=800 | |
H=354 | |
PERIOD=5 | |
function ff() { | |
ffmpeg -i "$1.jpg" -vf zoompan=z=1:d=8:s=${W}x${H}:fps=2,framerate=30 -c:v mpeg4 -y -pix_fmt yuv420p "slide_${1}.mp4" | |
ffmpeg -i "slide_${1}.mp4" -y -vf fade=in:0:30 "slide_fade_in_${1}.mp4" |
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 | |
/** Выводит / возвращает Dump SQL запроса Bitrix D7 и старого ядра */ | |
if( !function_exists('_dumpSQL') ){ | |
function _dumpSQL(callable $callback, array $params = []) | |
{ | |
$result = []; | |
if($params['user'] == 'all' || $GLOBALS['USER']-> isAdmin() ){ |
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
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
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 | |
use Bitrix\Main\Application; | |
$connection = Application::getConnection(); | |
$sqlHelper = $connection->getSqlHelper(); | |
$sql = "SELECT ID FROM b_user WHERE LOGIN = '".$sqlHelper->forSql($login, 50)."'"; | |
//$connection->query($sql, $limit); | |
//$connection->query($sql, $offset, $limit); |
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 | |
/* | |
* Iteration and Recursive Iteration Examples Code | |
* | |
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php | |
* @author hakre <http://hakre.wordpress.com> | |
*/ | |
### To have these examples to work, a directory with subdirectories is needed, | |
### I named mine "tree": |
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
function scriptLoader() { | |
/** | |
* Promise-based script loader | |
* @param {string} url | |
* @param {object=} attr | |
* @returns {Promise} | |
*/ | |
const loader = (url, attr) => new Promise((resolve, reject) => { | |
const script = window.document.createElement('script'); | |
script.src = url; |
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 stack | |
-- stack --resolver lts-15.10 script | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
import RIO | |
import Network.HTTP.Simple | |
import qualified RIO.Text as T | |
main :: IO () | |
main = runSimpleApp $ do |
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
# backup | |
innobackupex --stream=xbstream --parallel=4 --compress --compress-threads=2 /var/lib/mysql > /root/backup/backup.xbstream | |
# restore | |
xbstream -x < /root/backup/backup.xbstream | |
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm | |
yum install qpress | |
for i in $(find -name "*.qp"); do qpress -vd $i $(dirname ${i}) && rm -f $i; done | |
innobackupex --apply-log ./ | |
service mysql stop |
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 bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-09 | |
# | |
# _______________| netspeed : check download speed via command line. | |
# | |
# Usage: netspeed [tokyo, london, usw, use, east, westm, rbx, sbg, bhs URL] | |
# Default server is RBX FR. | |
# First try it out without any arguments. | |
# |
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 bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-09 | |
# | |
# _______________| netspeed : check download speed via command line. | |
# | |
# Usage: netspeed [tokyo, london, usw, use, east, west, URL] | |
# ^default U.S. west coast. | |
# [ -speed_KB/sec ] | |
# ^negation activates the Mbps converter. | |
# |
NewerOlder