Skip to content

Instantly share code, notes, and snippets.

View agalazis's full-sized avatar
🦁
https://youtu.be/a-BOSpxYJ9M?feature=shared&t=2129

Andreas Galazis agalazis

🦁
https://youtu.be/a-BOSpxYJ9M?feature=shared&t=2129
View GitHub Profile
@agalazis
agalazis / rsync.sh
Created October 19, 2024 13:41
Most useful rsync flags for syncing folders
rsync -rtOvcs --progress -n ./src/ ./destination/
--recursive, -r recurse into directories
--times, -t preserve modification times
--omit-dir-times, -O omit directories from --times
--verbose, -v increase verbosity
--checksum, -c skip based on checksum, not mod-time & size
--secluded-args, -s use the protocol to safely send the args
@agalazis
agalazis / python_default_arguments.py
Last active January 17, 2024 09:13
Python default arguments example
# python defaults
import sys
def value_generator():
yield "first_value"
yield "this will never be returned because I am called once on parse"
values=value_generator()
def foo():
print("executing foo look at me I am called before runnig main :p")
@agalazis
agalazis / linux_performance.md
Last active August 11, 2023 15:21 — forked from Nihhaar/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@agalazis
agalazis / git-hooks-setup
Last active March 27, 2023 16:30
gitlab ticket commit messages
#!/bin/bash
RED='\033[1;31m'
NORMAL='\033[0m'
remove_hook() {
dir=$1
rm "$dir/.git/hooks/prepare-commit-msg"
echo "Removed hook from $dir/.git/hooks/prepare-commit-msg"
}
add_hook() {
@agalazis
agalazis / postgresql_date_function_index_howto.md
Created March 22, 2022 18:35 — forked from cobusc/postgresql_date_function_index_howto.md
Short explanation of the issues faced when trying to create a PostgreSQL index using the date() function and how to resolve it.

Given a table...

CREATE TABLE foo (
  id SERIAL PRIMARY KEY,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  ...
);
git for-each-ref --sort=taggerdate --format '%(tag)%(taggerdate)' | grep 2020 |wc -l
@agalazis
agalazis / ptgd sites.txt
Created October 27, 2019 14:53
Put the glass down sites...
https://blogs.dropbox.com/tech/
http://www.bash.org/?latest
http://www.commitstrip.com/en/?
https://www.monkeyuser.com/
https://devrant.com/search?term=joke&sort=algo
https://devdojo.com/fun
https://www.codemopolitan.com/
https://thecodinglove.com/
yes yes |for d in ./*/ ; do (cd "$d" &&terraform init && terraform 0.12upgrade ); done
@agalazis
agalazis / postman_fc29_install.sh
Created May 4, 2019 17:08 — forked from udomsak/postman_fc29_install.sh
Install postman on Fedora core 29 - Dec 2018
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
create-nx-workspace modulename --npm-scope=@modulename
ng generate lib components
ng generate module atoms --app="components"
ng generate module molecules --app="components"
ng generate module organisms --app="components"
ng generate app hospital-admin --routing
npm i -g @storybook/[email protected]
npm i --save-dev babel-core react react-dom
ng generate component atoms/input-field --app=components