This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| /****** | |
| SELECT * INTO [db_name].[db_prefix].[new_table_name] FROM [db_name].[db_prefix].[old_table_name] | |
| Example: | |
| ******/ | |
| SELECT * INTO [test].[dbo].[VRD_CarSaleContractFilePathNew] FROM [test].[dbo].[VRD_CarSaleContractFilePath] |
This file contains hidden or 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
| # SSH-session | |
| # Install Composer to /bin directory | |
| php -r "readfile('https://getcomposer.org/installer');" | php -- --filename=composer --install-dir=/bin | |
| # Install composer plugin to work with Bower | |
| composer global require "fxp/composer-asset-plugin:~1.0.0" | |
| // Go to www-folder | |
| cd /www-folder |
This file contains hidden or 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
| <!-- From Menu | |
| In layouts/main.php to section "url" of "items" add: --> | |
| <?php | |
| 'url'=>array(''.Yii::app()->request->requestUri.'#id_div' | |
| ?> |
This file contains hidden or 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 | |
| $this->widget('bootstrap.widgets.TbButton', array( | |
| 'label'=>'<ButtonName>', | |
| 'type'=>'ButtonType', | |
| 'buttonType'=>'ajaxButton', | |
| 'encodeLabel'=>true, | |
| 'url'=>Yii::app()->createUrl('/<module>/<controller>/<action>'), | |
| 'ajaxOptions'=>array( | |
| // Method - POST (for $_POST requests) or GET (for $_GET requests) |
This file contains hidden or 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 | |
| // There and next: | |
| // ids - the id's of GridView's checkbox column | |
| // <grid-id> - the id's of GridView | |
| // View code | |
| $this->widget('bootstrap.widgets.TbButton', array( | |
| 'label'=>'Удалить', | |
| 'type'=>'danger', |
This file contains hidden or 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 | |
| // Used TbGridView, if Bootstrap extension isn't used - use CGridview | |
| // <grid-id> - id of grid (must be changed) | |
| $this->widget('bootstrap.widgets.TbGridView',array( | |
| 'id'=>'<grid-id>', | |
| 'dataProvider'=>$model->search(), | |
| 'filter'=>$model, | |
| 'columns'=>array( | |
| // number rows | |
| array( |