This file contains hidden or 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
| -- Keymaps are automatically loaded on the VeryLazy event | |
| -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua | |
| -- Add any additional keymaps here | |
| vim.keymap.set("n", "<C-b>", "<Cmd>Neotree toggle<CR>") |
This file contains hidden or 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 | |
| #set connection data accordingly | |
| source_host=xxx | |
| source_port=6379 | |
| target_host=localhost | |
| target_port=6379 | |
| #copy all keys without preserving ttl! | |
| redis-cli -h $source_host -p $source_port keys \* | while read key; do |
This file contains hidden or 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
| ssh -q -o ConnectTimeout=4 -oBatchMode=yes $host exit && echo Connexion successful $host |
This file contains hidden or 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
| ^(?!.*STRING1|.*STRING2|.*STRING3).*$ |
This file contains hidden or 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
| # Better zsh git prompt with zsh-git-prompt | |
| # Add it to your .zshrc after the plugins(... zsh-git-prompt ...) line | |
| # First, it rewrites git prompt style | |
| # Then overrides git_super_status() | |
| # And overrides build_prompt() from agnoster (depends of what you want) | |
| ZSH_THEME_GIT_PROMPT_PREFIX="" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
| ZSH_THEME_GIT_PROMPT_SEPARATOR=" " | |
| ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg[black]%}" |
This file contains hidden or 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
| setfacl -R -d -m g::rwx . | |
| # will set newly created files and folders ...rwx...+ :) |
This file contains hidden or 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 | |
| VIDEO="vlc" | |
| echo "Which stream?" | |
| read stream | |
| starting_video_proc_count=`ps aux | grep -v grep | grep $VIDEO | wc -l` | |
| nohup livestreamer twitch.tv/$stream best &>/dev/null & export LIVESTREAMER_ID=$! |
This file contains hidden or 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 | |
| # Backup | |
| sudo dd if=/dev/sda | gzip > /path/to/backup.iso.gz | |
| # Restore | |
| sudo bash -c "gzip -dc /path/to/backup.iso.gz | dd of=/dev/sda" |
This file contains hidden or 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
| sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXX |
This file contains hidden or 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
| for file in *.jpg; | |
| do OUT=${file%*.jpg}.pdf; | |
| convert -quality 300 -resize 60% $file $OUT; | |
| gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -sOutputFile=out.pdf $OUT; | |
| mv out.pdf $OUT; | |
| done |
NewerOlder