Skip to content

Instantly share code, notes, and snippets.

View SerjRamone's full-sized avatar
🤖

Sergey SerjRamone

🤖
View GitHub Profile
@SerjRamone
SerjRamone / gist:2ec3f4a63d675f25c08531dab1f0767c
Last active November 1, 2022 20:27
Create Windows 10 Bootable USB on Mac
# find yours usb drive in list. f.e. it was /dev/disk2 for me
diskutil list
# format your disk to Windows FAT32 format
sudo diskutil eraseDisk FAT32 "WIN10" MBRFormat /dev/disk2
# open Finder and mount the Windows 10 ISO by doble click ISO file
# list /Volumes folder and find mounted folder. For me it was /Volumes/CCCOMA_X64FRE_RU-RU_DV9
# copy small files by rsync
@SerjRamone
SerjRamone / clean-up-boot-partition-ubuntu.md
Created May 27, 2020 08:41 — forked from z010107/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@SerjRamone
SerjRamone / xml_downloader.php
Created July 22, 2013 05:51
Для консольных скриптов
$_SERVER["DOCUMENT_ROOT"] = '/home/bitrix/www';
define("NO_KEEP_STATISTIC", true);
define("NO_AGENT_STATISTIC","Y");
define("NO_AGENT_CHECK", true);
define("DisableEventsCheck", true);
define("NOT_CHECK_PERMISSIONS",true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
@SerjRamone
SerjRamone / component.php
Created July 12, 2013 11:32
Битрикс: Экспорт в Excel
if ($bExcel)
{
$APPLICATION->RestartBuffer();
// hack. any '.default' customized template should contain 'excel' page
$this->__templateName = '.default';
Header("Content-Type: application/force-download");
Header("Content-Type: application/octet-stream");
Header("Content-Type: application/download");
@SerjRamone
SerjRamone / component.php
Created July 11, 2013 08:54
Bitrix caching
<?
/*+ Начало вывода данных +*/
$arResult = array();
/*+ Здесь будем кешировать данные +*/
$cache = new CPHPCache();
$cache_time = $arParams["CACHE_TIME"];
$cache_id = md5('userTagsKey');
$cache_path = '/userTags/';
@SerjRamone
SerjRamone / support.php
Created July 9, 2013 05:54
Сache Dependencies (тегированный кеш)
<?
$cache_id = md5(serialize($arParams));
$cache_dir = "/tagged_getlist";
$obCache = new CPHPCache;
if($obCache->InitCache(36000, $cache_id, $cache_dir)) {
$arElements = $obCache->GetVars();
}
elseif(CModule::IncludeModule("iblock") && $obCache->StartDataCache()) {
$arElements = array();