Skip to content

Instantly share code, notes, and snippets.

View ashwaqar's full-sized avatar

Ashwaq ashwaqar

View GitHub Profile
@ashwaqar
ashwaqar / redis.yaml
Created September 16, 2022 11:12
Guestbook IB exercise
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-redis
labels:
app: redis
spec:
storageClassName: manual
capacity:
storage: 2Gi
@ashwaqar
ashwaqar / replace_lines_in_file.py
Created June 17, 2021 13:02 — forked from kirang89/replace_lines_in_file.py
Simple, clean way of replacing lines in a file
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from tempfile import mkstemp
from shutil import move
from os import remove
import sys
def replace(source_file_path, pattern, substring):
fh, target_file_path = mkstemp()