Skip to content

Instantly share code, notes, and snippets.

View cyriltovena's full-sized avatar
🔥

Cyril Tovena cyriltovena

🔥
View GitHub Profile
@cyriltovena
cyriltovena / DisableCharmBar.cpp
Last active August 29, 2015 13:57
Blog Disable Charmbar
#include "stdafx.h"
#include "DisableCharmBar.h"
bool DisableCharmbar(HWND hWnd)
{
PROPVARIANT var;
var.vt = VT_BOOL;
var.boolVal = VARIANT_TRUE;
// Get window properties
<Grid Background="{StaticResource brushWatermarkBackground}">
<TextBlock Margin="5,2" Text="Type something..."
Foreground="{StaticResource brushForeground}"
Visibility="{Binding ElementName=txtUserEntry, Path=Text.IsEmpty,
Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBox Name="txtUserEntry" Background="Transparent"
BorderBrush="{StaticResource brushBorder}" />
</Grid>
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
@cyriltovena
cyriltovena / gist:60b76ba8ca0ce3d635f673dab18f67f2
Created September 28, 2019 02:55
dns util kubernetes run and delete
kubectl run --generator=run-pod/v1 dnsutil --image tutum/dnsutils -i --tty --rm
root@dnsutil:/# dig grafana.default.svc.us-central1.local
@cyriltovena
cyriltovena / gist:cff9e21ed78b7be7deda9741b074ea28
Last active November 14, 2019 17:27
logcli query --from=2019-11-07T16:40:00Z --to=2019-11-07T18:40:00Z '{cluster="us-central1", job="prod/distributor"} != "label value too long" != "sample timestamp out of order" != "sample with repeated" != "label names; limit"' --forward
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-dvlts_2d056b2a-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-dvlts"} {"level":"warn","ts":"2019-11-07T16:41:14.875Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-726fc2eb-ef3c-43e5-9a88-f45ab6a4722f/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: request timed out"}
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-4vw24_24943bd2-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-4vw24"} {"level":"warn","ts":"2019-11-07T16:41:14.876Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-5375753c-f80b-48e1-bd53-117108a0b39b/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdse
[{"body":" General Notes Cortex has evolved over several years, and the command-line options sometimes reflect this heritage. In some cases the default value for options is not the recommended value, and in some cases names do not reflect the true meaning. We do intend to clean this up, but it requires a lot of care to avoid breaking existing installations. In the meantime we regret the inconvenience.\nDuration arguments should be specified with a unit like 5s or 3h. Valid time units are \u0026ldquo;ms\u0026rdquo;, \u0026ldquo;s\u0026rdquo;, \u0026ldquo;m\u0026rdquo;, \u0026ldquo;h\u0026rdquo;.\nQuerier -querier.max-concurrent The maximum number of top-level PromQL queries that will execute at the same time, per querier process. If using the query frontend, this should be set to at least (querier.worker-parallelism * number of query frontend replicas). Otherwise queries may queue in the queriers and not the frontend, which will affect QoS.\n -querier.query-parallelism This refers to database queries against t
@cyriltovena
cyriltovena / setting.json
Created March 24, 2020 14:27
my vscode config go lang
{
"go.testFlags": [
"-v",
"-count=1"
],
"go.languageServerExperimentalFeatures": {
"format": false,
"autoComplete": true,
"rename": true,
"goToDefinition": true,
@cyriltovena
cyriltovena / demo.md
Created April 21, 2020 19:48
Loki Webinar Demo

First deploy the demo app.

kubectl apply -f tns.yaml

Make sure tiller is installed in your cluster.

Add our chart repository

helm repo add loki https://grafana.github.io/loki/charts

scrape_configs:
- job_name: monitoring
ec2_sd_configs:
- region: us-east-1
port: 9100
relabel_configs:
- action: replace
regex: ".*"
replacement: /var/log/nginx/access.log
target_label: __path__
server:
http_listen_port: 3100
grpc_listen_port: 0
clients:
- url: https://<user id>:<api secret>@logs-prod-us-central1.grafana.net/loki/api/v1/push
positions:
filename: /opt/promtail/positions.yaml