Skip to content

Instantly share code, notes, and snippets.

View docker-run
docker run
--user 0:0
--env MY_USR=$(id -u)
--env MY_GID=$(id -g)
bash -c 'zypper install -l -y xyz;
echo "dummy:x:$MY_USR:$MY_GID:eusers:$PWD:/bin/bash" >> /etc/passwd;
su - dummy -c "<command-to-be-run-with-host-users-permissions>"'
kumaraish /
Created Jul 2, 2019 — forked from Fluidbyte/
Basic principles of using tcl-expect scripts


TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

View gist:138a43ce2a4b2aed2e2375e08011183a
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from

These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:

while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
kumaraish /
Created Feb 11, 2018 — forked from hSATAC/
# Author: Todd Larason <>
# $XFree86: xc/programs/xterm/vttests/,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
kumaraish / jekyll.txt
Last active Dec 31, 2020
Installing Jekyll on Windows
View jekyll.txt
Jekyll v3.x requires Ruby version >= 2.0.0.
Ruby installation
-installation via chocolatey
kumaraish / history.xml
Created Jun 25, 2016
Android icon created using xml
View history.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android=""
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (
Download the correct GApps for your Android version:
Google Apps for Android 5.0 ( -
Google Apps for Android 4.4.4 ( -
Google Apps for Android 4.3 ( -
Google Apps for Android 4.2 ( -
Google Apps for Android 4.1 ( -
kumaraish /
Last active Aug 29, 2015
Design Pattern - Factories
/** Static Factory Method
* "Static factory method is simply a static method that returns an instance of a class."
* (c) Effective Java, Joshua Bloch
// Use - Descriptive names for Constructors
public class Coordinate {
View Android Lollipop Widget Tinting Guide
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
* background (Lollipop only) - "colorPrimaryDark"
View Material Design Colors
<?xml version="1.0" encoding="utf-8"?>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>