Skip to content

Instantly share code, notes, and snippets.

@avovsya
avovsya / .cvimrc
Created February 25, 2020 13:29
.cvimrc
set smoothscroll
" alias ':g' to ':tabnew google'
command g tabnew google
map <C-l> nextTab
map <C-h> previousTab
map <C-u> scrollPageUp
map <C-d> scrollPageDown
@avovsya
avovsya / README.md
Created August 23, 2019 11:26 — forked from xavriley/README.md
Arpeggiator in Sonic Pi

Arpeggiator in Sonic Pi

This is a work in progress

@avovsya
avovsya / .svimrc
Last active June 25, 2019 10:33
Safari Vim plugin configuration
" map "f" createTabbedHint
" map "shift+f" createHint
map "ctrl+l" nextTab
map "ctrl+h" previousTab
map "ctrl+u" scrollPageUp
map "ctrl+d" scrollPageDown
Verifying my Blockstack ID is secured with the address 13mmWSf2GZJuEhSW1bUNSTSpkRKqyuRzyn https://explorer.blockstack.org/address/13mmWSf2GZJuEhSW1bUNSTSpkRKqyuRzyn
function readAllNumbers(input) {
var number = "";
var numbers = [];
for (var i = 0; i < input.length; i++) {
if (input[i] === ' ' || input[i] === '\n') {
numbers.push(parseInt(number));
number = "";
continue;
} else {
number += input[i];
@avovsya
avovsya / how-to-find-the-pid-of-a-process-using-a-given-port.md
Created January 4, 2017 12:16 — forked from nepsilon/how-to-find-the-pid-of-a-process-using-a-given-port.md
How to find the PID of a process using a given port? — First published in fullweb.io issue #80

How to find the PID of a process using a given port?

Sometimes you have a process you lost the PID, and would like to kill it.

You can use top (or better htop) to search for your process name and press k to kill it. But this isn’t optimal when you aren’t sure of its name. A better alternative is to search by the port opened, for example port 80:

sudo lsof -i :80
@avovsya
avovsya / split-kinesis-shard.sh
Created April 11, 2016 08:59
Split Amazon Kinesis shard using aws-cli
# Get list of streams
aws kinesis list-streams --region {region: us-east-1}
# Get list of shards for a stream
aws kinesis describe-stream --region {region: us-east-1} --stream-name {stream_name}
# Split
aws kinesis split-shard --region {region: us-east-1} --stream-name {stream_name} --shard-to-split {shard_id_to_split} --new-starting-hash-key {new_starting_hash_key:(shard ending hashkey / 2)}
# Check that it worked
aws kinesis describe-stream --region {region: us-east-1} --stream-name {stream_name}
@avovsya
avovsya / ssh-tail-count.sh
Created December 15, 2015 09:50
Tail remote logs, grep and count lines
cat <(ssh server1 sudo tail -f /var/log/test.log) <(ssh server2 sudo tail -f /var/log/test.log) | grep /api/1/test >> hits & watch wc -l hits
@avovsya
avovsya / ssh-tail.sh
Created December 15, 2015 09:35
Tail and Grep log files from multiple servers
cat <(ssh server1 sudo tail -f /var/log/log.log) <(ssh server2 sudo tail -f /var/log/log.log) | grep /api/1/test >> hits
@avovsya
avovsya / casper-bit.js
Last active July 13, 2017 16:52
Web scraping with node and casper
var casper = require('casper').create({
pageSettings: {
// javascriptEnabled: false
}
});
var system = require('system');
var options = casper.cli.options;