Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
bogdanRada / install.sh
Last active July 6, 2017 07:05 — forked from moondev/install.sh
dynamic-screenshots-on-the-server-with-phantomjs - install.sh
sudo apt-get install xvfb git build-essential gtk2-engines-pixbuf xfonts-100dpi x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
sudo apt-get install libqt4-dev libqtwebkit-dev qt4-qmake python-qt4
@bogdanRada
bogdanRada / haproxy.cfg
Created June 20, 2017 13:50 — forked from jbq/haproxy.cfg
Haproxy SSL reverse proxy configuration for Docker registry
global
log 127.0.0.1 local0 debug
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
defaults
log global
@bogdanRada
bogdanRada / install-docker-compose.sh
Last active August 7, 2018 00:36 — forked from lmakarov/install-docker-compose.sh
Install docker-compose in boot2docker 1.7.0+
Installation for VirtualBox:
docker-machine ssh <machine-name> < install-docker-compose.sh
Run docker-compose from the host:
docker-machine ssh <machine> -- docker-compose --version
Check that docker-compose is available after a reboot:
docker-machine reboot <machine>
docker-machine ssh <machine> -- docker-compose --version
@bogdanRada
bogdanRada / flatten.py
Created June 7, 2017 07:32
to flatten dhrp/sshd : sudo python flatten.py 2bbfe079a94259b229ae66962d9d06b97fcdce7a5449775ef738bb619ff8ce73 it'll produce a 42422bbfe079a94259b229ae66962d9d06b97fcdce7a5449775ef738bb619ff8ce73 image
import os
from StringIO import StringIO
import json
import sys
import subprocess
import shutil
def getParent(rootid, id):
print "--> ", id
@bogdanRada
bogdanRada / machine-diskutil.sh
Created June 2, 2017 12:12 — forked from cristobal/machine-diskutil.sh
Machine Diskutil to mount/unmont external volumes inside docker machines running on Virtualbox
#!/usr/bin/env sh
# @see http://stackoverflow.com/questions/30040708/how-to-mount-local-volumes-in-docker-machine
# @see https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md
################################################################################
# Dependency Section #
# #
################################################################################
check_deps() {
## Make sure commands are available
@bogdanRada
bogdanRada / setup_android_studio.sh
Created May 26, 2017 11:14 — forked from bmc08gt/setup_android_studio.sh
Android Studio bash installation script
#!/bin/bash
# only works atm if only one jdk package in downloads
DOWNLOADS=$HOME/Downloads
CURRENT_VERSION=$(java -version 2>&1)
JDK=` ls $DOWNLOADS | grep "jdk"`
STUDIO_URL=http://dl.google.com/android/studio/install/0.3.2/android-studio-bundle-132.893413-linux.tgz
if [ "uname -m" == "i386" -o "uname -m" == "i686" ]; then
ARCH=32
else
package rx.internal.util.unsafe;
import java.lang.reflect.Field;
public class Unsafe {
public int getIntVolatile(Object obj, long offset) {
return 0;
}
@bogdanRada
bogdanRada / publish.gradle
Created April 25, 2017 06:58 — forked from lifuzu/publish.gradle
Copying APK file in Android Gradle project
def releasePath = file("${rootDir}/archive/${project.name}")
def releaseTask = tasks.create(name: 'release') {
group 'Build'
description "Assembles and archives all Release builds"
}
android.applicationVariants.all { variant ->
if (variant.buildType.name == 'release') {
def build = variant.name.capitalize()
@bogdanRada
bogdanRada / release.gradle
Created April 25, 2017 05:02
Gradle Script for auto version incrementing, git tagging, and deploying to Beta by Crashlytics
/*
* Copyright © 52inc 2015.
* All rights reserved.
*/
apply plugin: 'org.ajoberstar.grgit'
import groovy.json.*
def versionFile = file("../version.json")
@bogdanRada
bogdanRada / ClickTextView.java
Created April 11, 2017 04:22 — forked from mruijzendaal/ClickTextView.java
Small TextView extension to set it's textStyle to bold when its clicked.
public class ClickTextView extends android.support.v7.widget.AppCompatTextView {
Rect rect;
public ClickTextView(Context context) {
super(context);
init();
}
public ClickTextView(Context context, AttributeSet attrs) {