Skip to content

Instantly share code, notes, and snippets.

View stefgosselin's full-sized avatar

Stephane Gosselin stefgosselin

  • Saint-Eugène-De-Guiges
View GitHub Profile
@iridiumcao
iridiumcao / check_git_branch_exists.sh
Created March 22, 2020 13:57
How to check if a git branch exists in the local/remote repository?
# Local:
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists
# test if the branch is in the local repository.
# return 1 if the branch exists in the local, or 0 if not.
function is_in_local() {
local branch=${1}
local existed_in_local=$(git branch --list ${branch})
if [[ -z ${existed_in_local} ]]; then
echo 0
@admiral0
admiral0 / Jenkinsfile
Created April 22, 2017 16:00
Jenkinsfile for building LEDE
pipeline {
agent any
stages {
stage("SCM Update"){
steps {
sh "git remote add lede git://git.lede-project.org/source.git || true"
sh "git fetch lede"
sh "git branch -D build"
sh "git checkout -b build"
@ckabalan
ckabalan / best_bash_history.sh
Last active July 16, 2024 15:11
The Best Bash History Settings Ever
# /etc/profile.d/best_bash_history.sh
# Save 5,000 lines of history in memory
HISTSIZE=10000
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
HISTFILESIZE=2000000
# Append to history instead of overwrite
shopt -s histappend
# Ignore redundant or space commands
HISTCONTROL=ignoreboth
# Ignore more
@rpau
rpau / Jenkinsfile
Last active May 4, 2017 16:25
Jenkinsfile fragment for walkmod
#!groovy
@Library('github.com/walkmod/jenkins-pipeline-shared@maven') _
pipeline {
agent any
stages {
stage ('Fixing Release'){
steps {
walkmodApply(
@abayer
abayer / Jenkinsfile
Created February 15, 2017 15:17
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@abtris
abtris / 02-Jenkinsfile
Last active July 17, 2019 04:34
Jenkinsfile - imperative style vs declarative style
pipeline {
agent any
environment {
PACKAGE="github.com/abtris/bee"
GOPATH="/Users/abtris/go"
GOROOT="/usr/local/opt/go/libexec"
}
stages {
stage('Preparation') {
steps {
@wahyudibo
wahyudibo / default.conf
Last active April 25, 2020 23:13
Install nginx, php 70 (with fpm), and mysql in Mac OS X
server {
listen 80;
server_name localhost;
root /Users/wahyudibo/Projects/mylabs/php/nginx;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active July 11, 2024 15:06
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@shark0der
shark0der / setup_mailcatcher.sh
Last active January 22, 2022 16:28 — forked from conroyp/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
gem install mailcatcher --no-ri --no-rdoc
@otarza
otarza / install_drupal_env.sh
Created May 27, 2015 12:46
Drupal Environment
#!/usr/bin/env bash
# Use single quotes instead of double quotes to make it work with special-character passwords
PASSWORD='12345678'
PROJECTFOLDER='gdson'
# create project folder
sudo mkdir "/sites/${PROJECTFOLDER}"
# update / upgrade