Skip to content

Instantly share code, notes, and snippets.

@gebi84
gebi84 / db_importer_exporter.sh
Last active November 23, 2020 11:35
program to import|export a database faster by using csv files
#!/bin/bash
#title :program to import|export a database faster by using tsv files
#description :This script will generate a .tsv file for all data and a .sql file for the structure of each table from MySQL database.
#author :Gebhard Nigsch
#date :02/11/2020
#version :1.0
#requires: :mysql, mysqlimport --secure-file-priv=""
#based on: :https://www.percona.com/blog/2018/02/22/restore-mysql-logical-backup-maximum-speed/
USAGE="$(basename "$0") [-h] [-u -p -l -f -v -z] [import|export] databaseName -- program to import|export a database faster by using csv files
@gebi84
gebi84 / install.txt
Last active August 13, 2024 03:05
install php 7.4 and composer on ubuntu 18.04
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,sqlite,soap,imagick,curl,json,xml}
sudo apt install curl php-cli php-mbstring git unzip
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo add-apt-repository ‘deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse’
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install -y libapache2-mod-php7.3 php7.3-cli php7.3-common php7.3-mbstring php7.3-gd php-imagick php7.3-intl php7.3-bz2 php7.3-xml php7.3-mysql php7.3-zip php7.3-dev php7.3-curl php7.3-fpm php-dompdf php-apcu redis-server php-redis php-smbclient php7.3-ldap unzip nano python-certbot-apache certbot wget curl
sudo apt-get update
sudo apt update
sudo update-alternatives --set php /usr/bin/php7.3
sudo systemctl restart apache2
@gebi84
gebi84 / mysql.conf
Last active June 18, 2019 09:03
debug environemnt xdebug and mysql
#http://www.serhatdundar.com/blog/import-huge-databases-faster-in-mysql
innodb_buffer_pool_size = 12G
# 60% - 70% of your RAM size
innodb_log_buffer_size = 16M
# 16M or 32M is fine
innodb_log_file_size = 3G
# 25% of buffer pool size
innodb_write_io_threads = 32
# 32 is fine, 64 is maximum
innodb_flush_log_at_trx_commit = 0
@gebi84
gebi84 / Curl.php
Created May 18, 2018 13:36
Guave\Curl -> a simple Curl Class
<?php
namespace Guave\Curl;
class Curl {
const METHOD_POST = 'POST';
const METHOD_GET = 'GET';
const METHOD_PUT = 'PUT';
const METHOD_DELETE = 'DELETE';
<?php
define('TL_SCRIPT', 'index.php');
require_once '../system/initialize.php';
/**
* @var $objNotification NotificationCenter\Model\Notification
*/
$objNotification = \NotificationCenter\Model\Notification::findOneById(4);
@gebi84
gebi84 / postupload.php
Created August 15, 2016 11:26
contao postupload, recreate intern cache and check if db update is required
<?php
include_once __DIR__.'/../system/initialize.php';
class Postuplaod extends Database\Installer
{
private static $instance = null;
public function __construct()
@gebi84
gebi84 / comments-dragonlfy-futurefon.php
Last active August 29, 2015 14:09
display all comments from a www.indiegogo.com campaign
<?php
$file = 'cache.txt';
$time = filemtime($file);
if(time() > $time+300) {
$cache = false;
$url = 'https://www.indiegogo.com/projects/the-dragonfly-futurefon--3/show_tab/comments?count=9999';