Skip to content

Instantly share code, notes, and snippets.

Rada Bogdan bogdanRada

Block or report user

Report or block bogdanRada

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bogdanRada
bogdanRada / Dockerfile
Created Jul 31, 2019 — forked from fishi0x01/Dockerfile
Jenkins Pipeline as Code. Code for blog post http://fishi.devtail.io/weblog/E/
View Dockerfile
FROM tomcat:8.0.38
# Place the code version inside the webapps directory
ARG PACKAGE_VERSION
RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt
COPY project.war /usr/local/tomcat/webapps/project.war
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
View Jenkinsfile
stage 'Test'
// Split the previously executed tests into 10 jobs
def splits = splitTests parallelism: [$class: 'CountDrivenParallelism', size: 10], generateInclusions: true
def branches = [:]
// Prepare each job
for (int i = 0; i < splits.size(); i++) {
def split = splits[i]
branches["split${i}"] = {
// The job should allocate a new jenkins slave
node('dockerSlave') {
@bogdanRada
bogdanRada / linux-cheatsheet.rtf
Created Jul 31, 2019 — forked from vadirajks/linux-cheatsheet.rtf
Comprehensive Linux Cheatsheet
View linux-cheatsheet.rtf
```
____ _ _
/ ___|___ _ __ ___ _ __ _ __ ___| |__ ___ _ __ ___(_)_ _____
| | / _ \| '_ ` _ \| '_ \| '__/ _ \ '_ \ / _ \ '_ \/ __| \ \ / / _ \
| |__| (_) | | | | | | |_) | | | __/ | | | __/ | | \__ \ |\ V / __/
\____\___/|_| |_| |_| .__/|_| \___|_| |_|\___|_| |_|___/_| \_/ \___|
|_|
_ _ ____ _ _ _ _
| | (_)_ __ _ ___ __ / ___| |__ ___ __ _| |_ ___| |__ ___ ___| |_
| | | | '_ \| | | \ \/ / | | | '_ \ / _ \/ _` | __/ __| '_ \ / _ \/ _ \ __|
View The Ultimate Bad Ass .bashrc File
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
View bash aliases
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias edit='idea' # edit: Opens any file in sublime editor
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias o=f
alias lista="list_aliases"
alias showa="list_aliases"
alias qfind="find . -name " # qfind: Quickly search for file
alias memHogsTop='top -l 1 -o rsize | head -20'
alias memHogsPs='ps wwaxm -o pid,stat,vsize,rss,time,command | head -10'
alias cpu_hogs='ps wwaxr -o pid,stat,%cpu,time,command | head -10'
@bogdanRada
bogdanRada / bash_profile
Created Jul 31, 2019 — forked from marweck/bash_profile
My .bash_profile or .bashrc
View bash_profile
# bash_profile
#############################################
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
export PS1="$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(__git_ps1)$BLACK ] "
export CLICOLOR=1
View .bash_profile
#colorized man pages
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
@bogdanRada
bogdanRada / proxy.rb
Created Jun 24, 2019 — forked from tomlea/proxy.rb
Rack Middleware to proxy requests to a remote server. This is usefull for proxying AJAX request to remote services.
View proxy.rb
require "net/http"
require "enumerator"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
@bogdanRada
bogdanRada / pre-commit
Created Apr 30, 2019 — forked from aaronhoffman/pre-commit
git hooks - prevent commit to local master branch and prevent push to remote master branch
View pre-commit
#!/bin/sh
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
fi
exit 0
View custom-date-step-by-month.rb
class Date
def step_by_month(to_date, step=1)
date = self
op = %w(- <= >=)[step <=> 0]
while date.__send__(op, to_date)
yield(date)
date >>= step
end
end
end
You can’t perform that action at this time.