Skip to content

Instantly share code, notes, and snippets.

View pdaw's full-sized avatar
🏠
Working from home

Piotr Dawidiuk pdaw

🏠
Working from home
View GitHub Profile
@pdaw
pdaw / clone_redis.py
Created July 18, 2018 19:56 — forked from jimmyislive/clone_redis.py
Redis Elasticache Export
from optparse import OptionParser
import sys
import redis
__author__ = 'Jimmy John'
__doc__ = '''
This is a script to make a copy of a redis db. Mainly to be used for cloning AWS Elasticache
instancces. Elasticache seems to disable the SAVE/BGSAVE commands and you do not have access to
the physical redis instances. The UI allows you to create 'Snapshots', but no way to download

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@pdaw
pdaw / .vimrc
Created October 26, 2017 08:02
Vim starter
syntax on
set number
set tabstop=4 shiftwidth=4 expandtab
@pdaw
pdaw / sqlite3_to_mysql.sh
Created July 7, 2017 08:29
SQLite3 to MySQL
sqlite3 DATABASE.sqlite3 .dump > sqlite3.sql
# script from https://github.com/athlite/sqlite3-to-mysql
./sqlite3-to-mysql sqlite3.sql > mysql.sql
@pdaw
pdaw / jenkins_hitting_url.sh
Last active July 5, 2017 07:33
Jenkins - hitting URL
response=$(curl --write-out %{http_code} --silent --output /dev/null $URL)
if [ $response = "200" ]; then
exit 0
else
exit 1
fi
@pdaw
pdaw / removal.sh
Created June 1, 2017 07:36
Removal of already merged branches
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <[email protected]>
# Adapted from the original by Yorick Sijsling
# https://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github
git config --global credential.helper wincred
git checkout master &> /dev/null
@pdaw
pdaw / developing_jenkins.sh
Last active May 31, 2017 20:02
Developing Jenkins plugins
# reference: https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
# more: https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins
# hpi:run plugin: https://jenkinsci.github.io/maven-hpi-plugin/run-mojo.html
mvn hpi:run -Djava.awt.headless=true -Djetty.port=9000
# https://stackoverflow.com/questions/8023126/how-can-i-test-https-connections-with-django-as-easily-as-i-can-non-https-connec
HTTPS=1 mvn hpi:run -Djava.awt.headless=true -Djetty.port=9000
@pdaw
pdaw / downloading_file_via_ssh.sh
Created May 2, 2017 12:12
Downloading file via ssh
# reference: http://stackoverflow.com/questions/9427553/how-to-download-a-file-from-server-using-ssh
ssh host 'cat /path/on/remote' > /path/on/local
@pdaw
pdaw / docker_tricks.sh
Created April 28, 2017 20:01
Docker tricks
# getting host (http://stackoverflow.com/questions/17157721/getting-a-docker-containers-ip-address-from-the-host)
docker inspect --format '{{ .NetworkSettings.IPAddress }}' container_name_or_id
@pdaw
pdaw / checking_out.sh
Created April 13, 2017 09:31
Simple deployment with checking out git's tag
git reset --hard && git fetch --all --tags --prune && git checkout tags/$TAG