Skip to content

Instantly share code, notes, and snippets.

View evgpisarchik's full-sized avatar

Eugene Pisarchik evgpisarchik

View GitHub Profile
@evgpisarchik
evgpisarchik / gist:b87710a293cf140ae186da353a0584a7
Created March 24, 2019 18:23 — forked from murrekatt/gist:37bbd76c2b64221afd85956ff4db8026
Example Amazon S3 upload script with public write bucket
#!/bin/bash
file=$1
aws_path="/"
bucket='elblox-media'
date=$(date +"%a, %d %b %Y %T %z")
acl="x-amz-acl:public-read"
content_type='application/x-compressed-tar'
string="PUT\n\n$content_type\n$date\n$acl\n/$bucket$aws_path$file"
@evgpisarchik
evgpisarchik / .gitignore
Created March 13, 2019 16:25 — forked from x3rAx/.gitignore
Gitignore with .gitkeep
# +----------------------------+
# | IDE files |
# +----------------------------+
/.idea
# +----------------------------+
# | Vagrant |
# +----------------------------+
/.vagrant
@evgpisarchik
evgpisarchik / .bashrc
Created January 4, 2019 15:14 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@evgpisarchik
evgpisarchik / laravel-ddd-approach.md
Created December 25, 2018 14:49 — forked from ibrunotome/laravel-ddd-approach.md
A Domain Driven Design (DDD) approach to the Laravel Framework
/app
├── /Application
|  ├── /Exceptions
|  ├── /Middlewares
|  ├── /Providers
|  ├── /Requests
├── /Domain
|  ├── /MyDomainA
| | ├── /Contracts
@evgpisarchik
evgpisarchik / gist:c04c54c1c136f2c572b32c8ebd881c6c
Created August 22, 2018 17:53 — forked from Metrakit/gist:de937634346771eebe76
#1336 - Dynamic SQL is not allowed in stored function or trigger
DELIMITER |
DROP TRIGGER IF EXISTS `vote_update` |
CREATE TRIGGER `vote_update`
AFTER INSERT ON `votes`
FOR EACH ROW
BEGIN
SET @row_day = CONCAT(DAYNAME(NOW()), '_votes');
@evgpisarchik
evgpisarchik / nginx.gdb
Created June 13, 2017 08:52 — forked from LinuxJedi/nginx.gdb
GDB functions for NGINX
define ddl
set $log = ngx_cycle->log
while ($log != 0) && ($log->writer != ngx_log_memory_writer)
set $log = $log->next
end
if ($log->wdata != 0)
set $buf = (ngx_log_memory_buf_t *) $log->wdata
dump memory debug_log.txt $buf->start $buf->end
@evgpisarchik
evgpisarchik / bongo.sh
Created April 27, 2017 07:01 — forked from smashew/bongo.sh
This one works... Tested
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
-h Show this help.
-l Load instead of export
@evgpisarchik
evgpisarchik / demo.htm
Created September 6, 2016 15:43 — forked from bennadel/demo.htm
Using Underscore.js Templates To Render HTML Partials
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Looking At Underscore.js Templates</title>
</head>
<body>
<h1>
Looking At Underscore.js Templates
@evgpisarchik
evgpisarchik / var_dump.groovy
Created May 3, 2016 21:24 — forked from miceno/var_dump.groovy
var_dump in Groovy
// ReflectionToStringBuilder wraps a class and outputs a string describing
// its attributes, more or less similar to var_dump in PHP
import org.apache.commons.lang.builder.ReflectionToStringBuilder
variable= new ComplexObject()
println new ReflectionToStringBuilder( variable).toString()

In order to configure the bitbucket hook we need two things: The user's API Token and the project token. In order to retrieve the first one whe should click on our username (on the top right corner of the page), click on configure and then click on "Show API Token". This API token will be used as password for our user.

For the project's token we need to go to the job configuration (/job/{job-name}/configure), "build triggers" and enable "trigger remote builds" and, there, input some random text as token.

Once we have these two tokens we can go to bitbucket, repo administration, hooks section, and add a new jenkins hook that we will configure like:

  • Endpoint: http://{username}:{APIToken}@{hostname}/{prefix_if_you_have_one}
  • Module name: Whatever (I usually leave this one blank)
  • Project name: The job name
  • Token: The project token