Skip to content

Instantly share code, notes, and snippets.

@zero-master
zero-master / remove-stackdriver-logging-agent.sh
Created May 20, 2018 18:26
Remove Stackdriver Logging agent
#!/bash/sh
sudo service google-fluentd stop && sudo apt-get remove google-fluentd google-fluentd-catch-all-config
@zero-master
zero-master / ClickLogConsumer.java
Created April 18, 2018 11:09
Write from Cloud Pub/Sub to BigQuery using Fileload and save cost on streaming inserts!
package ...
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
import com.google.api.services.bigquery.model.TimePartitioning;
import com.google.common.collect.ImmutableList;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO;
@zero-master
zero-master / GDPR.md
Last active February 14, 2022 20:07
Show visitors from EU countries a page with GDPR message using Cloudflare and .htaccess
@zero-master
zero-master / redis-auth.conf
Created May 20, 2018 17:24
Redis (with auth) configuration file for collectd
LoadPlugin redis
<Plugin "redis">
<Node "mynode">
# When using non-standard Redis configurations, replace the below with
#Host "REDIS_HOST"
#Port "REDIS_PORT"
Host "localhost"
Port "6379"
Timeout 2000
Password "SECRET"
#!/bash/bin
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable
apt update
apt install wireguard
runtime: python
api_version: '1'
env: flexible
threadsafe: true
env_variables:
APP_ENV: pro
GOOGLE_CLOUD_DISABLE_GRPC: 'True'
automatic_scaling:
min_num_instances: 2
max_num_instances: 20
:bit_pay:
:api_key: 'XXXX'
:test: true
:database:
# SQLite (development)
# :adapter: sqlite3
# :database: test.db
# For PostgreSQL
# :adapter: postgresql
#!/bin/bash
ACTIVEMERCHANT_INTEGRATION='bit_pay'
cd ../
WORKING_DIR=`pwd`/plugin-development/$ACTIVEMERCHANT_INTEGRATION
cd killbill-plugin-framework-ruby
if [ -d "$WORKING_DIR" ]; then rm -Rf $WORKING_DIR; fi
./script/generate active_merchant $ACTIVEMERCHANT_INTEGRATION $WORKING_DIR
cd $WORKING_DIR
rm -f Gemfile.lock Jarfile.lock .jbundler/classpath.rb
bundle install
#!/bin/bash
# Activemerchant bitpay integration (snake case name: bit_pay) is located here: https://github.com/activemerchant/offsite_payments/blob/master/lib/offsite_payments/integrations/bit_pay.rb
./script/generate active_merchant two_checkout ../plugin-development
cd ../plugin-development
rake killbill:clean ; rake build ; rake killbill:package; rake killbill:deploy[true]
Bundler::GemNotFound: Could not find json-1.8.6 in any of the sources
materialize at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/spec_set.rb:91
map! at org/jruby/RubyArray.java:2446
materialize at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/spec_set.rb:85
specs at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/definition.rb:171
specs_for at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/definition.rb:238
requested_specs at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/definition.rb:227
requested_specs at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16.2/lib/bundler/runtime.rb:108
setup at /var/tmp/bundles/plugins/ruby/killbill-webmoney/0.0.1/ROOT/gems/gems/bundler-1.16