Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Duque Gutierrez sebastiandg7

View GitHub Profile
View filter_voice.sh
#!/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
sebastiandg7 / RAR_all_directories.sh
Created Apr 9, 2020
Compress all folders in current directory in their own RAR file
View RAR_all_directories.sh
for folder in */
do
rar a -m5 -r "${folder%/}.rar" "$folder"
done
@sebastiandg7
sebastiandg7 / nativescript-android-setup.sh
Last active Feb 27, 2020
NativeScript Ubuntu 19.10 - Android Setup
View nativescript-android-setup.sh
#!/bin/bash
# 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 https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O /tmp/sdk-tools.zip
sudo mkdir -p /usr/local/android/sdk && sudo chown -R $USER:$USER /usr/local/android/sdk
cd /tmp && unzip sdk-tools.zip && rm -f sdk-tools.zip && 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
sebastiandg7 / emulator-install-using-avdmanager.md
Created Nov 12, 2019 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)
View emulator-install-using-avdmanager.md

Install and Create Emulators using AVDMANAGER and SDKMANAGER

About

  • 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
sebastiandg7 / S3-Static-Sites.md
Created Aug 20, 2019 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.
View S3-Static-Sites.md

S3 Static Sites

What this will cover

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

Resources

@sebastiandg7
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: http://git.mikaelb.net/presentations/bartjs/destructuring
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
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
[EditionID]
Professional
[Channel]
Retail
@sebastiandg7
sebastiandg7 / npm
Last active Jan 15, 2019
npm script fix for Windows shared node installation with WSL
View npm
#!/bin/sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if grep -iq 'Microsoft\|WSL' /proc/version; then
@sebastiandg7
sebastiandg7 / delete_duplicates.bash
Created Aug 30, 2018
Delete duplicated files in linux
View delete_duplicates.bash
#!/bin/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
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'
networks:
shared-roachnet:
driver: bridge
dc0-roachnet:
driver: bridge
dc1-roachnet:
You can’t perform that action at this time.