Skip to content

Instantly share code, notes, and snippets.

View madhukar93's full-sized avatar

Madhukar Mishra madhukar93

View GitHub Profile
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@KrishnaPravin
KrishnaPravin / 2018-https-localhost.md
Created October 13, 2019 11:05 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@afloesch
afloesch / jenkins-in-docker.md
Last active April 23, 2024 11:15
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

@CMCDragonkai
CMCDragonkai / journey_nix_package_repository.md
Last active April 9, 2020 09:36
Journey into Nix Package Repository #nix

Journey into Nix Package Repository

There are 2 commits that I need in my build:

  • 8d0e3ad603dda85462161bba1351893b84339462
  • 83e01aa5e48a9107f3b988c9d4c1c21d610626fb

Clone nixpkgs and add the nixpkgs-channels as a remote.

@CMCDragonkai
CMCDragonkai / nix_overrides.md
Created May 21, 2019 05:43
Nix Overrides #nix

Nix Overrides

  • overrideDerivation is used to override the call to derivation
  • overrideAttrs is used to override the call to stdenv.mkDerivation
  • override is used to override the last function call. Often this will be the callPackage call.
  • overridePythonAttrs is used to override the call to buildPython*.

This PR NixOS/nixpkgs#46842 discusses the idea to have a generic overrideArgs that works like overridePythonAttrs for all language infrastructures.

@CMCDragonkai
CMCDragonkai / nix_inputs.md
Last active April 12, 2024 09:29
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.

@CMCDragonkai
CMCDragonkai / nix_store_queries.sh
Last active June 22, 2019 05:51
Nix Store Queries #nix
#!/usr/bin/env sh
# show the output paths of a derivation
nix-store --query --outputs $(nix-instantiate)
# show the immediate dependencies of a derivation
nix-store --query --references $(nix-instantiate)
# show the transitive dependencies of a derivation
nix-store --query --requisites $(nix-instantiate)
# show the dependers of a store-path
nix-store --query --referrers $(nix-instantiate)
{
coc-nvim = let
pname = "coc-nvim";
version = "0.0.61";
src = fetchFromGitHub {
owner = "neoclide";
repo = "coc.nvim";
rev = "v${version}";
sha256 = "1as2hb4kfq1m0nq7vp2ibkfq8n219ykr04qx4qadg97s7iky4yx4";
# This is heavily based in the code here:
# https://gist.github.com/enpassant/0496e3db19e32e110edca03647c36541
# Special thank you to the user enpassant for starting it https://github.com/enpassant
#!/bin/bash
SYNTAX="$2"
EXTENSION="$3"
OUTPUTDIR="$4"
INPUT="$5"
@CMCDragonkai
CMCDragonkai / ssh_vpn.md
Last active January 8, 2024 16:47
SSH VPN #cli

SSH VPN

Here's an example of setting up a basic point to point VPN using SSH tunnels.

First you need a server in the cloud that isn't behind a NAT.

Ensure that the host and server has port 22 open and is running sshd.

If you're using AWS, make sure to check your security groups.