Skip to content

Instantly share code, notes, and snippets.

View sobi3ch's full-sized avatar
🎯
Focusing

Piotr Sobieszczański sobi3ch

🎯
Focusing
View GitHub Profile
@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 / 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 / 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 / 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 / .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 / 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
---
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 / google-chrome.desktop
Created November 10, 2017 18:40
Fix chrome unity launcher in Ubutu
#Exec=/usr/bin/google-chrome-stable %U
Exec=/opt/google/chrome/chrome %U
@sobi3ch
sobi3ch / jenkins_config.groovy
Created July 11, 2018 09:07
Jenkins groovy configuration
def projects = [:];
projects['first-repo'] = [
name: 'First multibranch pipeline',
repo: 'repo-first'
]
projects['second-repo'] = [
name: 'Second multibranch pipeline',
repo: 'repo-second'
@sobi3ch
sobi3ch / gist:74051b3e33967d2dd9dc7853bfb0799d
Created July 11, 2018 12:45
Scan Multibranch Pipeline Log
Started by user Piotr Sobieszczański
[Wed Jul 11 12:43:22 UTC 2018] Starting branch indexing...
ERROR: [Wed Jul 11 12:43:23 UTC 2018] Could not fetch branches from source 7aceea81-226f-4094-a96c-fbb8773cc981
java.lang.ClassCastException: jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl cannot be cast to jenkins.scm.api.trait.SCMSourceTrait
at jenkins.scm.api.trait.SCMSourceContext.withTraits(SCMSourceContext.java:245)
at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:534)
at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:357)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:267)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633)