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
/****** | |
UPDATE [db_name].[db_prefix].[table_name] SET column_name = REPLACE(column_name, 'Old_Field_Part', 'New_Field_Part'); | |
Example: | |
******/ | |
UPDATE [test].[dbo].[VRD_CarSaleContractFilePathNew] SET VRD_ContractFilePath = REPLACE(VRD_ContractFilePath, 'C:\VERDI\Договоры по сделкам\', '\\verdi.ru00185v01.vw-group.ru\Verdi\Договоры по сделкам\'); |
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
#!/bin/bash | |
# Название файла со списком адресов | |
inputfile="hosts.txt" | |
# Имя файла для осуществления вывода | |
outputfile="addresses.txt" | |
# Очистка файла вывода при необходимости | |
> ${outputfile} | |
# Выполнить nslookup для каждой записи из файла со списком адресов | |
for i in `cat ${inputfile}`; do nslookup $i >> ${outputfile}; done | |
# Из файла вывода показать в stdout только строки, содержащие слова "Name" и "Address", т.е. DNS-server, FQDN, IP-address |
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
$.pjax.reload({container:'#idofyourpjaxwidget'}) |
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 | |
$formatter = new \yii\i18n\Formatter; | |
$formatter->dateFormat = 'php:Y-m-d'; | |
$formatter->timeZone = 'UTC'; | |
echo $formatter->asDate('NOW'); | |
?> |
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; |
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
# Export to file (Full Database or custom tables) data only | |
mysqldump -u[username] -p[password] --no-create-info [dbname] [table_n1, ... , table_n] > [filename].sql | |
# Export to file (Full Database or custom tables) structure only | |
mysqldump -u [username] -p[password] --no-data [dbname] [table_n1, ... , table_n] > [filename].sql | |
# To import to database from file | |
mysql -u [username] -p[password] [dbname] < [filename].sql |
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 (Yii::$app->user->can('root')) { | |
echo 'Hello, Root!'; | |
} | |
elseif (Yii::$app->user->can('admin')) { | |
echo 'Hello, Admin!'; | |
} | |
elseif (Yii::$app->user->can('head')) { | |
echo 'Hello, Head!'; |
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> |