Skip to content

Instantly share code, notes, and snippets.

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@akkida746
akkida746 / WsFilter.java
Created October 18, 2016 11:23
Configure Spring autowire in java Filter
public class WsFilter implements Filter {
private ApplicationContextProvider springContext;
private FilterConfig filterConfig;
private MessageFactory msgFactory = null;
private static final Logger logger_ = Logger.getLogger(WsFilter.class.getName());
private static final Logger soap_logger = Logger.getLogger("soapLogger");
@Autowired
private WsFilterHelper helper;
@ckandoth
ckandoth / build_python_2_7.txt
Created November 29, 2016 22:12
Download, install, and build Python 2.7.10 in a local folder
# Create a folder where you want to install different Pythons, and cd into it:
# Note that it doesn't need to be your home folder. Put it wherever you want to maintain such software:
export PYTHON_BASE="$HOME/python"
mkdir -p $PYTHON_BASE
cd $PYTHON_BASE
# Download source tarball into a subfolder named src, and untar:
curl --create-dirs -L -o src/Python-2.7.10.tgz https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
cd src
tar -zxf Python-2.7.10.tgz
@marcgeld
marcgeld / psRandomAlphaNumeric.ps1
Created April 5, 2017 13:05
Powershell: Generate a random Alphanumeric string
# Generate a random Alphanumeric string
Function Get-RandomAlphanumericString {
[CmdletBinding()]
Param (
[int] $length = 8
)
Begin{
@JBlond
JBlond / bash-colors.md
Last active May 17, 2024 08:00 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@rizo
rizo / Dockerfile
Last active January 19, 2023 20:14
Alpine (3.6) based docker image with Protocol Buffers compiler supporting Go.
# Protobuf Builder
# ================
#
# This image builds protocol buffers library from source with Go generation
# support. The builder and runner images are produced.
# Builder Image
# -------------
FROM golang:1.8.3-alpine3.6 as builder
@steven2358
steven2358 / ffmpeg.md
Last active May 10, 2024 20:57
FFmpeg cheat sheet
@mykubicle
mykubicle / docker_mint_xenial_install.sh
Last active March 14, 2024 23:23
Get Docker CE for Linux Mint based on Ubuntu Xenial
#!/bin/bash
# Uninstall old version
sudo apt-get remove docker docker-engine docker.io
# Update apt package index
sudo apt-get update
# Install packages to allow apt to use a repo over HTTPS
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# Add Docker offical GPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@fnky
fnky / ANSI.md
Last active May 18, 2024 17:55
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@egoarka
egoarka / eba.sh
Created November 30, 2018 13:38
JS alike destructuring assignment for bash
echo "33:34" | awk -F':' '{ print $1, $2 }' | read a b <<< (cat)
read c d <<< $(echo "21:22" | awk -F':' '{ print $1, $2 }')