Skip to content

Instantly share code, notes, and snippets.

View indradhanush's full-sized avatar
Out playing

Indradhanush Gupta indradhanush

Out playing
View GitHub Profile
@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@levsthings
levsthings / docker-ce-ubuntu-17.10.md
Last active April 13, 2023 21:05
Install Docker CE on Ubuntu 17.10

Installing Docker CE on Ubuntu 17.10 Artful Aardvark

As of 20/10/2017, a release file for Ubuntu 17.10 Artful Aardvark is not available on Download Docker.

If you are used to installing Docker to your development machine with get-docker script, that won't work either. So the solution is to install Docker CE from the zesty package.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@F21
F21 / gist:08bfc2e3592bed1e931ec40b8d2ab6f5
Last active October 23, 2022 12:36
Minikube RBAC Quick Start
minikube start --kubernetes-version=v1.7.0 --extra-config=apiserver.Authorization.Mode=RBAC
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
minikube dashboard
@magujs
magujs / i3-config-move_workspace
Last active February 24, 2022 18:43
i3 move a worksapce to another monitor (multi monitor setup)
# i3 move a workspace to another monitor (multi monitor setup)
mode "move_workspace" {
bindsym Up move workspace to output up
bindsym Down move workspace to output down
bindsym Left move workspace to output left
bindsym Up move workspace to output up
bindsym Escape mode "default"
}
anonymous
anonymous / emacs.memory.leak.aka.distnoted.patch.diff
Created January 22, 2014 03:45
This is a patch (with commentary) that fixes a memory leak in 24.3 for OSX Mavericks (10.9) users who experience excessive resource consumption by distnoted.
From 8ab91751069e391a95151c6716a546b1732ade92 Mon Sep 17 00:00:00 2001
From: JP <twitter:canoeberry>
Date: Sun, 19 Jan 2014 11:58:54 +0000
Subject: [PATCH] partial memleak fix
This patch was created by JP (twitter: @canoeberry) based on a memleak fix by Dirk (emacs committer) below:
https://github.com/mirrors/emacs/commit/57ae6509a3b6a274f89b9caea0284c6156470625
This memory leak is fixed in the trunk as of now and will be in the next official release: 24.4.
@panuta
panuta / gist:1852087
Last active April 8, 2020 16:46
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
fc-glyph - display all fonts which contain specified glyphs
@k-bx
k-bx / sublime-text-2.el
Created June 10, 2012 22:02
sublime text 2 like theme for emacs
(defun sublime-text-2 ()
(interactive)
(color-theme-install
'(sublime-text-2
((background-color . "#171717")
(background-mode . light)
(border-color . "#1a1a1a")
(cursor-color . "#fce94f")
(foreground-color . "#cfbfad")
(mouse-color . "black"))
@mbork
mbork / smart-yank.el
Last active July 4, 2018 18:02
Smart yanking for Emacs. See http://mbork.pl/2018-07-02_Smart_yanking for details.
(defun has-space-at-boundary-p (string)
"Check whether STRING has any whitespace on the boundary.
Return 'left, 'right, 'both or nil."
(let ((result nil))
(when (string-match-p "^[[:space:]]+" string)
(setq result 'left))
(when (string-match-p "[[:space:]]+$" string)
(if (eq result 'left)
(setq result 'both)
(setq result 'right)))