Skip to content

Instantly share code, notes, and snippets.

View madhukar93's full-sized avatar

Madhukar Mishra madhukar93

View GitHub Profile
@CMCDragonkai
CMCDragonkai / nix_checkphase_calling_project_scripts.md
Created December 10, 2018 04:23
Nix `checkPhase` calling project scripts #nix

Nix checkPhase calling project scripts

When using checkPhase and calling scripts in your project, you may need to run patchShebangs bin prior.

This is because your scripts don't have their shebangs patched, so they may be trying to call /usr/bin/env bash. And this path does not exist inside the Nix build environment.

@CMCDragonkai
CMCDragonkai / shebang_scripts_nix_derivations.md
Last active April 25, 2023 07:49
Shebang Scripts in Nix Derivations #nix

Shebang Scripts in Nix Derivations

When you create a derivation, and you later run nix-build on the Nix derivation. Nix will transport the source to a chrooted temporary build directory (this actually can be configured in NixOS configuration.nix). The reason to do this is to ensure deterministic builds in a clean environment.

However the environment is so clean that no dependencies that you don't explicitly declare will be available in that environment. Also things that you take for granted like PATH is something that needs to be explicitly built.

# open streams
```
stdin_open: true
tty: true
```
# run this to get into console
docker attach <instance>
@CMCDragonkai
CMCDragonkai / nix_c_package.md
Last active August 12, 2023 11:49
An Illustration of a Nix C Package #nix #c

An Illustration of a Nix C Package

The pkgs.nix:

import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/4df3426f5a5e78cef4835897a43abd9e2a092b74.tar.gz) {}

The default.nix:

@noahcrowley
noahcrowley / docker-compose.yml
Created June 28, 2018 16:26
TICK Stack Docker Compose for Raspbian
version: '3'
services:
influxdb:
# Full tag list: https://hub.docker.com/r/library/influxdb/tags/
image: influxdb:latest
volumes:
# Mount for influxdb data directory
- ./influxdb/data:/var/lib/influxdb
# Mount for influxdb configuration
- ./influxdb/config/:/etc/influxdb/
@anonoz
anonoz / Dockerfile
Created March 26, 2018 03:13
Sample of multistage Dockerfile for Rails app in production
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_savior
# STAGE for bundle & yarn install
FROM ruby:2.4.3-alpine3.7 as builder
ENV CA_CERTS_PATH /etc/ssl/certs/
ENV RAILS_ENV production
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_SERVE_STATIC_FILES true
@fishi0x01
fishi0x01 / baseURL.groovy
Last active June 15, 2023 19:55
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@bmhatfield
bmhatfield / .zshrc
Last active March 7, 2024 23:11
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);