This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install brew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/tatarurzvn/.zprofile | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
# Install oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# Update brew | |
brew update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
output_file="all_git_outputs.txt" | |
> "$output_file" | |
for dir in */; do | |
if [ -d "$dir/.git" ]; then | |
repo_name=$(basename "$dir") | |
echo "Processing $dir" | |
cd "$dir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define MAX_WEIGHT 10 | |
int getValoare(float values[], float weights[], int size) | |
{ | |
int currentWeight = 0; | |
int currentValue = 0; | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for port in $(ps aux | perl -ne 'print if not /perl/ and not /63790/ and /redis-server/;' | perl -F'\s+' -lane '@arr = split /:/, "$F[-1]"; print $arr[1];'); do | |
echo "==> Clients connected to Redis on TCP port [$port] <=="; | |
redis-cli -p $port client list; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg_dump -j 4 --section=pre-data -Fc -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > pre_date | |
pg_dump -j 4 --section=data -Fc -Z 9 -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > data_date | |
pg_dump -j 4 --section=post-data -Fc -Z 9 -d DB -h 127.0.0.1 -p 5432 -U postgres --schema public > post_date | |
# -j4 -> because 4 tables | |
# Split per sections | |
# -Fc -> pg_restore format | |
# -Z 9 -> copression (cool if i need to scp it) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
echo "Hey $USER, please enter a number: " | |
read NBR | |
CHECK=2 | |
IS_PRIME=1 | |
while [ $CHECK -lt `expr $NBR / 2` ] | |
do | |
if [ `expr $NBR % $CHECK` -eq 0 ] |