All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

airikr / Install softwares and restore backup files

0 likes
0 forks
1 files
Last active 10 months ago
1 #!/bin/bash
2
3 # VARIABLES
4 dir_home='/home/{username}'
5 dir_backup='/to/dir'
6 GREEN='\033[0;32m'
7 YELLOW='\033[1;33m'
8 BLUE='\033[0;34m'
9 NC='\033[0m'
10 SLEEP='.5'

airikr / Useful bash scripts

0 likes
0 forks
1 files
Last active 8 months ago
These are my number one bash scripts. I can't live without them.
1 alias install_no="sudo pacman -Sy"
2 alias install_ya="yay -S --noconfirm"
3 alias backupvps="rsync -avhzr --delete --progress --rsh='ssh -p22' user@ip:/ --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile","/boot/*"} /to/dir/"
4
5
6 # Compress a video with CUDA acceleration (GPU from NVIDIA is required)
7 function reducevideo {
8 ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2"
9 }

airikr / age

0 likes
0 forks
1 files
Last active 2 years ago
Calculate the age of someone or something.
1 <?php
2
3 # Add the time for a more accurate calculation.
4 # The time format must be a string if it begins with a zero (0)
5
6 function age($year, $month, $day, $time = null) {
7 if(!is_numeric($year) OR !is_numeric($month) OR !is_numeric($day)) {
8 return 'XX';
9
10 } else {
Newer Older

Powered by Opengist ⋅ Load: 34ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文