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/sh | |
# BIN_PATH=$(ls -d $HOME/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/*/bin | head -n 1) | |
BIN_PATH=$HOME/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/bin | |
("$BIN_PATH/idea.sh" "$@" >/dev/null 2>&1 &) |
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/sh | |
# BIN_PATH=$(ls -d $HOME/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/*/bin | head -n 1) | |
BIN_PATH=$HOME/.local/share/JetBrains/Toolbox/apps/pycharm-professional/bin | |
("$BIN_PATH/pycharm.sh" "$@" >/dev/null 2>&1 &) |
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/sh | |
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $@ |
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
package util.ext | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.count | |
import kotlinx.coroutines.flow.first | |
suspend fun <T> Flow<T>.all(predicate: suspend (T) -> Boolean): Boolean { | |
return this.count { !predicate(it) } == 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
#convert videos to be accepted by Twitter | |
function to_twitter() { | |
filename=$(basename -- "$1") | |
ext="${filename##*.}" | |
filename="${filename%.*}" | |
echo "Converting $1 to be compatible with the Twitter format." | |
ffmpeg -i $1 -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p -strict experimental -r 30 -t 2:20 -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -ac 2 $filename.twitter.mp4 | |
} |
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 | |
echo -n "Enter domain name ( e.g: example.com): " | |
read domain | |
echo -n "Enter your email address: " | |
read email | |
echo "Generating LetsEncrypt certificate for the domains: $domain and *.$domain" |
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
# JWT decoder | |
# How to use: | |
# token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' | |
# 1 - echo $token | jwtd | |
# 2 - jwtd $token | |
# # output: | |
# # { | |
# # "alg": "HS256", | |
# # "typ": "JWT", | |
# # "sub": "1234567890", |
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
#Author: Jorge Fernández Sánchez <[email protected]> | |
#This function clone a git project and makes (in the working directory) a zip file with the project content. | |
#project packing from git | |
function git_pack { | |
_PWD=$PWD | |
GIT_PATH=$1 | |
GIT_PROJECT=`/usr/bin/basename $GIT_PATH` | |
OUTPUT_ZIP="$_PWD/$GIT_PROJECT.zip" | |
TMP_PATH="/var/tmp/" |
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
""" Django-admin autoregister -- automatic model registration | |
## sample admin.py ## | |
from yourproject.autoregister import autoregister | |
# register all models defined on each app | |
autoregister('app1', 'app2', 'app3', ...) | |
""" | |
from django.apps import apps | |
from django.contrib import admin |