Skip to content

Instantly share code, notes, and snippets.

@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active March 13, 2024 13:04
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@flaki
flaki / init.coffee
Created July 18, 2015 14:36
Atom on Windows and Hungarian keyboard layout AltGr+<key> keybinding fix - add this to your init.coffee
# Your init script
# Fixes AltGr problems on Hungarian keyboard layouts in Windows
# for characters [ (AltGr+F), < (AltGr+M), \ (AltGr+Q) and { (AltGr+B)
atom.keymaps.keyBindings = atom.keymaps.keyBindings.filter((binding, i) ->
['ctrl-alt-f','ctrl-alt-q','ctrl-alt-b','ctrl-alt-m'].indexOf(binding.keystrokes) == - 1
)
@ranjib
ranjib / org1-prod.rb
Created June 18, 2015 22:13
Consuming common datra across environments using Chef's ruby environment DSL
# located at chef_repo/environments/org1-prod.rb
require 'deep_merge'
name 'org1-prod'
description 'Production environment for org1'
org1_yml_path = File.expand_path('../common/org1.yml', __FILE__)
common = YAML.load_file(org1_yml_path)
default_attributes(
common['default'].deep_merge!(
# declare all you org1-prod specific things here.
@zuazo
zuazo / Chef-metadata-environment-pattern.rb
Last active November 17, 2016 08:58
This Chef Cookbook metadata.rb example reads the dependencies from Berksfile.lock. (Experimental)
# metadata.rb
# This metadata.rb example reads the dependencies from Berksfile.lock. This can
# be used to implement the Environment Pattern with Chef Server.
#
# The Environment Cookbook:
# http://blog.vialstudios.com/the-environment-cookbook-pattern/
name 'my_face'
# [...]
@yuanying
yuanying / vagrant-kvm.md
Last active October 26, 2023 11:19
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

@coderanger
coderanger / berks-api-lite.rb
Created October 30, 2014 23:42
Berks API Lite.
#!/usr/bin/env ruby
require 'json'
require 'openssl'
require 'tempfile'
require 'fog'
BUCKET = 'something'
ROOT = File.expand_path('..', __FILE__)
UNIVERSE = {}

ChefDK, Test Kitchen Driven NTP Cookbook

This gist uses TK+Berkshelf to drive creating a vagrant virts and converging a simple recipe to install and configure NTPd. This is a simple cookbook that has one recipe, one template (for ntp.conf) and one attribute file. It works on Ubuntu 12.04 and CentOS 6.4 (and derviatives) and the attribute file is used to support both distros.

This should work on Mac (where I developed it) and any chef-supported Linux that you can get Vagrant onto (Ubuntu/CentOS).

Because I use ChefDK and Test Kitchen, I can largely ignore setting up Vagrant and Berkshelf and can get right to work on writing recipe code.

NOTE: Modern (7/6/2014) Recipe Generation

@tknerr
tknerr / clone_branch.sh
Last active October 6, 2015 03:28
handling external repos for bill's kitchen releases
# clone and set up remote tracking branch
cd somewhere
git clone git://github.com/tknerr/cookbooks-motd.git target/dir
cd target/dir
git checkout -t origin/bills-kitchen-1.0_branch
@hileon
hileon / gist:1311735
Created October 25, 2011 07:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing