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 | |
#FILE="/home/user/scripts/motd" | |
FILE="/etc/motd" | |
INSTDATE=$(date +%F) | |
HOSTNAME=$(hostname) | |
OSRELASE=$(cat /etc/*release | head -1) | |
#OSDETECT="i-have-to-define" | |
#IPADDRES=$(ifconfig eth0 | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | head -1) | |
ETHERADD=$(ifconfig |grep -e ^[a-z] |grep -v lo | awk '{ printf $1 FS}') |
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
add-vpnconnection -name "<Name_of_VPN_connection>" -serveraddress "<hostname_or_ip_address>" -splittunneling -tunneltype "l2tp" | |
# Where: | |
# splittunneling - use Gateway at Remote Network | |
# tunneltype - type of VPN-connection (pptp or l2tp) |
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 Preview Image from Youtube video link (not from embeded code) and download it if video exist | |
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com> | |
* @version 1.0* | |
* @uses | |
* | |
* $getThumbs = new YoutubeThumbs('https://youtu.be/xxxxxxxxxxx', 'quality', 'directory'); | |
* echo '<img src="'.$getThumbs->getThumbnail().'"/>'; |
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 | |
namespace common\widgets; | |
/** | |
* Crop fill or fit image with php-gd library | |
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com> | |
* @version 1.0* | |
* @uses, @example | |
* @license GPL |
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 | |
/** | |
* | |
*/ | |
class StringOperations | |
{ | |
public function Transliterate($str) { | |
$translit=array( | |
"А"=>"a","Б"=>"b","В"=>"v","Г"=>"g","Д"=>"d","Е"=>"e","Ё"=>"e","Ж"=>"zh","З"=>"z","И"=>"i","Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n","О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t","У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"ts","Ч"=>"ch","Ш"=>"sh","Щ"=>"shch","Ъ"=>"","Ы"=>"y","Ь"=>"","Э"=>"e","Ю"=>"yu","Я"=>"ya", |
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
// included script. For example js/gridViewProceedCheckBoxes.js | |
/** | |
* [proceedCheckBoxes description] | |
* @param {[type]} btnID [id of button] | |
* @param {[type]} gridID [id of GridView] | |
* @param {[type]} pjaxID [id of pjax-container] | |
* @param {[type]} emptyAlertText [text for alert "Nothing Checked"] | |
* @param {[type]} confirmAlertText [text for confirmation alert] | |
* @param {[type]} proceedURL [controller action ro proceed] |
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 Image from Google Maps API by place coordinates and download it. | |
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com> | |
* @version 1.0* | |
* @uses | |
* | |
* $map = new GoogleMaps( | |
* 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
# <arg> - argument (r/s): r - for restart, s - for shutdown | |
# <time> - time in seconds | |
# <ws> - ip-address, hostname or fqdn | |
shutdown -<arg> -f -t <time> -m \\<ws> |
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 | |
echo Yii::$app->controller->id; | |
echo Yii::$app->controller->action->id; | |
echo Yii::$app->controller->module->id; |
NewerOlder