Skip to content

Instantly share code, notes, and snippets.

View ruXlab's full-sized avatar
🇬🇧
Open for next contract(backend/android/devops)

ruX ruXlab

🇬🇧
Open for next contract(backend/android/devops)
View GitHub Profile
@ruXlab
ruXlab / provision-rpi.yml
Created January 12, 2020 17:59
ansible playbook which installs docker-machine on your Raspberry PI, see https://rux.vc/2020.01/installing-docker-machine-on-raspberry-pi/
# Install docker machine on your RPi
# For more details see https://rux.vc/2020.01/installing-docker-machine-on-raspberry-pi/
---
- name: RPi initial provisioner
hosts: all
remote_user: pi
become: yes
become_user: root
tasks:
- name: "Remembering target host information"
@ruXlab
ruXlab / bitbucket-backup-all-repos.sh
Last active June 2, 2019 09:01 — forked from nixjobin/bitbucket-backup-all-repos.sh
bitbucket-backup-all-repos.sh
#!/bin/bash
# Author: ruX
# Website: https://rux.vc/
# Blog post: https://rux.vc/2019.06/bitbucket-backup-script/
# Based on: https://gist.github.com/redhatjobin/8ed1fed08549b2cefdbf
# Always fail on error
set -e
# Configuration
object UserAgents {
val list = arrayOf(
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/601.7.8
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Mozilla/5.0 (Windows NT 6.1; WO
package vc.rux.utils
import android.content.Context
import android.content.SharedPreferences
/**
* Shared preferences helper
*/
public fun Context.loadPref<T>(key: String, default: T): T {
@ruXlab
ruXlab / MenuItemSearchAction.java
Created August 28, 2012 16:56
Alternative SearchView for ActionBar. Read more about http://rux.pp.ru/2012.08/android-actionbar-search-view/ (in russian)
package de.appetites.android.menuItemSearchAction;
/*
* Copyright (C) 2012 Benjamin Mock
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0