Skip to content

Instantly share code, notes, and snippets.

View VicDeo's full-sized avatar
🇺🇦

Viktar Dubiniuk VicDeo

🇺🇦
View GitHub Profile
@VicDeo
VicDeo / node-exporter.sh
Last active February 8, 2024 14:11
Node exporter quick install
VERSION="1.7.0"
cd /tmp && wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-"$VERSION".linux-amd64.tar.gz
tar -xzf node_exporter-"$VERSION".linux-amd64.tar.gz && rm node_exporter-"$VERSION".linux-amd64.tar.gz
cp node_exporter-"$VERSION".linux-amd64/node_exporter /usr/local/bin/
rm -rf node_exporter-"$VERSION".linux-amd64
sudo useradd -rs /bin/false node_exporter
sudo rm -f /etc/systemd/system/node_exporter.service
sudo tee -a /etc/systemd/system/node_exporter.service > /dev/null <<EOT
// Generic
$this->server->addPlugin(
new \Sabre\DAV\PropertyStorage\Plugin(
new CustomPropertiesBackend(
$this->server->tree,
\OC::$server->getDatabaseConnection(),
\OC::$server->getUserSession()->getUser()
)
)
);
--- lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php 2017-09-26 14:23:57.523557617 +0300
+++ lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php.patched 2017-09-26 14:14:13.000000000 +0300
@@ -182,7 +182,7 @@
'length' => $length,
'unsigned' => (bool) (strpos($tableColumn['type'], 'unsigned') !== false),
'fixed' => (bool) $fixed,
- 'default' => isset($tableColumn['default']) ? $tableColumn['default'] : null,
+ 'default' => isset($tableColumn['default']) && !($tableColumn['default'] === 'NULL' && $tableColumn['null'] === 'YES') ? $tableColumn['default'] : null,
'notnull' => (bool) ($tableColumn['null'] != 'YES'),
'scale' => null,
diff -Naur updater/src/Command/PostUpgradeCleanupCommand.php updater/src/Command/PostUpgradeCleanupCommand.php
--- updater/src/Command/PostUpgradeCleanupCommand.php 2016-07-20 12:15:17.000000000 +0300
+++ updater/src/Command/PostUpgradeCleanupCommand.php 2016-10-25 14:54:44.000000000 +0300
@@ -57,6 +57,14 @@
//Cleanup Filesystem
$fsHelper->removeIfExists($locator->getExtractionBaseDir());
+ //Retrigger integrity check
+ try {
+ $this->container['utils.occrunner']->run('integrity:check-core');
diff -Naur updater/src/Command/PostUpgradeCleanupCommand.php updater/src/Command/PostUpgradeCleanupCommand.php
--- updater/src/Command/PostUpgradeCleanupCommand.php 2016-07-18 20:41:11.000000000 +0300
+++ updater/src/Command/PostUpgradeCleanupCommand.php 2016-10-25 14:48:30.000000000 +0300
@@ -57,6 +57,14 @@
//Cleanup Filesystem
$fsHelper->removeIfExists($locator->getExtractionBaseDir());
+ //Retrigger integrity check
+ try {
+ $this->container['utils.occrunner']->run('integrity:check-core');
@VicDeo
VicDeo / patch-for-updater-910-and-911.patch
Created October 18, 2016 15:29
Patch for OC updater bundled with 9.1.0 and 9.1.1
diff -Naur updater/src/Console/Application.php updater/src/Console/Application.php
--- updater/src/Console/Application.php 2016-09-19 13:05:12.000000000 +0300
+++ updater/src/Console/Application.php 2016-10-18 00:55:49.237228214 +0300
@@ -24,6 +24,7 @@
use Owncloud\Updater\Utils\DocLink;
use Owncloud\Updater\Utils\Locator;
+use Owncloud\Updater\Utils\OccRunner;
use Pimple\Container;
use Symfony\Component\Console\Logger\ConsoleLogger;

disabled off

auto (auto,auto) current 30 day period

min, auto === auto, but not less than min - current with a custom retention obligation period specified

min, max === not less than min AND not older then max

auto, max === auto, but not older than max

@VicDeo
VicDeo / preupdate.php
Created June 22, 2015 17:29
apps/files_trashbin/appinfo/preupdate.php
<?php
$installedVersion=OCP\Config::getAppValue('files_trashbin', 'installed_version');
if (version_compare($installedVersion, '0.5', '<=')) {
$connection = OC_DB::getConnection();
$platform = $connection->getDatabasePlatform();
if ($platform->getName() === 'oracle') {
try {
$connection->beginTransaction();
$sql1 = 'ALTER TABLE `*PREFIX*files_trash` ADD `auto_id` NUMBER(10) DEFAULT NULL';
@VicDeo
VicDeo / convtest.php
Last active August 29, 2015 14:03
Testing conversion
<?php
namespace OCA\Documents;
$targetFilter = 'odt:writer8';
$targetExtension = 'odt';
$input = '0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAOwADAP7/CQAGAAAAAAAAAAAAAAABAAAAKQAAAAAAAAAAEAAAAgAAAAEAAAD+////AAAAAAAAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9//////////7///8hAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAAP7///8iAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAA/v///yoAAAD+///////////////