Skip to content

Instantly share code, notes, and snippets.

View oscarolbe's full-sized avatar

Oscar Olivera oscarolbe

View GitHub Profile
#!/bin/bash
# Variables to define the string to find and the string to replace with
OLD_STRING="tenant"
NEW_STRING="domain"
# Find all directories recursively and rename them
find . -depth -type d -name "*${OLD_STRING}*" | while IFS= read -r dir; do
newdir=$(echo "$dir" | sed "s/${OLD_STRING}/${NEW_STRING}/g")
mv "$dir" "$newdir"
import os
import math
import subprocess
import sys
import argparse
import re
from math import *
from os import *
from subprocess import *
find path_to_folder -depth -exec rename -f 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
gsutil -m cp -r /path_to_folder/* gs://bucket
find ./src -type f -name "*.ex" -print0 | xargs -0 sed -i '' 's/something/another_stuff/g'