Skip to content

Instantly share code, notes, and snippets.

View amritanshu-pandey's full-sized avatar
🤣

Amritanshu Pandey (Amrit) amritanshu-pandey

🤣
View GitHub Profile
@amritanshu-pandey
amritanshu-pandey / deployment.yaml
Created May 29, 2021 08:08
Create Kubernetes storage class using NFS provisioner
kind: Deployment
apiVersion: apps/v1
metadata:
name: nfs-client-provisioner
spec:
selector:
matchLabels:
app: nfs-client-provisioner
replicas: 1
strategy:
@amritanshu-pandey
amritanshu-pandey / usb-unlock-luks.md
Created May 17, 2021 06:03 — forked from da-n/usb-unlock-luks.md
Unlock LUKS full disk with USB stick

Configuration for passwordless root filesystem

Source: https://www.howtoforge.com/tutorial/passwordless-encryption-of-linux-root-partition/

The process of entering the passphrase at boot time will now be automated using an USB memory stick. Instead of using a passphrase , the secret key on the USB will decrypt the encrypted volumes. Connect an USB stick to the VM and locate it using the dmesg command. It is detected as /dev/sdb in my VM.

The secret key of 8192 random byte is extracted from the usb stick using the dd command.

dd if=/dev/sdb of=/root/secret.key bs=512 skip=4 count=16
@amritanshu-pandey
amritanshu-pandey / Backup-Folders.ps1
Created March 12, 2020 22:15 — forked from Boggin/gist:5649e5873c076060678817eab826d38b
Use Restic to perform backups to Backblaze B2.
#requires -version 4
<#
.SYNOPSIS
Restic backup script.
.DESCRIPTION
Use Restic to perform backups to Backblaze B2.
.PARAMETER Repository
The path to the Restic repository, e.g. 'b2:my-named-repo'.
@amritanshu-pandey
amritanshu-pandey / docker-compose.yml
Created April 24, 2018 07:42
Setup Elastic stack (Elastic Search and Kibana) with authentication support on docker
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-platinum:6.2.4
ports:
- 9200:9200
- 9300:9300
environment:
- 'discovery.type=single-node'
- 'ELASTIC_PASSWORD=elastic'
@amritanshu-pandey
amritanshu-pandey / bootstrap.sh
Created April 20, 2018 07:12
My Docker-Workstation bootstrap script
#!/bin/bash
## Remove or edit this sample code as per your requirement
if [ -d "${HOME}/.ssh" ]; then
echo "Setting permission for \"${HOME}\"/.ssh"
chmod -R 700 "${HOME}"/.ssh
fi
pyenv install 3.6.5
pyenv install 3.7.0b3
nodenv install 9.11.1

Keybase proof

I hereby claim:

  • I am amritanshu-pandey on github.
  • I am amritanshupandey (https://keybase.io/amritanshupandey) on keybase.
  • I have a public key ASDgem5nCZonIzWuBCJjmO6EtyH1HQ2WC8v-mG-PtbAdPAo

To claim this, I am signing this object:

Send-MailMessage `
-To "[email protected]" `
-CC "[email protected]" `
-Subject "Hello from Poweshell" `
-Body "Hello Receiver" `
-SmtpServer "smtp.gmail.com" `
-From "[email protected]" `
-Port 587 `
-UseSsl `
-Credential (Import-Clixml .\credentials.xml) `
Send-MailMessage `
-To "[email protected]" `
-CC "[email protected]" `
-Subject "Hello from Poweshell" `
-Body "Hello Receiver" `
-SmtpServer "smtp.gmail.com" `
-From "[email protected]" `
-Port 587 `
-UseSsl `
-Credential "test_password" `