Skip to content

Instantly share code, notes, and snippets.


Sebastian Duque Gutierrez sebastiandg7

View GitHub Profile
#!/usr/bin/env sh
set -- $(locale LC_MESSAGES)
yesptrn="$1"; noptrn="$2"; yesword="$3"; noword="$4"
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
input_sink=$(pacmd stat |grep -o -P "(?<=Default source name: ).*")
output_sink=$(pacmd stat |grep -o -P "(?<=Default sink name: ).*")
echo "Input:" $input_sink
sebastiandg7 /
Created Apr 9, 2020
Compress all folders in current directory in their own RAR file
for folder in */
rar a -m5 -r "${folder%/}.rar" "$folder"
sebastiandg7 /
Last active Feb 27, 2020
NativeScript Ubuntu 19.10 - Android Setup
# NativeScript Ubuntu 19.10 - Android Setup
sudo apt install -y lib32z1 lib32ncurses6 libbz2-1.0:i386 libstdc++6:i386 g++ openjdk-8-jdk unzip
wget -O /tmp/
sudo mkdir -p /usr/local/android/sdk && sudo chown -R $USER:$USER /usr/local/android/sdk
cd /tmp && unzip && rm -f && mv tools /usr/local/android/sdk
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
export ANDROID_HOME="/usr/local/android/sdk/"
sebastiandg7 /
Created Nov 12, 2019 — forked from mrk-han/
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER


  • The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    • These can be run locally or on the base build agent.
  • Note: X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.
  • We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.

See: Google Documentation on Start the emulator from the command line for more info

sebastiandg7 /
Created Aug 20, 2019 — forked from bradwestfall/
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect to
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation


sebastiandg7 / destructuring.js
Created Feb 10, 2019 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic:
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
sebastiandg7 / ei.cfg
Last active Feb 7, 2020
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
View ei.cfg
sebastiandg7 / npm
Last active Jan 15, 2019
npm script fix for Windows shared node installation with WSL
View npm
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
if grep -iq 'Microsoft\|WSL' /proc/version; then
sebastiandg7 / delete_duplicates.bash
Created Aug 30, 2018
Delete duplicated files in linux
View delete_duplicates.bash
declare -A arr
shopt -s globstar
for file in **; do
[[ -f "$file" ]] || continue
read cksm _ < <(md5sum "$file")
if ((arr[$cksm]++)); then
echo "rm $file"
sebastiandg7 / cockroach-cluster-docker-compose.yml
Last active Aug 15, 2018
CockroachDB cluster with two datacenters simulation using docker compose
View cockroach-cluster-docker-compose.yml
# CockroachDB cluster with two datacenters simulation using docker compose
version: '2'
driver: bridge
driver: bridge
You can’t perform that action at this time.