Skip to content

Instantly share code, notes, and snippets.

@emrahyumuk
emrahyumuk / check_local_repos.py
Last active July 14, 2023 12:03
Show uncommited changes in all local repo folders
import os
import subprocess
root_directory = "/path/to/Projects"
def check_repositories(directory):
for root, dirs, files in os.walk(directory):
if ".git" in dirs:
repo_path = os.path.join(root, ".git")
repo_dir = os.path.dirname(repo_path)
@emrahyumuk
emrahyumuk / delete-local-branches.sh
Last active May 23, 2022 08:31
Delete local branches not on remote
git remote prune origin
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D
@emrahyumuk
emrahyumuk / git-refresh-gitignore.sh
Created January 28, 2021 07:26
.gitignore refresh
git rm -r --cached .
git add .
git commit -m "gitignore updated"
@emrahyumuk
emrahyumuk / git-overwrite-branch.sh
Created November 21, 2020 07:08
Git overwrite master with a branch
git checkout master
git reset --hard preprod
git merge -s ours master
git push
@emrahyumuk
emrahyumuk / FolderPermissionsOnLinux.md
Last active September 27, 2017 08:00
Folder Permissions On Linux

This would give all permissions (Read, Write, Execute) to you

sudo chmod 777 -R /path to folder 

The permissions (in this case 777) are as follow:

  • 7 - Full (Read, Write & Execute)
@emrahyumuk
emrahyumuk / RemoveAllContainersAndAllImagesOnDocker.md
Created September 27, 2017 07:52
Remove All Containers And All Images On Docker

Delete all containers

docker rm $(docker ps -a -q)

Delete all images

docker rmi $(docker images -q)

@emrahyumuk
emrahyumuk / InstallDockerOnUbuntu.md
Created September 22, 2017 07:29
Install Docker on Ubuntu
sudo apt-get update

sudo apt-get install \
   apt-transport-https \
   ca-certificates \
   curl \
   software-properties-common
   
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@emrahyumuk
emrahyumuk / RunShScriptFileOnUbuntu.md
Last active January 28, 2021 07:28
Run .sh script files on Linux
@emrahyumuk
emrahyumuk / InstallDebPackagesOnLinux.md
Created September 20, 2017 13:21
Install Deb Packages on Linux
sudo apt-get -f install

sudo dpkg -i <package-name>.deb
@emrahyumuk
emrahyumuk / InstallNodejsOnUbuntu.md
Last active September 20, 2017 06:47
Install Node.js and npm LTS on Ubuntu
sudo apt install curl

curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -

sudo apt install nodejs

node --version

npm version