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
# bash style: | |
/usr/bin/mail -s "Title" -r sender@sender.com receptor@receptor.com <<< "BODY" | |
# fish and bash: | |
echo "Body" | /usr/bin/mail -s "Title" -r sender@sender.com receptor@receptor.com |
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 | |
INPUT="harry_potter_2001_720p_philosphers_stone.mkv" | |
#INPUT="S01E05_fringe_1080p.mkv" | |
determinedQuality=$(echo "$INPUT" | grep -Po '[0-9]{3,4}[PpIi]') | |
determinedYear=$(echo "$INPUT" | grep -Po '[0-9]{4}[^A-Za-z]' | grep -Po '[0-9]{4}') | |
determinedEpisode=$(echo "$INPUT" | grep -Po '[Ss]{1}[0-9]{2}[Ee][0-9]{2}|[0-9]x[0-9]{2}') | |
echo "quality: $determinedQuality" |
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
<VirtualHost *:80> | |
# ... | |
RewriteRule "^/amule$" "/amule/" [L,R=301] | |
RewriteRule "^/transmission$" "/transmission/web/" [L,R=301] | |
RewriteRule "^/transmission/$" "/transmission/web/" [L,R=301] | |
# ... | |
ProxyPass /amule http://amule.pi4:4711 | |
ProxyPassReverse /amule http://amule.pi4:4711 | |
ProxyPass /transmission http://transmission.pi4:9091/transmission |
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 | |
if [ $# -eq 0 ]; then | |
echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2 | |
exit 1 | |
fi | |
if tty -s; then | |
file="$1" | |
file_name=$(basename "$file") | |
if [ ! -e "$file" ]; then | |
echo "$file: No such file or directory">&2 |
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
{ | |
"user": "user", | |
"passwd": "passwd" | |
} |
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 python | |
# -*- coding: utf-8 -*- | |
# selenium drivers: https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/ | |
# pip3 install selenium webdriver-manager | |
# for custom firefox installation: link firefox to /usr/bin/firefox, example: ln -s /opt/firefox/firefox-bin /usr/bin/firefox | |
from selenium import webdriver | |
from webdriver_manager.firefox import GeckoDriverManager | |
from selenium.webdriver.firefox.options import Options |
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
# ~/.bashrc | |
#... | |
source ~/.git-prompt.sh | |
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$$(__git_ps1 " (%s)") ' | |
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 ":git-branch:%s")$ ' | |
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]:\[\033[01;33m\]$(__git_ps1 "git-branch:%s")\[\033[00m\]$ ' | |
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]:\[\033[01;33m\]$(__git_ps1 "git[%s]")\[\033[00m\]$ ' | |
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;33m\]$(__git_ps1 "\[\033[00m\]:\[\033[01;33m\]git[%s]")\[\033[00m\]$ ' |
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
/* | |
When we program in typescript, sometimes we don't know what type of object is, and the declaration of the variable is erroneous with type "object" | |
variable.toString() | |
*/ | |
console.log(document.querySelector('body').toString()) | |
/* | |
output: | |
"[object HTMLBodyElement]" | |
*/ |
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 | |
su | |
apt-get install gdm3 | |
exit |
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
<?php | |
if(!isset($_SERVER['PATH_INFO'])) | |
$_SERVER['PATH_INFO'] = preg_replace("/\?".preg_quote($_SERVER['QUERY_STRING'])."/", '', $_SERVER['REQUEST_URI']); |