Skip to content

Instantly share code, notes, and snippets.

View viatcheslavmogilevsky's full-sized avatar

Vyatcheslav Mogilevsky viatcheslavmogilevsky

View GitHub Profile
.obsidian/plugins/**/*.js
.obsidian/plugins/**/*.css
.obsidian/workspace.json
@viatcheslavmogilevsky
viatcheslavmogilevsky / Running_SI_local_stack_using_lima-vm.md
Last active March 29, 2024 07:14
Running SI local stack using lima-vm

Running SI local stack using lima-vm

Prerequisites

  1. Install lima-vm https://github.com/lima-vm/lima
  2. Editor/IDE with availability to open directories by SSH (for example VS Code + Remote SSH)

Launch lima instance

@viatcheslavmogilevsky
viatcheslavmogilevsky / endoftheday.scpt
Created November 20, 2023 17:11
End-of-the-day automation
on run {}
tell application "Finder"
close every window
set trashcount to count of items of the trash
if trashcount > 0 then
empty the trash
end if
end tell
try
tell application "Calendar" to if it is running then quit
# Usage:
# packer build -var region=us-west-1 -var ami_name=sysbox-$(date +%s) ubuntu-shiftfs-sysbox-primer.pkr.hcl
variable "ami_name" {
type = string
}
variable "region" {
type = string
}
#!/bin/bash
mkdir -p terraform.d/plugins/darwin_amd64
curl -skSL \
https://github.com/Mongey/terraform-provider-kafka/releases/download/v0.2.0/terraform-provider-kafka_0.2.0_darwin_amd64.tar.gz \
| tar -xOzf - terraform-provider-kafka \
> terraform.d/plugins/darwin_amd64/terraform-provider-kafka_v0.2.0
chmod u+x terraform.d/plugins/darwin_amd64/terraform-provider-kafka_v0.2.0
@viatcheslavmogilevsky
viatcheslavmogilevsky / s3update.py
Created May 16, 2017 17:57 — forked from nateware/s3update.py
Check local files vs what's on S3, and upload any that have changed.
#!/usr/bin/env python
# Compare a file on S3 to see if we have the latest version
# If not, upload it and invalidate CloudFront
import fnmatch
import os
import boto
import pprint
import re
vimo4710@dbblade01:~/ip_stat$ spark-submit ip_stat.py /data/httplogs/access.log.1 /data/countryip.csv
16/03/04 15:33:10 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/03/04 15:33:11 WARN Utils: Service 'SparkUI' could not bind on port 4040. Attempting port 4041.
16/03/04 15:33:11 WARN MetricsSystem: Using default name DAGScheduler for source because spark.app.id is not set.
(u'United States', 6)
(u'Israel', 2)
(u'Poland', 3)
(u'Republic of Moldova', 1)
(u'Luxembourg', 1)
(u'United Kingdom', 1)
@viatcheslavmogilevsky
viatcheslavmogilevsky / startup.sh
Last active August 29, 2015 14:13
startup suprise
sudo docker run -t -i --rm \
-v /var/run/docker.sock:/run/docker.sock \
-v $(which docker):/bin/docker \
-v $(pwd):/current_dir \
viatcheslavmogilevsky/suprise:0.0.1
@viatcheslavmogilevsky
viatcheslavmogilevsky / z1.rb
Created March 19, 2014 15:20
Решение первой задачи
#!/usr/bin/ruby
def perform(str)
result = ''
while !str.empty?
first = str[0]
str.sub!(/#{first}+/) do |sub_str|
result.concat "#{sub_str.length}#{first}"
''
end
for OUTPUT in $(redis-cli KEYS "bvip:achievements:*"); do redis-cli DEL $OUTPUT; done