Skip to content

Instantly share code, notes, and snippets.

View sobi3ch's full-sized avatar
🎯
Focusing

Piotr Sobieszczański sobi3ch

🎯
Focusing
View GitHub Profile
sudo phpbrew install 5.4.45 \
+default \
+mysql \
+hash \
+iconv \
+gd \
+apxs2=/usr/bin/apxs -- \
--with-gd \
--enable-gd-natf \
--with-jpeg-dir \
@sobi3ch
sobi3ch / filed_types_D8_output.txt
Created January 12, 2016 10:38
Drupal 8 filed types with descriptions
Label: Comments
Machine name: comment
Descritpion: This field manages configuration and presentation of comments on an entity.
Provider: comment
---
Label: Date
Machine name: datetime
Descritpion: Create and store date values.
Provider: datetime
---
@sobi3ch
sobi3ch / .bash_aliases_common.sh
Last active July 28, 2017 06:18
Add this to your linux aliases file definition and use dots instead 'cd' command itself.
# This script production following aliases.
#
# alias ..='cd ../'
# alias ...='cd ../../'
# alias ....='cd ../../../'
# alias .....='cd ../../../../'
# alias ......='cd ../../../../../'
# alias .......='cd ../../../../../../'
# alias ........='cd ../../../../../../../'
# alias .........='cd ../../../../../../../../'
@sobi3ch
sobi3ch / backup.sh
Created July 6, 2015 21:27
One line drush DB backup without cashe tables (defined in drushrc.php "common" in this example)
#!/bin/bash
drush -y sql-dump --structure-tables-key=common --gzip --result-file=path/based/on/drupal/root/to/your/backup.sql
@sobi3ch
sobi3ch / gist:8c74fe7531000e4b4d9c
Created July 2, 2015 12:14
Drush import .sql.gz with progress bar
# Make sure you have pv and zcat already installed
pv my_database.sql.gz | zcat | drush sqlc
# Example output:
# 433kB 0:00:00 [ 658kB/s] [============================================================================================>] 100%
@sobi3ch
sobi3ch / docker-ip.sh
Created May 29, 2015 13:02
docker-ip
#!/bin/sh
# Get IP address from latest docker instance
exec docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@"
@sobi3ch
sobi3ch / GFS-mysql-backup.sh
Last active July 28, 2017 06:27
The Father, the Son and the Grandfather: A Basic Backup Strategy
#!/bin/sh
# Created by: Alex Saavedra
# Date created: 2011-05-11
# Last modified: 2010-05-11
# Purpose: ProcessMaker backup.
# Change log:
# Syntax:
# backup.sh <periodicity> <period>
# Parameters:
# <periodicity> = weekly, monthly, yearly
@sobi3ch
sobi3ch / polon.php
Created March 27, 2015 11:49
Polish radiostations from linux CLI / Polskie radiostacje z linii poleceń
<?php
define('INDENT', ' ');
// Radio list
$radiostations = [
'trojka' => 'mms://stream.polskieradio.pl/program3_wma10',
'dwojka' => 'mms://stream.polskieradio.pl/program2_wma10',
'jedynka' => 'mms://stream.polskieradio.pl/program1_wma10',
'luz' => 'http://radioluz.pwr.wroc.pl/listen.pls',
@sobi3ch
sobi3ch / login.sh
Created February 2, 2015 13:57
Login to Drupal via https
#!/bin/bash
# Obviously change name and pass values and example.com domain
curl --insecure \
--cookie ./cookie.txt \
--cookie-jar ./cookie.txt \
-e example.com \
-d "name=admin" \
-d "pass=admin" \
-d "form_id=user_login" \
https://example.com/user
@sobi3ch
sobi3ch / behat.yml
Created April 16, 2014 12:39
How integreate 'selectors' with Behat (regon_map is requreid to work with selectors)
default:
paths:
features: 'features'
extensions:
Behat\MinkExtension\Extension:
goutte: ~
selenium2: ~
base_url: https://production.server/
Drupal\DrupalExtension\Extension:
blackbox: ~