Skip to content

Instantly share code, notes, and snippets.

View cirrusUK's full-sized avatar
πŸ’­
Dunroamin, Duncarin, Dunlivin.

cirrus cirrusUK

πŸ’­
Dunroamin, Duncarin, Dunlivin.
View GitHub Profile
#!/usr/bin/env python
import urllib.request
url = input("Enter the Youtube-url\n")
name = input("Enter the name for the video\n")
name=name+".mp4"
try:
print("Downloading starts...\n")
urllib.request.urlretrieve(url, name)
print("Download completed..!!")
except Exception as e:
#! /usr/bin/perl
# rename.pl -- rename files by finding a fixed pattern and replace it by other
# Carlos Duarte, 031105
# a clone of the rename(1) utility present in most linux distributions
use strict;
if (@ARGV < 3) {
#! /usr/bin/awk -f
# rand-line.awk -- output a random line from input
# $Id: rand-line.awk,v 1.3 1998/11/18 01:18:52 cdua Exp cdua $
# Carlos Duarte, 971027/981118
BEGIN {
srand()
for (i=1; i<ARGC; i++) {
s = ARGV[i]
#!/bin/sh
##Usage
# Download URLs from file (named queue) with history.
# The file named queue must be in the same dir as this script.
# 1.create & add download urls to ~/tmp/queue
# 2.place this file in ~/tmp and chmod +x it.
# 3. ./execute file and wget all the things.
# License: LGPLv2
@cirrusUK
cirrusUK / tvplayer
Created March 3, 2020 19:44
shell script which uses streamlink's tvplayer plugin to peruse live UK TV channels. πŸ“Ί
#!/bin/sh
#This script requires streamlink,mpv, pipe viewer (pv) & toilet.
#Uses streamlink's tvplayer plugin to peruse UK TV channels.πŸ“Ί
# Some streams require login to https://tvplayer.com use flags below to authenticate
#streamlink -p mpv 'https://foo' best --tvplayer-email your@mail --tvplayer-password yourpasswd
# (1) prompt user, and read command line argument.πŸ“‘
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
printf %"s\n"
#!/bin/bash
export XDG_RUNTIME_DIR=/run/user/$(id -u)
icon="/home/cirrus/.icons/48arch.png"
/usr/bin/ping -c 1 www.archlinux.org > /dev/null || { echo "archlinux.org is down. Aborting" && exit; }
ignore_db="AUR.db"
newest_db=$(ls -t -I ${ignore_db} /var/lib/pacman/sync | /usr/bin/head -n1)
newest_db_date=$(/usr/bin/stat /var/lib/pacman/sync/${newest_db} | /usr/bin/grep Modify | /usr/bin/sed s/Modify:\ //)
newest_db_date_utc=$(/usr/bin/date -u -d "${newest_db_date}" +%s)
newest_news_date=$(/usr/bin/curl -s --head https://www.archlinux.org/feeds/news/ | grep ^last-modified | sed -e s/^last-modified:\ //)
newest_news_date_utc=$(/usr/bin/date -u -d "${newest_news_date}" +%s)
@cirrusUK
cirrusUK / anews.py
Last active February 21, 2020 22:58
scripts using osd_cat, (xosd) some i put in crontab
#!/usr/bin/python
#Read Arch Linux RSS news;
import feedparser
from subprocess import call
import re
import textwrap
@cirrusUK
cirrusUK / kunst
Last active December 29, 2019 17:31
#!/usr/bin/env bash
# β”¬β”Œβ”€β”¬ β”¬β”Œβ”β”Œβ”Œβ”€β”β”Œβ”¬β”
# β”œβ”΄β”β”‚ ││││└─┐ β”‚
# β”΄ β”΄β””β”€β”˜β”˜β””β”˜β””β”€β”˜ β”΄
# Created by Siddharth Dushantha
#
# Dependencies: sxiv, imagemagick, bash, ffmpeg, mpc, jq
# Slight edit of script to define mpc -h <INTERNAL IP> so mpd will continue to run elsewhere on network
VERSION=1.2.4
COVER=/tmp/kunst.jpg
@cirrusUK
cirrusUK / rofi-streams.sh
Last active April 27, 2024 06:19
needs rofi, streamlink,mpv, acestream optional
#!/usr/bin/env bash
# author: unknown
#
# β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“
# β–‘β–“ author β–“ cirrus <[email protected]>
# β–‘β–“ code β–“ https://gist.github.com/cirrusUK
# β–‘β–“ mirror β–“ http://cirrus.turtil.net
# β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“
# β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
#
@cirrusUK
cirrusUK / MPVNP
Last active December 13, 2018 01:01
MPV now playing shell script [requires ponymix
#!/bin/bash
export DISPLAY=":0.0"
MPVNP=$(ponymix list | awk 'NR==16' | cut -c14- |sed 's/.\{6\}$//' )
notify-send -h string:bgcolor:#191919 -h string:fgcolor:#f2810d -i ~/.icons/mpv.png "πŸ“Ί MPV Now Playing " "$MPVNP"