Skip to content

Instantly share code, notes, and snippets.

Android Emulator usage: emulator [options] [-qemu args]
options:
-sysdir <dir> search for system disk images in <dir>
-system <file> read initial system image from <file>
-datadir <dir> write user data into <dir>
-kernel <file> use specific emulated kernel
-ramdisk <file> ramdisk image (default <system>/ramdisk.img
-image <file> obsolete, use -system <file> instead
-initdata <file> same as '-init-data <file>'
-data <file> data image (default <datadir>/userdata-qemu.img
@raecoo
raecoo / random.string.rb
Created December 2, 2014 13:54
random string in ruby
# Only upper case alphabets [A-Z]
value = "";
8.times{value << (65 + rand(25)).chr} >>}
#or
(0...8).map{65.+(rand(26)).chr}.join
(0...8).map{ ('A'..'Z').to_a[rand(26)] }.join
# Lower case and upper case [a-zA-Z]
value = "";
8.times{value << ((rand(2)==1?65:97) + rand(25)).chr} >>}
@mobmad
mobmad / gist:433ba54e9cb97d6d7771
Created March 24, 2015 21:37
Create self-signed certificate for wiremock and configure a java client under test for HTTPS

1. Generate self-signed certificate

keytool -genkey -alias wiremock -keyalg RSA -keysize 1024 \
    -validity 365 -keypass password -keystore identity.jks -storepass password

Important: keypass must equal storepass, or else you'll receive java.io.IOException: !JsseListener: java.security.UnrecoverableKeyException: Cannot recover key

2. Start wiremock with the new keystore and HTTPS enabled

@vlas-voloshin
vlas-voloshin / delete-duplicate-sims.rb
Last active April 18, 2024 19:04
Script for deleting duplicate iOS simulators and fixing simulators list in Xcode
#!/usr/bin/env ruby
# What is this for?
# This script fixes an issue appeared for some Xcode users where it would show long identifiers
# in the list of simulators instead of usual short names. This is caused by duplicate simulators
# being sometimes created after switching between Xcode versions, with the same
# device type + runtime pair occurring more than once in your list of available simulators.
# Instead of showing the same simulator name twice, Xcode defaults to simulator identifiers.
#
# What it does?
@joepie91
joepie91 / vpn.md
Last active November 20, 2024 16:18
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@hperantunes
hperantunes / tail-grep.ps1
Created February 25, 2016 16:45
tail + grep powershell equivalent
Get-Content C:\temp\mylogfile.log -tail 100 –wait | Select-String 'search'
@F21
F21 / cleanup-docker.md
Last active March 7, 2024 10:05
Commands to clean up docker

Remove dangling images

docker images -qf dangling=true | xargs docker rmi

Remove dangling volumes

docker volume ls -qf dangling=true | xargs -r docker volume rm
@Arinerron
Arinerron / permissions.txt
Last active October 28, 2024 08:10
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@adaemon
adaemon / Using Mocha Tags in WDIO Mocha Plugin
Last active October 3, 2023 06:40
WebdriverIO Mocha Plugin : Using Mocha Tags
WDIO Mocha plugin is an useful adapter to use Mocha in WDIO. Mocha options can be provided through wdio config file or through command line argument. To invoke WDIO from npm scripts passing command line arguments is tricky.
Mocha Tags are useful to run specific methods tagged by common name. Requirements like running smoke test, remote, local, headless, fast, slow tests can be done using tags. https://github.com/mochajs/mocha/wiki/Tagging
Let say i have a package.json scripts section like below
"scripts": {
"smoke": "node node_modules/webdriverio/bin/wdio conf/wdio.conf.js --mochaOpts.grep=@Smoke",
"slow": "node node_modules/webdriverio/bin/wdio conf/wdio.conf.js --mochaOpts.grep=@Slow",
"fast": "node node_modules/webdriverio/bin/wdio conf/wdio.conf.js --mochaOpts.grep=@Fast"
@jchandra74
jchandra74 / PowerShell Customization.md
Last active November 15, 2024 12:07
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.