Skip to content

Instantly share code, notes, and snippets.

View djdagovs's full-sized avatar
😆
Szczęśliwy

djdagovs djdagovs

😆
Szczęśliwy
  • Mannhaim, Zachodnie Niemcy (Bawaria)
  • 00:40 (UTC +01:00)
  • X @dagovs38
View GitHub Profile
@Fraasi
Fraasi / git-bash-symlink.sh
Created December 7, 2022 11:49
my old git-bash symlink function from my dotfiles install.sh
#!/bin/bash
URL="https://wttr.in/"
URLv2="https://v2.wttr.in/"
URLv3="https://v3.wttr.in/"
Help()
{
echo -e "
Write 'wttr {your+city+name}' to check the weather condition of your city.
@acid-bong
acid-bong / sl-wttr.sh
Created May 10, 2022 19:35
Custom weather (wttr.in) module for slstatus. The first script writes weather info into the temp file (hourly job for cron), the second one is ran by slstatus and reads the file (every 0.25s, cuz i like to update seconds in the status bar as well)
#!/bin/bash
printf "%s" "$(</tmp/wttr)"
@Fraasi
Fraasi / wttr.sh
Last active January 5, 2023 23:51
simple wrapper function around http://wttr.io to get sensible defaults
#!/usr/bin/env bash
# simple wrapper function around http://wttr.io to get sensible defaults
# easily modified by changing the defaults and/or last parameters in the url
function wttr() {
USAGE="
Usage: wttr [OPTIONS]
Options:
-c <city> city name, double words with +, eg. new+york
@luiscbr92
luiscbr92 / Install No-IP DUC on Raspberry Pi and start it on boot.md
Last active January 26, 2026 08:39
Install No-IP DUC on Raspberry Pi and start it on boot

How to install No-IP on Raspberry Pi

This Gist will guide you on how to install the No-IP DUC (Dynamic Upadate client) on a RaspberryPi and to automatically start it on boot. For this I am going to use a RaspberryPi 4B 2GB, but I have already done the same on a RaspberryPi 3B. I am going to use Raspberry Pi OS.

As a prerequisite you should register on https://no-ip.com and create the host entry that will be used later with your Pi.

First thing is to open a Terminal and create a directory to work with during the installation.

mkdir noip
@9999years
9999years / rename-github-repos.sh
Created September 28, 2020 19:28
Rename the default branch on all your GitHub repos. Warning: this script deletes the old default branch, which makes GitHub *automatically close* open PRs to that branch.
#! /usr/bin/env bash
set -e
oldBranch="master"
newBranch="main"
# {{{ Colors, logging boilerplate
readonly PROG_NAME="$0"
function RESET { echo -e "\e[0m"; }
@Fraasi
Fraasi / cowsay-random-quote.sh
Created October 26, 2019 15:05
Curl random quote and pass it to cowsay
#!/bin/bash
declare -a MODES
MODES=("b" "d" "g" "p" "s" "t" "w" "y")
declare -a COWS
COWS=("tableflip" "aperture-blank" "beavis.zen" "bees" "biohazard" "box" "broken-heart" "cat" "cat2" "clippy" "cowfee" "cube" "default" "dragon" "hedgehog" "kilroy" "kosh" "nyan" "owl" "psychiatrichelp" "psychiatrichelp2" "shrug" "squirrel" "tux")
MODES_LENGTH=${#MODES[@]}
MODES_INDEX=$(($RANDOM % $MODES_LENGTH))
@aduzsardi
aduzsardi / shell-prompt.sh
Created March 14, 2019 08:41
bash prompt
export PS1='\[\e[1;33m\]\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]: \[\e[1;31m\]\w\[\e[0;36m\]$(__git_ps1 "\e[37m (\e[36m%s ⎇ \e[37m)\e[0m")\n\[\e[1;36m\]└─\$ ▶ \[\e[0m\]'
# if you don't have __git_ps1 (git-prompt.sh) , you can download it from here https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh , and source it in your bash init files (ie. .bashrc)
@djdagovs
djdagovs / dynmotd.sh
Created July 6, 2018 15:56 — forked from riipandi/dynmotd.sh
Simple Linux User Management
#!/bin/bash
# echo "" > /usr/bin/dynmotd; chmod +x /usr/bin/dynmotd; nano /usr/bin/dynmotd
USER=`whoami`
MEMORY1=`free -t -m | grep "buffers/cache" | awk '{print $3" MB";}'`
MEMORY2=`free -t -m | grep "Mem" | awk '{print $2" MB";}'`
# time of day
HOUR=$(date +"%H")
if [ $HOUR -lt 12 -a $HOUR -ge 0 ]; then
@riipandi
riipandi / raspbian.sh
Last active January 27, 2020 23:32
Rasberry Pi Configuration
# TV Online : https://www.vidio.com/live
useradd -mg sudo -s `which bash` ariss -c "Aris Ripandi" -p `openssl passwd -1 ripandi`
chsh -s `which bash` root ; chsh -s `which bash` ariss ; perl -pi -e 's#(.*sudo.*ALL=)(.*)#${1}(ALL) NOPASSWD:ALL#' /etc/sudoers
apt install axel htop whois binutils dnsutils zip unzip unrar tar p7zip nscd lsof \
crudini openssl openssh-server openssh-client curl screenfetch screen elinks nano
touch /usr/bin/duckdns ; chmod +x /usr/bin/duckdns
cat > /usr/bin/duckdns <<EOF