Skip to content

Instantly share code, notes, and snippets.

Rohan Kapadia kapad

  • Bangalore, India
Block or report user

Report or block kapad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kapad /
Created Jul 3, 2018
Script to toggle the Gnome nightlight setting.
setting=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)
if [[ $setting == "true" ]]; then
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
kapad / docker-compose.yml
Created Mar 7, 2018
docker compose redis cluster
View docker-compose.yml
version: '2'
image: grokzen/redis-cluster
hostname: redis-cluster
- "7000:7000"
- "7001:7001"
- "7002:7002"
- "7003:7003"
kapad / docker-compose.yml
Created Mar 7, 2018
docker compose master slave configuration
View docker-compose.yml
version: '3'
driver: bridge
driver: default
- subnet:
View 8.2.3. HTTP log format
8.2.3. HTTP log format
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
kapad / dataUriToBinary.js
Created Jun 13, 2017
Convert a base64 encoded data URI to binary
View dataUriToBinary.js
let convertDataURIToBinary = (dataURI) => {
var BASE64_MARKER = ';base64,';
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(var i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
View markdown.css
* Copyright 2013 Alex Pacini.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
kapad /
Last active Aug 1, 2018
Simplified man page/usage instructions for Linux screen command

Starting or re-entering an already running session (Works regardless of whether the session was detached properly or the internet connection went kaput)

Command: screen -D -RR If multiple users are going to share the same machine and all want to use screen, then use screen -D -RR <screen-alias>

To start with screen will only have one screen.

To start a new screen keyboard shortcut is

You can’t perform that action at this time.