Skip to content

Instantly share code, notes, and snippets.

View wok's full-sized avatar

Wolfgang Kölbl wok

View GitHub Profile
@wok
wok / cloudSettings
Created January 24, 2019 08:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-24T08:07:43.531Z","extensionVersion":"v3.2.4"}
@wok
wok / android-emulator-homebrew.sh
Last active November 8, 2018 06:18 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
touch ~/.android/repositories.cfg
brew cask install caskroom/versions/java8
brew cask install android-sdk
brew cask install intel-haxm
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
sdkmanager "platform-tools" "platforms;android-28" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;28.0.0" "system-images;android-28;google_apis;x86" "emulator"
avdmanager create avd -n test -k "system-images;android-28;google_apis;x86"
/usr/local/share/android-sdk/tools/emulator -avd test
(function() {
'use strict';
function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
@wok
wok / codeship.rake
Created April 7, 2016 12:27
codeship.rake
namespace :db do
desc 'Drops all tables in the database'
task drop_all_tables: :environment do
fail 'Only allowed in test environment' unless Rails.env.test?
connection = ActiveRecord::Base.connection
case connection.adapter_name
# SQL Server via TinyTDS
when 'SQLServer'
# editor for bundler
export BUNDLER_EDITOR=atom
export EDITOR=atom
# git completion
source ~/.git-completion.bash
# original PS1
# export PS1='\h:\W \u\$ '
@wok
wok / raygun_opsworks.rb
Created September 24, 2015 10:29
raygun_opsworks.rb
# Copyright (c) 2015 Taikala Ltd (www.taikala.fi)
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# Usage
# copy this file to a new director e.g. /root/chef
# run a single recipe as follows:
# ./local_chef.sh -o recipe[myclub::backup]
# put the cookbook path in solo.rb file.
echo 'cookbook_path ["/opt/aws/opsworks/current/merged-cookbooks"]' > solo.rb
# create json file incase if you want use the attributes from opsworks.
opsworks-agent-cli get_json > attributes.json
  1. Check if raygun certficiate is correct:

     ruby -rnet/https -e "Net::HTTP.get URI('https://api.raygun.io'); puts 'Everything ok.'"
    
  2. Check ruby default SSL store

     ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'
    
  3. Append Euqifax Root Certificate to file from step 2

  4. Recheck

@wok
wok / memcachedump.sh
Created June 5, 2015 10:40
Dump memcached content
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
{
"type": "email",
"customer": {
"email": "customer@example.com",
"firstName": "Jack",
"lastName": "Test 2"
},
"subject": "I need help #17",
"mailbox": {
"id": 16671