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 / .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 / 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 / gist:5451004
Last active October 24, 2017 17:10
PHP Array pluck function
<?php
/**
* Pluck an array of values from an array. (Only for PHP 5.3+)
*
* @param $array - data
* @param $key - value you want to pluck from array
*
* @return plucked array only with key data
*/
function array_pluck($array, $key) {
@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)
@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
---
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "eu-north-1",
@sobi3ch
sobi3ch / aws.setup-credencials
Created September 9, 2019 17:10
After downloading default user accessKeys.csv file from AWS console you can setup default profile with following bash function
aws.setup-credencials ()
{
FILE=$HOME/accessKeys.csv;
if test -f "$FILE"; then
echo "Reading from $FILE";
aws configure set aws_access_key_id $(tail -n1 $HOME/accessKeys.csv | cut -d, -f1);
aws configure set aws_secret_access_key $(tail -n1 $HOME/accessKeys.csv | cut -d, -f2);
else
echo "Missing $FILE";
fi