2016 m. lapkričio 20 d., sekmadienis

servuko atnaujinimai

https://doc.owncloud.org/server/8.1/admin_manual/installation/php_54_installation.html
https://techjourney.net/install-and-run-multiple-and-newer-5-4-or-5-5-php-versions-in-virtualmin/
https://www.webfoobar.com/index.php/node/45

smtp 25 porto blokavimas

iptables -A INPUT -p tcp --destination-port 80 -j DROP
service iptables save

blokuojam tik incoming 25 tcp port

google drive failu nuskaitymas su php


//reikalingas service accont iš https://console.developers.google.com
$client = new Google_Client();

$credentialsFile = __DIR__ . '/googleserviceaccount.json';

if (!file_exists($credentialsFile)) {
    throw new RuntimeException('Service account credentials Not Found!');
}

$client->setAuthConfig($credentialsFile);
$client->setApplicationName("Service Account Example");
$client->setScopes(Google_Service_Drive::DRIVE);

$service = new Google_Service_Drive($client);

//glaime rodyti tik is tam tikro folderio
$files = $service->files->listFiles(array('q' => "'0B6Gt1nOByOdfsdfdsfsdZ3BqOGc' in parents"));
//failu sarasas
var_dump($files);

//failo turinys
$content = $service->files->export('13yrUsfsdfdsfsdfsdf454u_LC1eJA1mNs', 'text/html', array(
  'alt' => 'media' ));

var_dump($content->getBody()->read(1024));

google drive failu nuskaitymas su php


//reikalingas service accont iš https://console.developers.google.com
$client = new Google_Client();

$credentialsFile = __DIR__ . '/googleserviceaccount.json';

if (!file_exists($credentialsFile)) {
    throw new RuntimeException('Service account credentials Not Found!');
}

$client->setAuthConfig($credentialsFile);
$client->setApplicationName("Service Account Example");
$client->setScopes(Google_Service_Drive::DRIVE);

$service = new Google_Service_Drive($client);

//glaime rodyti tik is tam tikro folderio
$files = $service->files->listFiles(array('q' => "'0B6Gt1nOByOdfsdfdsfsdZ3BqOGc' in parents"));
//failu sarasas
var_dump($files);

//failo turinys
$content = $service->files->export('13yrUsfsdfdsfsdfsdf454u_LC1eJA1mNs', 'text/html', array(
  'alt' => 'media' ));

var_dump($content->getBody()->read(1024));

2016 m. lapkričio 13 d., sekmadienis

Eshop

El. parduotuvės privalės skelbti specialios svetainės adresą, kurios pagalba vartotojai ginčus su pardavėjais gali išspręsti be teismo. To nepadariusios parduotuvės bus baudžiamos. https://webgate.ec.europa.eu/odr/main/index.cfm?event=main.home.show&lng=LT

2016 m. spalio 20 d., ketvirtadienis

MySQL partitioning by column

ALTER TABLE `products` DROP PRIMARY KEY , ADD PRIMARY KEY ( `id` , `category` );
ALTER TABLE `products` PARTITION BY KEY(category) PARTITIONS 6;