Skip to content

Instantly share code, notes, and snippets.

View krsoninikhil's full-sized avatar

Nikhil Soni krsoninikhil

View GitHub Profile
@BurntSushi
BurntSushi / x11-gnome-do.py
Created April 22, 2020 11:40
Hacky Python script to switch focus between monitors in GNOME while respecting window stacking order.
#!/usr/bin/env python3
# This script serves as duct tape to make the multiple monitor experience
# on GNOME 3 just a little bit better. Currently, the only functionality of
# this script is to switch focus from one monitor to the next, while respecting
# the stacking order of windows inside each individual monitor. However, the
# script is designed to make it easy to add more functionality later. Namely,
# when the script is run, it reads the current monitor, desktop and window
# configuration into a convenient in-memory data structure.
#
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active June 12, 2024 04:04
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@pkafel
pkafel / kafka-command.md
Last active March 3, 2024 13:49
Kafka command-line tools (examples in OSX)

Kafka command line tools

List (not complete)

  • zookeeper-server-start.sh - starting Zookeeper
  • kafka-server-start.sh - start Kafka
  • kafka-topics.sh - manage topics in Kafka
  • kafka-console-producer.sh - script for sending messages to Kafka topic
  • kafka-console-consumer.sh - script for consuming messages from Kafka topic
  • kafka-run-class.sh - script for running different tools (list of tools can be found here)
@eliquious
eliquious / README.md
Created January 4, 2016 05:01
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@karpathy
karpathy / min-char-rnn.py
Last active June 16, 2024 04:05
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active May 27, 2024 22:57
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@shashankmehta
shashankmehta / placements.js
Created December 14, 2014 20:41
IITR Placement updates
var cheerio = require('cheerio');
var request = require('request');
var fs = require('fs');
var exec = require('child_process').exec;
var twitterAPI = require('node-twitter-api');
var phpsessid = '<get it from your channeli account. Chrome developer console is your friend>';
var consumerKey = '<get it from twitter.js>';
var consumerSecret = '<get it from twitter.js>';
var accessToken = '<get it from twitter.js>';
@edwardhotchkiss
edwardhotchkiss / Makefile
Created March 5, 2014 23:30
ATtiny85 avr-gcc / avrdude Makefile
DEVICE = attiny85
CLOCK = 8000000
PROGRAMMER = stk500v1
PORT = /dev/tty.usbmodem1421
BAUD = 19200
FILENAME = main
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
all: usb clean build upload