Skip to content

Instantly share code, notes, and snippets.

Migrating to CreateAccounts (20160220174730)
== 20160220174730 CreateAccounts: migrating ===================================
[strong_migrations] DANGER: No lock timeout set
-- create_table(:accounts, {:id=>:integer})
-> 0.0182s
-- add_index(:accounts, [:username, :domain], {:unique=>true})
-> 0.0029s
== 20160220174730 CreateAccounts: migrated (0.0222s) ==========================
Migrating to CreateStatuses (20160220211917)
@dictvm
dictvm / cluster_autoscaler-svc.yml
Created April 8, 2019 16:08
Kubernetes Cluster Autoscaler service for metrics exposure
apiVersion: v1
kind: Service
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
name: cluster-autoscaler
annotations:
prometheus.io/scrape: 'true'
spec:
@dictvm
dictvm / gist:419ad2f443826784cfbcc2ff5766104e
Created November 15, 2017 09:09
Count Series in InfluxDB
influx -database '$DATABASE' -format 'csv' -execute 'SHOW SERIES' | grep -v "name,_id,host" | wc -l
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
app: cluster-autoscaler
spec:
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-cluster-autoscaler
namespace: kube-system
spec:
podSelector:
matchLabels:
app: cluster-autoscaler
@dictvm
dictvm / Dockerfile
Created September 5, 2019 15:31
react-native-yarn Dockerfile reconstructed
FROM dictvm/react-native-yarn:0.1.2
ADD file:204fb7ccb19ff7e863331131138621ff4d22720b3718e8f296902cc7d4f635b5 in /
RUN /bin/sh -c set -xe \
&& echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
&& dpkg-divert --local --rename --add /sbin/initctl \
&& cp -a /usr/sbin/policy-rc.d /sbin/initctl \
&& sed -i 's/^exit.*/exit 0/' /sbin/initctl \
&& echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \
@dictvm
dictvm / nonchoppybluetooth
Created August 18, 2016 16:38
Okayish Bluetooth configuration for OS X El Capitan to work with Bose Soundlink Mini 2
{
"Apple Bitpool Max (editable)" = 80;
"Apple Bitpool Min (editable)" = 35;
"Apple Initial Bitpool (editable)" = 35;
"Apple Initial Bitpool Min (editable)" = 53;
"Negotiated Bitpool" = 80;
"Negotiated Bitpool Max" = 80;
"Negotiated Bitpool Min" = 80;
}
@dictvm
dictvm / alert.sh
Created April 25, 2019 13:01 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@dictvm
dictvm / uberspace7-setup-redis.sh
Last active February 21, 2019 01:19
This scripts installs the latest version of redis on a Uberspace 7 account
#!/bin/sh
# Install
REDIS_SOURCE="redis-stable.tar.gz"
curl -LO http://download.redis.io/$REDIS_SOURCE
tar xvzf $REDIS_SOURCE
cd redis-stable
make
mv src/redis-{server,cli} ~/bin/
@dictvm
dictvm / influxdb_series_per_measurement.sh
Last active December 20, 2018 10:12 — forked from endeepak/influxdb_measurement_series_count_per_measurement.sh
Influxdb : Print cardinality / series count per measurement
#!/usr/bin/env sh
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <db_name>"
exit 1
fi
db_name=$1