Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAWLQCYKhhq_Ze2i4WptYc4IpFq3V-HV4NMCLiTNJQ9jgo

To claim this, I am signing this object:

@Zhomart
Zhomart / filebeat-index-template.json
Last active February 20, 2018 14:07 — forked from thisismitch/filebeat-index-template.json
Fix for elastic 6.0. Run: `curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' -d@filebeat-index-template.json -H "Content-Type: application/json"`
{
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template1": {
"mapping": {
"doc_values": true,
"ignore_above": 1024,
"index": "not_analyzed",

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAALqo70nrARE9pLkoC9BV9SdioRXXW2GrhXLQziu3fRQo

To claim this, I am signing this object:

  1. Try going to each 8 direction, from queens position, until you face obstacle and just count
  2. I used set to check if movement hit the ostacle
defmodule Solution do

  def count(_, qr, qc, _, _) when qr == 0 or qc == 0, do: 0
  def count(n, qr, qc, _, _) when qr == n+1 or qc == n+1, do: 0
  def count(n, qr, qc, obs, speed) do
    if MapSet.member?(obs, {qr, qc}) do # if obstacle
@Zhomart
Zhomart / tensorflow-cpu.sh
Last active November 20, 2017 06:25
Compile and install tensorflow on Ubuntu 16.04. You might want to create a virtual machine on GCP, AWS, then compile tensorflow there. And then download compiled `*.wheel` file for further using it. List of compiled tensorflow with different options can be found here https://github.com/yaroslavvb/tensorflow-community-wheels/issues.
#!/bin/bash
##
## FROM https://github.com/floydhub/dl-docker
##
## Before running the script change versions and compilation flags below.
## If you're having trouble running the whole script, try running
## each command separately.
##
## List of compiled tensorflow packages https://github.com/yaroslavvb/tensorflow-community-wheels/issues
$ crystal spec spec/repo_spec.cr --error-trace --debug -s -t
Parse: 00:00:00.0005730 ( 0.19MB)
Semantic (top level): 00:00:00.1976770 ( 42.18MB)
Semantic (new): 00:00:00.0020550 ( 42.18MB)
Semantic (type declarations): 00:00:00.0269830 ( 50.18MB)
Semantic (abstract def check): 00:00:00.0010410 ( 50.18MB)
Semantic (ivars initializers): 00:00:00.0054870 ( 50.18MB)
Semantic (cvars initializers): 00:00:00.0116270 ( 50.18MB)
Semantic (main): 00:00:01.0783550 ( 202.62MB)
Semantic (cleanup): 00:00:00.0008790 ( 202.62MB)
@Zhomart
Zhomart / setup-monit.yml
Created November 21, 2016 01:18
Ansible monit install script
---
# monit_version = '5.20.0'
- command: /usr/local/bin/monit --version
changed_when: False
failed_when: False
register: installed_monit
import request from 'superagent';
import errorStackParser from 'error-stack-parser';
import { merge } from 'object-state-storage';
class Rollbar {
constructor(logger) {
this._logger = logger;
this.setSessionId = this.setSessionId.bind(this);
$ ./metricbeat -e -c metricbeat.yml
2016/11/11 15:01:05.561060 beat.go:264: INFO Home path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64] Config path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64] Data path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64/data] Logs path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64/logs]
2016/11/11 15:01:05.561094 beat.go:174: INFO Setup Beat: metricbeat; Version: 5.0.0
2016/11/11 15:01:05.561168 logp.go:219: INFO Metrics logging every 30s
2016/11/11 15:01:05.561167 logstash.go:90: INFO Max Retries set to: 3
2016/11/11 15:01:05.561289 outputs.go:106: INFO Activated logstash as output plugin.
2016/11/11 15:01:05.561349 publish.go:291: INFO Publisher name: Zhomarts-MacBook-Pro.local
2016/11/11 15:01:05.561459 async.go:63: INFO Flush Interval set to: 1s
2016/11/11 15:01:05.561470 async.go:64: INFO Max Bulk Size set to: 2048
2016/11/11 15:01:05.561532 metricbeat.go:25: INFO Register [ModuleFactory:[system], MetricSetFactory:[apache/status
@Zhomart
Zhomart / error.md
Created November 10, 2016 18:40
Metricbeats 5.0 on mac os x producing errors for mongodb.status module

Configuration

    metricbeat.modules:
    - module: mongodb
      hosts:
        - localhost:27017
      metricsets:
        - status
      enabled: true
      period: 2s