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 | |
# | |
# The Bash shell script executes a command with a time-out. | |
# Upon time-out expiration SIGTERM (15) is sent to the process. If the signal | |
# is blocked, then the subsequent SIGKILL (9) terminates it. | |
# | |
# Based on the Bash documentation example. | |
# Hello Chet, | |
# please find attached a "little easier" :-) to comprehend |
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 (!file_exists('madeline.php')) { | |
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php'); | |
} | |
include 'madeline.php'; | |
$telegram = new \danog\MadelineProto\API('session.madeline'); | |
$telegram->start(); |
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 | |
//$retentionByMonth = [100, 20, 25, 20]; // 3 | |
$retentionByMonth = [100, 80, 75, 72, 70]; // 4 | |
//$usersByMonth = array_fill(0, 12 * 10, 4000); | |
$usersByMonth = array_fill(0, 12 * 10, 1000); | |
$fill = $retentionByMonth[count($retentionByMonth) - 1]; | |
for ($i = 0, $c = count($usersByMonth) - count($retentionByMonth); $i < $c; $i++) { | |
$retentionByMonth[] = $fill; |
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 | |
cd /test_last/ | |
if lsof -Pi :7772 -sTCP:LISTEN -t >/dev/nul; then | |
echo "Working" | |
else | |
echo "Not working.Starting..." | |
python3 bot.py | |
fi |
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 | |
# | |
# Yandex.Disk backup script v1.0 by Sergey Lukonin (neblog.info) | |
# | |
# # # # # # # # # # НАСТРОЙКИ БЕКАПА MYSQL # # # # # # # # # # | |
# Сервер БД | |
MYSQL_SERVER=mysql.some-server.ru | |
# Юзер, под которым будем делать бекап доступных баз, руту mysql обычно доступны все БД, отдельному пользователю обычно доступна БД конкретного проекта |
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 | |
# Daniel Verner | |
# CarrotPlant LLC | |
# 2011 | |
# Backup each mysql databases into a different file, rather than one big file | |
# Optionally files can be gzipped (dbname.gz) | |
# | |
# Usage: dump_all_databases [ -u username -o output_dir -z ] | |
# | |
# -u username to connect 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
# ~/.bashrc: executed by bash(1) for non-login shells. see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# unset this because of nasty OS X bug with annoying message: | |
# "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid" | |
# this is not correct, but Apple is too lazy to fix this | |
unset DYLD_LIBRARY_PATH |
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
/** | |
* simple JSONP support | |
* | |
* JSONP.get('https://api.github.com/gists/1431613', function (data) { console.log(data); }); | |
* JSONP.get('https://api.github.com/gists/1431613', {}, function (data) { console.log(data); }); | |
* | |
* gist: https://gist.github.com/gists/1431613 | |
*/ | |
var JSONP = (function (document) { | |
var requests = 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 | |
/** | |
* @description | |
* Thumbnails on the fly with cache from local and remote images | |
* | |
* Parameters: | |
* image absolute path of local image starting with "/" (e.g. /images/toast.jpg) | |
* width width of final image in pixels (e.g. 700) | |
* height height of final image in pixels (e.g. 700) | |
* nocache (optional) does not read image from the cache |
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 OpenCloud\OpenStack; | |
use League\Flysystem\Filesystem; | |
use League\Flysystem\Rackspace\RackspaceAdapter; | |
$client = new OpenStack('https://auth.selcdn.ru', [ | |
'username' => '...', | |
'password' => '...' | |
]); |
NewerOlder